Skip to main content

Understand any codebase in 10 seconds.

Project description

ctx

Understand any codebase in seconds.

Generate architecture, dependencies, and AI-ready context from any repository.

ctx demo

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 ctx-cli

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fswitch_ctx-0.1.0.tar.gz (30.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fswitch_ctx-0.1.0-py3-none-any.whl (35.2 kB view details)

Uploaded Python 3

File details

Details for the file fswitch_ctx-0.1.0.tar.gz.

File metadata

  • Download URL: fswitch_ctx-0.1.0.tar.gz
  • Upload date:
  • Size: 30.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for fswitch_ctx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 414a0c2f194eecf17c3ec37e1c25b81bfd47446cb19638a14896dca7f813002b
MD5 eb617aabe7c443e9ace53ffbf6c5d8ea
BLAKE2b-256 8eed0ac38fa5c5ba8b47f50e2dbe0c99cbd486090bcf1a40b66ac0f34e7e8165

See more details on using hashes here.

File details

Details for the file fswitch_ctx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fswitch_ctx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for fswitch_ctx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f7f1e70764ed7c7e78f7f6b18e03efdb51fe6c440a5ce999db112a5c9294473f
MD5 9cbccf2734c5a5ed0dbc193c0218e55e
BLAKE2b-256 4ea158a411bafcd5300f55f5966e9c8f32772bbf291e0103fd20ccab2d73236c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page