Quick wins
Save schema tokens in 5 minutes: scan → mcp lazy
Split a drifted chat: chats drift → chats compact
Cap your spend: budget set → CI gate
Quick start
git clone <repo> tokenguard && cd tokenguard
npm install
node bin/tokenguard.js scan
node bin/tokenguard.js mcp audit --probe
node bin/tokenguard.js chats list
node bin/tokenguard.js docs index --write Command reference
The CLI reference is kept in English so it matches --help and the source. Command names and flags are identical in every locale.
tokenguard scan Overview: harnesses, chats, MCP overhead, dead projects, docs problems tokenguard chats list List chats with sizes and token counts tokenguard chats digest <id> Auto digest of a chat (no LLM): requests, files, commands tokenguard chats rename <id> "Название" Rename a chat by meaning using the native session/title event tokenguard chats archive <id> Archive or delete a chat with a tar backup tokenguard chats clean --older-than 30 Find and remove chats older than N days tokenguard chats drift [--all] Topic drift detector: where the conversation moved on and a new chat would pay off tokenguard chats compact <id> Compress the early part of a chat into a digest for a fresh one tokenguard chats tools <id> Repeated identical tool calls: how many times and how many tokens wasted tokenguard report [--days 7] Token profiler by day, session and tool, with cost estimates tokenguard budget set/status/check Daily and weekly token budget plus overrun checks tokenguard guard install/status/check Context-economy rule in AGENTS.md and topic drift checks tokenguard artifacts list Everything tokenguard created: backups, digests, lazy proxies, archives tokenguard artifacts clean --all Safely delete tokenguard artefacts (dry-run by default) tokenguard mcp audit [--probe] Discover MCP configs, count tools and schema tokens, show real usage tokenguard mcp lazy <server> Generate a lazy proxy: 2 tools instead of all of them, started on demand tokenguard mcp lazy --all [--apply] [--apply-dsh] Convert every stdio server to lazy mode; --apply-dsh patches the DSH profile tokenguard projects scan Dead and unfinished repositories judged by git metrics tokenguard projects archive <path> git bundle + tar + manifest, optionally moved to the archive tokenguard docs index Build INDEX.md: headings, summaries, duplicates, orphans, stale files tokenguard docs check Broken links, conflicting values (ports/versions), duplicated text, stale "as of" dates Safety principles
- Dry-run по умолчанию. Изменения только с --apply.
- Бэкап перед изменением. Всё сохраняется в ~/.tokenguard/backups.
- Живые сессии не трогаются. Если файл сессии изменён <2 минут назад — нужен --force.
- Никакой сети без флагов. Конспекты строятся локально, без LLM.
- Честные эвристики. docs check — не «истина в последней инстанции», а подсказки;
Lazy MCP in practice
node bin/tokenguard.js mcp lazy safari --probe GitHub · Changelog Changelog →