TokenCap maps every file and import in your repo, locally, then packs only what a task needs.
Median over 100 real commits in 9 open-source repos. 87% of the files each commit changed were in the pack.
See the benchmarktokencap make writes a short pointer file that each AI tool already reads at the start of a session. The MCP server then answers the agent's questions while it works.
Writes the MCP config for the tool it detects in your repo.
| File in your repo | Read by |
|---|---|
| CLAUDE.md | Claude Code |
| AGENTS.md | Codex, OpenCode |
| .cursor/rules/tokencap.md | Cursor |
| .windsurf/rules/tokencap.md | Windsurf |
| .clinerules/tokencap.md | Cline, Roo Code |
| .github/copilot-instructions.md | GitHub Copilot |
| .kiro/steering/tokencap.md | Kiro |
No network calls.The one command that goes online is tokencap update, which asks npm for a newer version. A test checks every source file for network imports on each build.
Secrets are redacted first.API keys, tokens, connection strings and private keys become [REDACTED] markers before anything is written to disk.
Plain files you can read.The index lives in .tokencap/ inside your repo as Markdown and JSON. Delete the folder and it is gone.
Install the CLI. Needs Node.js 18 or newer.
Index the repo you are in.
Connect your AI tool.