TokenCap
Maps every file and import in a repo, locally, then packs only what an AI coding task needs.
Won’tNever uploads your code.
- Role
- Creator
- When
- May 2026 – now · v3.1
- Built with
- Node.js CLInpmMCP serverTree-sitter (WebAssembly)js-tiktokenGitVS Code extensionChrome companion

Why it exists
AI coding agents start every session cold and spend tokens re-discovering the codebase. Pasting whole folders burns more tokens, leaves out how the files connect, and can leak API keys into a chat.
What it does
- tokencap make ranks every file by Git recency, importance and how many files depend on it, fits them into a token budget and writes the capsule.
- It points seven AI hosts at the same start file: AGENTS.md, CLAUDE.md, Cursor, Windsurf, Cline, Copilot and Kiro.
- tokencap ask builds a pack for one task, and a built-in MCP server gives agents 19 tools.
- The output is plain Markdown that works with GPT, Claude, Gemini and Llama models.
- Tree-sitter call resolution for JavaScript, TypeScript, Python, Go, Rust and Java, with impact analysis, taint tracking and safe refactors on top.
- A Chrome companion drops a redacted task pack into ChatGPT, Claude or Gemini through a bridge on your own machine.
What it won’t do
- No network egress: everything runs locally, and the browser bridge only listens on 127.0.0.1.
- Secrets are redacted before anything is written or injected.
- It never reads chat transcripts or sends telemetry, and session notes are staged for review, never saved silently.
- Learning only re-ranks files retrieval already found; it never adds a file or edits the rules by itself.
How it works
A local-first Node.js CLI. Tree-sitter parses the code into a call graph, files are ranked and fitted into a token budget, and the result is written as Markdown every major AI host already reads. On 100 real commits from 9 open-source repositories, the median task needed 18.7× fewer tokens than grep-and-read, and the files the commit changed were in the pack 88% of the time.
$ tokencap make --full
[scan] included files · 47
[graph] knowledge graph · 47 nodes, 83 edges
[memory] memory layer written
[secure] security engine active · redaction engine v1
[agent] pointers · AGENTS.md, CLAUDE.md, Cursor, Windsurf +3
[write] .tokencap/snapshot.md 49,608 tokens
Command output from the README sample. Token bars from the 100-task benchmark on tokencap.vansharora.app.
The ecosystem
By the numbers
A permission, citation and audit layer between a company’s people, its AI agents and its knowledge.
