TokenCap transforms how you capture, snapshot, and optimize code for LLMs. Built for scale performance, safe layout compression, workspace intelligence, local-first speed, and self-maintaining MCP.
820K raw AST tokens compressed into 14.6K packaged tokens in 82ms.
Sub-2ms IPC queries across Cursor, Claude Code, Windsurf & Cline.
Deep symbol tracing across Rust, Go, Java, Python, and TypeScript.
Full evolutionary path and changelog items for TokenCap CLI.
@tokencap/sdk is a dependency-free, dual-module interface (loadIntelligence, search, queryGraph, getImpact, buildContext) for intelligence that tokencap make has already generated. It never builds, watches, writes files, or makes network calls.tokencap analyze team records shared rules, decisions, approvals, profiles, and ADRs as append-only files under .tokencap/team/, committed with Git like any other file. No server, no cloud account.tokencapPlugins in package.json add afterBuild and beforeRedact hooks and named tools, with no require, process, or network access.tokencap make --migrate upgrades a v2 workspace to the v3 artifact contract. The v2 standalone aliases are removed and now print their canonical replacement, for example tokencap analyze health for tokencap health.skills/tokencap/ provides a standard skill definition (SKILL.md, commands.md, workflows.md) for OpenCode, Claude Code, Cursor, Codex, and Antigravity, shipped inside the npm tarball.tokencap_mcp_status.tokencap serve with the TokenCap Companion to inject repository context into ChatGPT, Claude, and Gemini through a local loopback bridge.make, ask, analyze, serve, update, help, and version; legacy commands remain compatible.POST /capture and tokencap remember are validated, secret-redacted, and scored against repository graphs (path validity, groundedness, specificity, novelty)..tokencap/memory/inbound/ with full provenance; review via tokencap remember --list/--approve/--reject/--note. Approved sessions archive to .tokencap/memory/sessions/ and feed tokencap handoff.tokencap health and tokencap rebuild generate explainable health ratings evaluating freshness, source drift, detection completeness, and coverage with remediation actions.tokencap risk normalizes findings (oversized-file, todo-density, possible-secret) with confidence, evidence, and persistent --ack/--dismiss tracking; adds PEP 621 and Poetry pyproject.toml dependencies parsing.tokencap watch-config configures persistent file watching intervals and ignore globs; tokencap memory aggregates observed token savings and dollar ROI across hosts.GET /primer on the loopback bridge returns a human-written ~1.5k token orientation so cold AI chats understand the project without expensive exploratory queries.tokencap serve retains loaded graph representations in an in-memory TTL cache, delivering up to 3x faster repeat IPC responses for companion extensions and agent tools while maintaining safe boundary invalidation on file modifications.POST /generate) and CLI context pack generation support --model and context sizing, tuning token budgets dynamically to match model context ceilings (Claude 3.5 Sonnet, GPT-4o, o1, Gemini 1.5 Pro).tokencap serve --daemon to launch detached background processes with robust PID file management, graceful teardown via tokencap serve --stop, and automated status checks.tokencap serve) — Inbound loopback HTTP server bound to 127.0.0.1:4545 enabling sandboxed browser extensions (TokenCap Chrome Companion) to access local intelligence via loopback IPC with zero network egress.GET /health, GET /projects (indexed projects registry), POST /generate (quick overview ~300 tok vs task query-scoped budgeted pack), POST /refresh, and POST /capture (501 reserved for v2.7).X-TokenCap-Token), enforces strict Origin allowlisting, and prevents external interface binding (bans 0.0.0.0).local-only.test.js) close require prefix bypasses while maintaining the strict 4 runtime dependencies rule.defineProps / props: / export let) and Angular component analysis without additional WASM grammars.tokencap analyze schema extracts tables and types from CREATE TABLE DDL and GraphQL type blocks, surfacing heuristic code links as evidence candidates.tokencap analyze taint tracks intra-procedural JS/TS data flow from user-input sources to dangerous sinks (SQL / exec / fs) with sanitizer modeling.dist/; the published npm package no longer requires src/.tokencap refactor rename) and uncalled dead code removal (tokencap refactor rm-dead) with byte-exact transform guarantees outside target ranges.tokencap analyze tests statically associates tests with exercised symbols, while --gaps identifies called-but-untested functions.lcov or Istanbul JSON reports (tokencap analyze tests --coverage <path>) annotating symbol-level line ranges without executing test suites.tokencap feedback record|report) with explicit telemetry: false.tokencap_refactor_plan and tokencap_test_map provide dry-run refactoring previews and static test associations over MCP.tokencap analyze review and tokencap_review MCP tool compile bounded review packets with base-ref symbol evidence, caller candidates, test associations, and Constitution/ADR context.tokencap analyze ownership --history and tokencap_ownership surface local Git churn, contributor distributions, and bounded co-change signals strictly as advisory context.tokencap mcp --init --client <host> records one selected host, and subsequent builds write only that host's entry point without overwriting existing files.tokencap.diff VS Code command and CLI diff intelligence for faster advisory reviews..tokencap/; never posts to Git providers, assigns PR reviewers, or creates commits.tokencap analyze simplify and tokencap_simplify report high-confidence unreachable code, duplicate artifacts, and review candidates without recommending automatic deletion..tokencap/debt/ledger.json and .tokencap/debt/TOKENCAP-DEBT.md, monitoring TODO/FIXME/HACK/DEBT markers and stable first-seen dates.tokencap stats --share, and VS Code shows saved tokens.tokencap compress <file> is now a dry-run by default, displaying a bounded diff and token savings before modifying any codebase files.tokencap compress <file> uses property-tested preserve rules to shrink generated Markdown formatting while guaranteeing code blocks stay 100% byte-exact.tokencap) and OpenAI Codex (tokencap-context).tokencap make, tokencap ask, tokencap ask brain, tokencap analyze diff, tokencap analyze constitution, tokencap analyze agent, tokencap security scan, tokencap security audit, tokencap mcp, tokencap debug..tokencap-notes.md and .tokencap-debug.md files directly from Git commit history and codebase structure..tokencap/savings.json on every build.js-tiktoken counting.AGENTS.md, CLAUDE.md, .cursor/rules/tokencap.md, .windsurf/rules/tokencap.md, .clinerules/tokencap.md, .github/copilot-instructions.md, and .kiro/steering/tokencap.md.tokencap scan (entropy & regex secret scanning), tokencap audit (security verification), and tokencap upgrade CLI utilities.--no-pointers Flag — Skip multi-host pointer creation when custom configuration management is preferred.Calculate exact token and dollar savings in real-time. Verified 12.2× average reduction (94.3% cost savings) with exact tiktoken counting.
Auto-wires non-overwriting pointer files for AGENTS.md, CLAUDE.md, Cursor, Windsurf, Cline, Copilot, and Kiro seamlessly.
Query repository intelligence live over stdio MCP (12 tool endpoints) with automatic startup init and background watching.
Analyze once. Update only what changed. Uses SHA-256 caching and dependency walks for sub-100ms updates.
Define permanent guidelines that AI agents must never violate (API contracts, database schema rules, security laws, compliance). Includes health scoring index.
Your code never leaves your machine. Processing happens entirely on-device for maximum security.