ctx
Understand any codebase in seconds.
Generate architecture, dependencies, and AI-ready context from any repository.
Why ctx?
Large repositories overwhelm AI assistants.
Without project structure, architecture, and key files, coding assistants produce generic or incorrect answers. ctx scans your project and generates the exact context they need to give you high-quality, file-specific guidance.
Built for developers:
- Works 100% offline
- No telemetry or tracking
- No API key required
- Optional LLM integration for deep Q&A
Install
pip install fswitch-ctx
How it works
Scan a real, well-known project to understand it instantly:
$ git clone https://github.com/vercel/next.js
$ cd next.js
$ ctx .
Output:
✓ TypeScript + Next.js
✓ Package Manager: pnpm
✓ 4,120 source files
✓ 180 dependencies
Architecture
packages/next/
test/
examples/
docs/
Scanned in 1.4s
Then, generate the perfect prompt context for your favorite AI assistant:
$ ctx export . --chatgpt
# or --claude, --gemini, --cursor
This creates a ctx.md file loaded with the structural context AI needs to reason about the codebase immediately.
Why not just upload the repository?
Large projects often exceed context limits.
Even when they do fit, AI spends tokens discovering the project structure instead of actually solving your problem. ctx summarizes the important parts first, so coding assistants can hit the ground running.
Benchmarks
Concrete performance on real-world projects:
| Project | Files | Scan Time |
|---|---|---|
| Flask | 180 | 0.2s |
| Next.js | 950 | 0.8s |
| Laravel | 1,700 | 1.2s |
| Vercel/Next.js (Monorepo) | 4,120 | 1.4s |
More capabilities
ctx comes with a few extra tools that are incredibly valuable once you're familiar with the basics:
ctx ask "Where is authentication?"— Uses smart indexing to point you exactly to the files and lines you need.ctx deps— Visualizes the dependency graph and internal architectural flow (e.g.,Router -> Service -> DB).ctx architecture— Gives a deeper dive into the technologies detected.ctx tui— Browse all of this locally in a beautiful, full-screen terminal interface.
Supported Languages
ctx automatically detects and analyzes:
- TypeScript/JavaScript (Next.js, React, Vue, Svelte, Express, etc.)
- Python (Django, Flask, FastAPI, Typer, etc.)
- Rust, Go, Java, Ruby, PHP
Upcoming Killer Features
Our long-term vision is to be the Git for understanding codebases. Here is what's coming next:
ctx explain src/auth/login.ts— Get the purpose, flow, and related files for any script.ctx trace login— Follow execution paths (e.g.,Button -> Component -> API -> Service -> DB).ctx impact auth.ts— See exactly what breaks if you change a file before you change it.ctx find stripe— Instantly find all files, concepts, and env vars related to a domain.ctx health— CI-ready codebase health checks (circular imports, unused deps, missing tests, etc.).
License
MIT
Metadata
Release files for fswitch-ctx 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fswitch_ctx-0.1.3.tar.gz | 612.7 kB | Without provenance | Details for fswitch_ctx-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fswitch_ctx-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for fswitch_ctx-0.1.3-py3-none-any.whl |
Total release size: 648.1 kB
Release files / fswitch_ctx-0.1.3.tar.gz
| Download URL | fswitch_ctx-0.1.3.tar.gz |
|---|---|
| Size | 612.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e7bcb7152c7802c2cf3267975833aa1b74337a69e98b2ec87373bdc30b7e46e1
|
|
BLAKE2b-256 checksum How to use checksums |
4d9517856bac63f0860f2a59a9d1f1ff17080f4b2b0fab2bd81db2d9c9e9e7d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / fswitch_ctx-0.1.3-py3-none-any.whl
| Download URL | fswitch_ctx-0.1.3-py3-none-any.whl |
|---|---|
| Size | 35.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
45d8cdc0f6acde851c886172bc2def585a24330290db5cc0321218a878713a0b
|
|
BLAKE2b-256 checksum How to use checksums |
55b166bef5947491e1c53a06321fcb840e5231d96f0323e5811302d1dfa44e9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Security for fswitch-ctx 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.