{"slug": "moving-an-older-tokencap-setup-over-three-commands-and-an-alias-table", "title": "Moving an Older TokenCap Setup Over: Three Commands and an Alias Table", "summary": "A developer documented migrating repositories from an older TokenCap CLI to the current release using three commands: a global npm install, `tokencap make --migrate`, and `tokencap make`. The migration upgrades `.tokencap/config.json`, publishes JSON schemas, writes migration and build records, and removes legacy compatibility aliases in favor of a seven-command surface, with removed commands exiting 1 and naming their replacements. The writeup also notes behavior changes such as new constitution rule IDs, `.mcp.json` written at the project root for Claude Code, and `--flag=value` parsing.", "body_md": "TokenCap's CLI is organised around seven commands, and the generated artifacts follow published JSON schemas. If a repository was set up with an older TokenCap, this is the whole move.\n\n```\nnpm install -g tokencap\ntokencap make --migrate\ntokencap make\n```\n\nThe install gets the latest TokenCap, which carries the fixes covered in recent posts: stricter redaction that leaves code references intact, every language parsing on Node 18 and 20, and an MCP server that no longer times out on a first run.\n\nCheck the install:\n\n```\ntokencap version\n```\n\nThen, in each repository, run the other two commands.\n\n`tokencap make --migrate` upgrades `.tokencap/config.json` to the current format, publishes JSON schemas in `.tokencap/schemas/`, and writes `.tokencap/migration.json`. It prints the three paths and ends by telling you to run `tokencap make`.\n\nThe following `tokencap make` regenerates the artifact manifest and writes a build record, `.tokencap/build.json`, with the commit, time and the layers that built. Migration is a `make` flag on purpose, so the CLI stays at seven commands: `make`, `ask`, `analyze`, `serve`, `update`, `help`, `version`.\n\nThe old compatibility aliases are gone. The ones you are most likely to have in scripts:\n\n| Old command | Current command | \n|---|---|\n| `tokencap impact <file>:<sym>` | `tokencap ask impact <file>:<sym>` | \n| `tokencap health` | `tokencap analyze health` | \n| `tokencap rebuild` | `tokencap make --rebuild` | \n| `tokencap remember` | `tokencap serve session save` | \n| `tokencap memory` | `tokencap serve session list` | \n| `tokencap handoff` | `tokencap serve session handoff` | \n| `tokencap migrate` | `tokencap make --migrate` | \n| `tokencap compress <file>` | `tokencap analyze compress <file> --write` | \n| `tokencap stats` | `tokencap analyze stats` | \n| `tokencap debt` | `tokencap analyze debt` | \n| `tokencap risk` | `tokencap analyze risk` | \n| `tokencap refactor` | `tokencap analyze refactor` | \n| `tokencap verify` | `tokencap analyze verify` | \n| `tokencap security scan` | `tokencap analyze security scan` | \n\nYou do not have to grep your scripts first. A removed command prints a one-line error that says it was removed and names its replacement, then exits 1. `tokencap rebuild` points you to `tokencap make --rebuild`, and `tokencap remember` to `tokencap serve session save`.\n\nIt does not guess and run the new command for you. A CI job that calls an old name fails loudly, with the fix in the log line.\n\n`tokencap mcp` is the one exception to the removals. It still starts the MCP server, so host configs written for the old CLI keep working without edits. New configs written by `tokencap serve --mcp --init` launch `tokencap serve --mcp`.\n\nThe MCP tool contract is stable: tools are not renamed and documented fields keep their meaning. `tokencap_mcp_status` reports the contract the server speaks.\n\nOne thing to check if you use Claude Code: older builds wrote the config to `.claude/mcp.json`, which Claude Code does not read. TokenCap now writes `.mcp.json` at the project root:\n\n```\ntokencap serve --mcp --init --client claude-code\n```\n\nAn existing `tokencap` entry is kept unless you pass `--force`.\n\nComing from an older setup also brings a few behaviour changes. The ones most likely to touch you:\n\n`CONST-API-F5BF63`). Every ID changes once. A manual override that reuses an old positional ID like `CONST-API-001` becomes an extra rule; copy the new ID from `.tokencap/constitution/constitution.yaml`.` AGENTS.md` is no longer overwritten.`make` only refreshes it while it still holds a TokenCap template.`OPENAI_API_KEY = '[REDACTED:KEY]'` instead of `OPENAI_API_KEY=[REDACTED:KEY]`. Update anything that matches the old form.`--flag=value` is parsed, so `make --root=X` now builds into X.\nAfter this, `tokencap update` keeps you current. It is the only command that uses the network. `make`, `ask`, `analyze health`, `diff` and `update` each end with one `Next:` line, and when the index is behind your commits that line tells you to rebuild first.\n\nThe open work is evidence, and it is listed in `HONEST-NUMBERS.md`. The model-in-the-loop harness, `benchmarks/fair/answer-eval.js`, exists but has not been run, so there is no published answer-quality result yet. The current benchmark measures whether the task pack holds the files a real commit changed, on 100 tasks: 89% of the needed files are shown as code, 74% of the edited lines are in the pack, at a median 18.4x fewer tokens than a keyword grep. On the held-out tasks: 88.9%, 74.5% and 18.0x. Grepping everything still finds more files (96%), and that limit is written down next to the number.\n\nWhat would help most:\n\nMigration notes, docs and the changelog are at tokencap.vansharora.app", "url": "https://wpnews.pro/news/moving-an-older-tokencap-setup-over-three-commands-and-an-alias-table", "canonical_source": "https://dev.to/vansharora21/moving-an-older-tokencap-setup-over-three-commands-and-an-alias-table-2nk4", "published_at": "2026-11-26 17:10:58+00:00", "updated_at": "2026-11-26 17:15:25.985591+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-agents", "agent-protocols"], "entities": ["TokenCap", "Claude Code", "Node 18", "Node 20", "MCP"], "also_reported_by": [], "takeaway": "TokenCap's migration is `tokencap make --migrate` followed by `tokencap make`, and removed aliases like `tokencap rebuild` now exit 1 pointing to `tokencap make --rebuild` rather than running the new command.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/moving-an-older-tokencap-setup-over-three-commands-and-an-alias-table", "markdown": "https://wpnews.pro/news/moving-an-older-tokencap-setup-over-three-commands-and-an-alias-table.md", "text": "https://wpnews.pro/news/moving-an-older-tokencap-setup-over-three-commands-and-an-alias-table.txt", "jsonld": "https://wpnews.pro/news/moving-an-older-tokencap-setup-over-three-commands-and-an-alias-table.jsonld"}}