TokenCap provides a CLI for generating AI-ready project context, querying intelligence, safe refactoring, static test analysis, analyzing changes, debugging, secret scanning, and serving local MCP requests.
---
Installation
Install TokenCap globally:
Verify installation:
---
tokencap refactor
Plan and apply safe symbol renames or dead code removal across the AST call graph.
tokencap refactor rename src/auth/token.js:validateToken checkToken
tokencap refactor rename src/auth/token.js:validateToken checkToken --write
tokencap refactor rm-dead src/util/helpers.js:unusedHelper --write
---
tokencap analyze
Run codebase analysis, static test mapping, review packets, ownership signals, or dead code detection.
tokencap analyze tests --gaps
tokencap analyze tests --coverage coverage/lcov.info
tokencap analyze review --base main
tokencap analyze ownership --history
tokencap analyze simplify
---
tokencap feedback
Record and report local context utility for AI coding sessions.
tokencap feedback record --agent claude --outcome helped
tokencap feedback report
---
tokencap make
Generate a complete AI-ready project context snapshot.
Options
--profile <name> — compact | balanced | deep | gpt-4o | claude-3-5-sonnet | gemini-1.5-flash | gemini-1.5-pro | llama-3-8b--full — Force full rebuild (bypasses incremental cache)--no-pointers — Skip multi-host agent pointer file generation--open-graph — Open interactive Obsidian-style graph viewer in default browser--max-files <n> — Maximum number of files to include--max-bytes <n> — Total source byte budget
---
tokencap scan
Scan workspace source files for leaked secrets and high-entropy API tokens.
---
tokencap audit
Perform a security audit on generated TokenCap outputs to verify redaction engine compliance.
---
tokencap upgrade
Check for and install updates to TokenCap.
---
tokencap mcp
Model Context Protocol (MCP) server & host IDE configuration.
tokencap mcp --init --client claude
---
tokencap brain
Project Brain — unified cluster intelligence query.
---
tokencap agent
Generate the Self-Loading Universal Context Layer.
tokencap agent --execution
---
tokencap constitution
Repository Constitution rules and laws management.
---
tokencap diff
Perform semantic Change Intelligence analysis.
---
tokencap debug
Unified debug session management.
tokencap debug --start -- npm test
---
tokencap pack
Generate token-budgeted, importance-scored context packs.