Filesystem-native context layer for AI agents — generates CONTEXT.md manifests for codebase navigation
Project description
ctx
Filesystem-native context layer for AI agents.
ctx generates CONTEXT.md manifests for every directory in a project so AI agents can navigate with structured summaries instead of reading every file. One command refreshes the entire tree. Manifests are deterministic, verifiable, and cheap to maintain.
Quick Start
pip install ctx-tool
export ANTHROPIC_API_KEY="sk-..."
ctx refresh .
That's it. Every directory now has a CONTEXT.md with a purpose summary, file descriptions, and subdirectory overviews.
What It Costs
ctx uses lightweight LLM calls (Haiku-class models by default). Real-world benchmarks on personal document trees:
| Tree | Dirs | Files | Cost | Time |
|---|---|---|---|---|
| 31 dirs | 31 | 566 | $0.11 | 7 min |
| 171 dirs | 171 | ~1,200 | ~$1.26 | ~15 min |
Runs are incremental — unchanged directories are skipped, so subsequent refreshes cost near zero.
For Agents
Tell your agent: install ctx-tool, run ctx refresh ., then read AGENTS.md for the full command contract, JSON output schemas, error codes, and integration patterns.
For MCP clients, copy the config from mcp.json into your client's MCP config (.mcp.json for Claude Code, .cursor/mcp.json for Cursor) or run ctx serve --mcp.
Commands
| Command | Purpose |
|---|---|
ctx refresh <path> |
Generate or update manifests |
ctx check <path> |
Validate manifest health, coverage, freshness |
ctx export <path> |
Concatenate manifests for agent ingestion |
ctx reset <path> |
Remove all generated manifests |
ctx serve --mcp |
Expose manifests via MCP (stdio JSON-RPC) |
Key flags: --until-complete (auto-retry large trees), --output json (machine-readable), --force (regenerate all), --watch (live refresh).
Configuration
Works out of the box with ANTHROPIC_API_KEY or OPENAI_API_KEY. For local models:
ctx refresh . --setup # auto-detects Ollama or LM Studio
Fine-tune with .ctxconfig:
provider: anthropic
model: claude-haiku-4-5-20251001
max_usd_per_run: 1.00
Full config reference in AGENTS.md.
Docs
| Doc | Audience |
|---|---|
| AGENTS.md | Agents — command contract, schemas, integration patterns |
| architecture.md | Developers — engine design and data flow |
| CONTRIBUTING.md | Contributors — dev setup and workflow |
| state.md | Maintainers — roadmap and phase history |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ctx_tool-1.0.0.tar.gz.
File metadata
- Download URL: ctx_tool-1.0.0.tar.gz
- Upload date:
- Size: 115.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eaeffaea2f42cac593a89f4a9ccf0a5ee8cea7a44fa0ed8356f805e4b7ca6f89
|
|
| MD5 |
eb80b3e94e0a82203eaba35a409fc481
|
|
| BLAKE2b-256 |
5fec5e8a3266557331aec1e490fd35a9950bbf6494063241518843dee22ae6f6
|
Provenance
The following attestation bundles were made for ctx_tool-1.0.0.tar.gz:
Publisher:
publish.yml on mschwar/context-project
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ctx_tool-1.0.0.tar.gz -
Subject digest:
eaeffaea2f42cac593a89f4a9ccf0a5ee8cea7a44fa0ed8356f805e4b7ca6f89 - Sigstore transparency entry: 1144643901
- Sigstore integration time:
-
Permalink:
mschwar/context-project@a5004d222cf7ef966a74c321b1a0d1fda4e66ecd -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/mschwar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a5004d222cf7ef966a74c321b1a0d1fda4e66ecd -
Trigger Event:
push
-
Statement type:
File details
Details for the file ctx_tool-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ctx_tool-1.0.0-py3-none-any.whl
- Upload date:
- Size: 72.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b291ca01acfe4bd2285f98b35b1209f6454ebb2a7c0f86a62427ac7901df1c2
|
|
| MD5 |
1026d65ed950a340d458c5b4e987d7f2
|
|
| BLAKE2b-256 |
daea969ece96502d127eb313ca8e10a5dee808ee1c6862af49801b5dd75efec5
|
Provenance
The following attestation bundles were made for ctx_tool-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on mschwar/context-project
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ctx_tool-1.0.0-py3-none-any.whl -
Subject digest:
5b291ca01acfe4bd2285f98b35b1209f6454ebb2a7c0f86a62427ac7901df1c2 - Sigstore transparency entry: 1144643911
- Sigstore integration time:
-
Permalink:
mschwar/context-project@a5004d222cf7ef966a74c321b1a0d1fda4e66ecd -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/mschwar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a5004d222cf7ef966a74c321b1a0d1fda4e66ecd -
Trigger Event:
push
-
Statement type: