token-savior
Token Savior is an MCP server that gives AI coding agents structural code navigation, persistent memory, and Bash-output handling to cut token usage.
Project management: list/switch/register workspace roots, reindex, summarize a project, list indexed files, inspect file structure.
Code navigation: locate symbols, fetch function/class source, list functions/classes/imports, regex or semantic
search_codebase, search that reports enclosing symbols, full-context bundles, call chains, routes, entry points, feature-file tracing.Dependency & impact analysis: outgoing deps, incoming dependents, transitive change impact, file-level import edges, import cycles, semantic/AST duplicate finder, complexity/performance hotspots, dead-code audit.
Structural editing: replace a symbol's source, exact string edits scoped to a symbol, insert near a symbol, move a symbol across files with import fixes, add a field to a model, plus a pre-edit context bundle.
Git & change review: git status, symbol-level changed-symbol summary, commit/review narrative builder, checkpoint create/list/restore/delete/prune/compare, breaking-API-change detection vs a ref.
Testing & actions: infer impacted pytest files, run impacted tests, discover conventional build/test/lint actions, run a discovered action with bounded output/timeout.
Config & infra audits: audit .env/.yaml/.toml/.json for duplicates/secrets/orphans, inspect Dockerfiles, condense SQL migration schemas, trace an env var across code and configs.
Persistent memory: save/search/read/archive observations, compact memory index, build and query thematic corpora, store/search/list reasoning traces, and a single admin dispatcher for status, dedup, distill, ROI GC, vector reindex, etc.
Capture sandbox: store verbose tool outputs, BM25-search them, read ranges, aggregate/extract stats, list, and purge.
Agent meta-tools: discover missed Token Savior opportunities from transcripts, report usage/telemetry stats, semantically find the right tool, and run JS scripts in a Node sandbox that chains multiple TS tools in one round-trip.
Synchronizes the codebase index by monitoring git status and diffs, and provides symbol-level impact analysis since specific git references.
Indexes documentation files via heading detection to allow section-based navigation and querying.
Identifies and executes specific tests impacted by symbol changes, providing compact summaries instead of raw logs.
Provides structural indexing and surgical source code retrieval for Python projects, including functions, classes, and dependency mapping.
Indexes Rust projects to extract and query symbols such as functions, structs, traits, and impl blocks.
Enables structural analysis and symbol extraction for TypeScript and JavaScript, covering functions, interfaces, and type aliases.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@token-savior What is the impact of changing the LLMClient class?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Token Savior
One MCP server. One profile. 97.9% on tsbench at -80% tokens. Structural code navigation, persistent memory, and Bash command rewriting for AI coding agents.
mibayy.github.io/token-savior -- project site + benchmark landing Benchmark source + fixtures: not currently published (see Reproducing the score below)
v4.23 in 31 seconds, measured on 2026-10-07 · watch the full video (MP4, sound on)
Benchmark -- 96 real coding tasks (Claude Opus 4.7, May 2026)
Plain Claude Code | With Token Savior | |
Score | 141 / 180 (78.3%) | 188 / 192 (97.9%) |
Active tokens / task | 17 221 | 3 395 (-80%) |
Wall time / task | 110.6 s | 18.9 s (-83%) |
Reproduces with the optimized profile (single env var). The harness that
produced these numbers is described below; its repository is not public at the
moment, so take the figures as reported rather than as independently verifiable.
A re-measurement was published here on 2026-08-09 and has been withdrawn on
2026-08-10. It reported new-token savings from a small replacement harness.
Those numbers did not measure this server at all: across 143 benchmark
sessions, exactly one called a Token Savior tool. The client running the
harness had MCP deferred-tool loading enabled, so all 18 tools sat behind a
ToolSearch lookup instead of appearing in the model's manifest. The model
never saw them and fell back to Grep and Read — 66 greps, 30 reads, one
MCP call. What varied between the "profiles" was the size of the cached
prefix, not what the agent did.
The lesson is worth more than the numbers were: a benchmark of an MCP server must assert that its tools were actually called. Ours did not, so it happily compared two identical agents. That assertion now exists in the harness.
The headline figures above therefore stand as reported and unverified, as stated in the previous paragraph.
Re-measured on 2026-10-07, with the tools actually called. Same 8 tasks
on a frozen copy of this repo (commit 9d15a1e, no CLAUDE.md), Claude
Haiku 4.5, plain Claude Code against the auto profile with alwaysLoad.
The harness checks that the Token Savior sessions really called the server.
3 passes, mean ± sd | Plain Claude Code | v4.23.0 |
Cost, 8 tasks | $0.226 ± 0.011 | $0.123 ± 0.020 (-45%, range -39% to -53%) |
New tokens | 92 609 ± 6 731 | 38 150 ± 7 618 (-59%) |
Sessions that used TS | — | 23 / 24 |
Wall time, 8 tasks | 157 ± 26 s | 216 ± 9 s (+40%) |
All 48 sessions succeeded. v4.22.0, measured once, saved 14% and used the tools
in 5 sessions out of 8. Editing, measured on 2026-10-08 on the same repository (3 tasks in files of
1 900 to 3 700 lines, graded by running the code and the module's tests,
4 passes): every session of both arms succeeded, and cost is too noisy to call
a gain (from -54% to +16% per pass). Native Edit only needs a partial
Read, so there is little left to remove there.
Wall time is worse because each benchmark session starts a fresh server that
indexes the repo first; a long-lived session pays that once. What moved from
v4.22.0 to v4.23.0 is mostly wording: search_codebase now names the function
holding each hit, and the tool descriptions say plainly which native call they
replace.
Who starred this repo?
On June 30, 2026 GitHub restricted stargazer and watcher lists to repo admins and collaborators, which broke every "who starred my repo" tool at once. I rebuilt one that still works, precisely because it only reads repos you own or can push to: starscope ranks the people who starred or forked your repo by influence, and surfaces their social accounts when their GitHub profile declares them.
Numbers on this very repo, computed with it: 1,147 people, 27% with a public social account, and the most followed carries 18,922 followers. The named list is visible to the repo owner and to nobody else — the public page shows aggregates only.
Related MCP server: astllm-mcp
What's new
Release notes live where they can't drift out of sync with the code:
CHANGELOG.md for the full history
Releases for the tagged builds
PyPI for what
pipwill actually give you
Quick start
pip install "token-savior-recall[mcp]"Add to your MCP config (e.g. Claude Code):
{
"mcpServers": {
"token-savior-recall": {
"command": "/path/to/venv/bin/token-savior",
"alwaysLoad": true,
"env": {
"WORKSPACE_ROOTS": "/path/to/project1,/path/to/project2",
"TOKEN_SAVIOR_CLIENT": "claude-code",
"TOKEN_SAVIOR_PROFILE": "optimized"
}
}
}
}"alwaysLoad": true matters on Claude Code (2.1.28x and later): without
it, every tool of the server sits behind ToolSearch and the model reaches for
Read and Grep, which are already loaded. Measured on this project's
benchmark before the option existed: one session in 143 called a Token Savior
tool. With it, the manifest costs a few thousand cached tokens per session.
That's it. TOKEN_SAVIOR_PROFILE=optimized ships the Pareto-optimum
config that wins tsbench. It bundles:
tiny_plus(15 hot tools manifest)thin inputSchema (-44% manifest)
capture sandbox disabled
memory hooks gated for cross-project safety
No other tuning needed.
Activation (Bash compaction + rewriting)
Bash compaction and the PreToolUse rewriter are opt-in. Two env vars and one CLI call:
export TS_BASH_COMPACT=1 # PostToolUse output compactors (34 of them)
export TS_BASH_REWRITE=1 # PreToolUse command rewriter (10 rules)
ts init --agent claude --yes # auto-merge hooks into ~/.claude/settings.jsonts init is idempotent. It detects existing hook entries, dedups by
(matcher, command), prints a unified diff, and backs up settings.json
to .bak-YYYYMMDD-HHMMSS (UTC) before writing. Supported agents:
claude, cursor, gemini, codex, openclaw. Pass --dry-run to preview, or
--global to write the user-level config.
Optional audit log of every rewrite:
export TS_BASH_REWRITE_LOG=$HOME/.local/state/token-savior/rewrites.jsonlCompactor catalog (34)
Family | Compactors |
git |
|
gh |
|
test/lint |
|
cloud |
|
docker |
|
packaging |
|
shell catch-alls |
|
Each compactor is a pure function (no I/O, no globals) returning a
token-efficient rendering. The dispatcher returns None when no matcher
fires, leaving the existing sandbox path untouched. Compound commands
(cd ... && cmd) fall through to the last meaningful segment.
These run in PostToolUse, so they do not shrink the current turn. The hook fires after the tool has returned; it can add context, not remove it. The compact rendering is appended below the raw output, which stays. What you gain is persistence: the full output goes to the capture sandbox and outlives a context compaction. For an actual reduction of what reaches the model, use the PreToolUse rewriter (
TS_BASH_REWRITE=1) — it edits the command before it runs.
ts_discover -- find missed TS opportunities
New MCP tool that scans your Claude Code transcripts for patterns where TS tools would have been cheaper than what the agent actually did.
ts_discover() # active project, last 30 days
ts_discover(project=None) # ALL transcript projects
ts_discover(format="adoption") # TS vs native ratio per session
ts_discover(format="adoption_json") # same, JSONFindings: Read->Grep->Read chains, sequential find_symbol, edits
without get_edit_context, memory_search without memory_index,
native shell on code files. Args are pruned to load-bearing keys
(PII-safe). Streams JSONL with mtime fast-skip.
ts init CLI
ts init --agent claude [--global] [--dry-run] [--yes]
ts init --agent cursor
ts init --agent gemini
ts init --agent codex
ts init --agent openclawDetects the target agent's settings location, deep-merges the Token
Savior hook config (PostToolUse + PreToolUse), preserves existing
hooks, dedups, prints a unified diff. Backs up to
settings.json.bak-YYYYMMDD-HHMMSS (UTC). Re-running is a no-op.
What it does
Claude Code reads whole files to answer questions about three lines, and forgets everything the moment a session ends. Token Savior fixes both, plus a third axis: it bounds the noisy Bash output that bloats turn budgets between code reads — by rewriting the command before it runs.
It indexes your codebase by symbol -- functions, classes, imports, call
graph -- so the model navigates by pointer instead of by cat. Measured
reduction: 97% fewer chars injected across 170+ real sessions.
On top of that sits a persistent memory engine. Every decision, bugfix, convention, guardrail and session rollup is stored in SQLite WAL + FTS5
vector embeddings, ranked by Bayesian validity and ROI, and re-injected as a compact delta at the start of the next session.
And on top of that, since v4.1, sit the Bash compactors and the PreToolUse rewriter. Bench numbers above.
Which of those two actually shrinks a turn, and which does not. Measured 2026-08-09, and worth stating plainly because the distinction is not obvious:
The PreToolUse rewriter changes the command before it runs, so a smaller output is produced and a smaller output reaches the model. This is a real reduction in the current turn.
The PostToolUse compactors run after the tool has returned. A PostToolUse hook can only add context; by the time it fires, the raw output has already been sent. The compact rendering is appended, it does not replace anything. What the compactors genuinely buy you is different and still valuable: the full output is preserved in the capture sandbox and survives a context compaction, so it can be queried later instead of being re-run.
If your goal is a smaller turn, TS_BASH_REWRITE=1 is the switch that does
it. If your goal is to stop losing command output across compactions, that is
TS_BASH_COMPACT=1.
Profile comparison
Profile | Tools exposed | Manifest tokens | When to use |
| 15 | ~1.5 KT | Recommended default -- Pareto win on tsbench |
| adaptive | ~1-2 KT | Per-client telemetry-based (experimental) |
| 6 | ~0.6 KT | Minimal hot loop |
| 51 | ~4 KT | Legacy -- broader surface |
| 1 | ~0.3 KT | Bash layer only (rewriter + capture) -- you already run symbol nav elsewhere |
| 68 | ~6 KT | Everything exposed |
You probably want optimized.
How it composes with adjacent tools
Token Savior spans several layers, and most neighbouring tools occupy exactly one of them. Overlap is opt-out per layer, so running both is usually fine once you disable the half you already have. Thanks to @chirag127 for mapping this out in #45.
Tool | Layer | Overlap | What to do |
RTK (repo currently unreachable) | PostToolUse Bash output compression | Same layer, same PostToolUse limit: neither shrinks the current turn | Pick one. |
Symbol-graph navigation | Direct, with | Run TS as | |
codebase-memory | Persistent code graph | With the memory engine |
|
Ponytail, Caveman | Output-side compression (code and prose) | Partial: Token Savior ships an opt-in Ponytail-style discipline ( | Complementary, no knob needed |
The layers Token Savior owns that these do not: the PreToolUse Bash rewriter
(it shrinks the command before it runs, not the output after), structural
editing that keeps the index in sync, and the audit tools
(detect_breaking_changes, find_dead_code, analyze_config).
If you only want the Bash layer, TOKEN_SAVIOR_PROFILE=compact-only advertises
a single tool and leaves the compactors and rewriter running. Of those two, the
rewriter is the one that reduces the current turn.
Token savings
Operation | Plain Claude | Token Savior | Reduction |
| 41M chars (full read) | 67 chars | -99.9% |
| grep + cat chain | 4.5K chars | direct |
| impossible | 16K chars | new capability |
96-task tsbench (Opus, plain vs ts) | 17 221 active/task | 3 395 active/task | -80% |
7-day Bash output bench (v4.3) | ~30 K tokens/week | ~9.6 K tokens/week | ~20.4 K/week |
Install
pip (MCP server)
pip install "token-savior-recall[mcp]"
# Optional hybrid vector search:
pip install "token-savior-recall[mcp,memory-vector]"uvx (no venv, no clone)
uvx token-savior-recallClaude Code one-liner
claude mcp add token-savior -- /path/to/venv/bin/token-saviorDevelopment
git clone https://github.com/Mibayy/token-savior
cd token-savior
python3 -m venv .venv
.venv/bin/pip install -e ".[mcp,dev]"
pytest tests/ -qSuite size: 1898 passed, 2 skipped on main. CI green on Python 3.11 / 3.12 / 3.13.
Bench it yourself
The compactor numbers above come from replaying real Claude Code
transcripts through the dispatcher. Two scripts live under scripts/:
python3 scripts/bench_compactors_real.py # match rate + mean savings
python3 scripts/bench_compactors_unmatched.py # top unmatched commandsThe first walks ~/.claude/projects/*/*.jsonl, replays every Bash
output through the registry, and reports per-family savings + overall
match rate. The second buckets the unmatched commands so the next
compactor target is obvious from the histogram.
Reproducing the tsbench score
Honest status, checked 2026-08-09: the benchmark repository these instructions pointed at returns 404, and so did the BENCHMARK-SUMMARY link above. Rather than leave a recipe that cannot run, here is what the harness does, so the number can be judged on its method:
A generated toy repo (deterministic seed) with four planted traps: a symbol defined twice, a three-level call chain, an
a -> b -> c -> aimport cycle, and a dead function whose name contains a live one.Eight read-only tasks, scored mechanically against an
expectedlist and aforbiddenlist. The forbidden list is the half that matters: an answer can contain the right target and the wrong one, and a grader that only looks for the right one would score it correct.A
sans_tscontrol arm running plain Read/Grep/Glob, without which the bench compares Token Savior profiles to each other and can never conclude "useless" — and therefore never "useful" either.
One trap worth knowing about if you rebuild it: the harness spawns
claude -p, which inherits ~/.claude/settings.json. If any Token Savior
PreToolUse hook is enabled on the machine, it applies to the control arm too
and rigs the comparison. Neutralise them in both arms
(TS_GUARD_OFF=1 TS_READ_GUARD=0 TS_BASH_REWRITE=0).
Bonus: ts CLI for non-MCP agents
For agents without MCP (Cursor, Aider, Continue, scripts, CI), the ts
command exposes a subset of the tools via shell:
ts use /path/to/project
ts get my_function # JSON output
ts search 'pattern'
ts daemon start # ~145ms per call vs 1.5s cold fork
ts init --agent cursor # wire up Bash hooks for non-Claude agentsOn Claude Code, prefer the MCP server -- measured cheaper than CLI on Opus 4.7. The CLI is there for the portability case.
Environment variables
All optional. Values shown as =1 also accept nothing else — set exactly 1;
values shown as bool accept 1/true/yes (and on where noted).
Server & tool manifest
Var | Default | Purpose |
| current dir | Comma-separated project roots to index. Codex trap: Codex whitelist-filters the MCP server environment, so an exported shell variable never arrives — set it in |
| — | Single-root alternative to |
| — | Deliberate active-project override (Token Savior's own contract — no host sets it). Registered if valid, wins over every other boot signal |
| off (bool, | Freeze the active project: explicit |
|
| Tool profile. |
| off (on in | Strip verbose tool schemas from the manifest |
| off (bool) | Session instructions in the style of Ponytail: smallest complete change scoped by |
| on (bool) | The |
|
| Hot-tool count exposed by the telemetry-driven |
| off | Let a Thompson-sampling bandit pick the detail level of |
|
| Ceiling on a |
|
| Discipline guard: whole-file |
| on |
|
| off | Disable the memory engine (clean-context workloads) |
| off | Skip read-side capture sandboxing and drop the capture tools from the manifest (no profile flips this; |
| off | Disable code-mode tools |
|
| Node binary used by the code-mode sandbox |
| off (bool) | Don't expose observations as |
| off (bool) | Pre-build project slots at startup |
| off (bool) | Skip the |
| off (bool, | Delegate the cold |
|
| Unix socket of the |
| auto-detected | Client label ( |
| — | Free-form label attached to session telemetry |
Indexing
Var | Default | Purpose |
| built-in list | Colon-separated globs; replaces the default include list |
| built-in list | Colon-separated globs; replaces the default exclude list |
| — | Colon-separated globs appended to the default excludes |
| — | Colon-separated globs appended at the indexer level |
|
| Max file size (bytes) to index |
|
| Max files per project |
|
| File watcher: |
| off | Force the polling watcher backend |
Claude Code hooks
Var | Default | Purpose |
|
| Minimum tool-output size to sandbox |
| off | Strong-replace: tell the agent to ignore the inline output and |
|
| Captures older than this are purged on the next |
| off | PostToolUse compactors. Preserves output across compaction; does NOT shrink the current turn (see note above) |
|
| Hybrid mode: compact-result size above which the full original is also sandboxed |
|
| Hybrid mode: compact-result size below which the sandbox is always skipped |
| off | Enable the PreToolUse Bash command rewriter |
| — | JSONL audit log of every rewrite |
| off | SessionStart memory hook emits only the Memory Index block |
Memory extras
Var | Default | Purpose |
| off | Port for the observation web viewer (unset = disabled) |
| off | LLM auto-extraction of memory observations (Anthropic API key required) |
|
| Auto-extraction model override |
| off | Auto-save memory observations |
| — | Critical-observation feed |
Storage, dashboard, debugging
Var | Default | Purpose |
|
| Telemetry + stats directory |
|
| Dashboard bind host |
|
| Dashboard port |
| off (bool) | Dashboard also lists projects under temp dirs |
| off | Debug logging |
| off (bool) | MCP request lifecycle tracing |
Not knobs: CLAUDECODE, CLAUDE_CODE_ENTRYPOINT, CLAUDE_PROJECT_DIR,
CLAUDE_CONTEXT_REMAINING_PCT, CODEX_* and HERMES_* are read for host/client
detection and boot-time project hints — the environment sets them, you don't.
(CLAUDE_PROJECT_DIR is what Claude Code actually exports; it always names the
main checkout, never the worktree the session works in, so the launch directory
outranks it when that directory is a linked worktree. CLAUDE_PROJECT_ROOT
moved up into the knobs table: nothing sets it but you.)
Naming trap: TS_PROFILE in the benchmark snippets is tsbench's variable;
the server reads TOKEN_SAVIOR_PROFILE.
License
MIT
Available Tools
72 toolsadd_field_to_modelBDestructive
Add a field to a model/class/interface. Supports .prisma, .py (dataclass, SQLAlchemy), .ts/.tsx.
Inputs: model (required), field_name (required), field_type (required), after, +2 more.
analyze_configBRead-onlyIdempotent
Audit config files (.env/.yaml/.toml/.json): duplicates, secrets, orphans.
Inputs: checks, project, severity, file_path, +1 more.
analyze_dockerBRead-onlyIdempotent
Audit Dockerfiles: base images, stages, exposed ports, ENV/ARG, cross-ref with config files.
Inputs: project.
build_commit_summaryCRead-onlyIdempotent
Compact commit/review narrative with stats, hotspots, suggested type.
Inputs: changed_files (required), project, max_files, max_symbols_per_file.
capture_aggregateCRead-onlyIdempotent
Aggregate over a capture: stats|count_lines|unique_lines|extract:|count:.
Inputs: id (required), pattern, transform.
capture_getBRead-onlyIdempotent
Read a capture (range: head/tail/all/preview/line:N-M).
Inputs: id (required), range, max_bytes.
capture_listCRead-onlyIdempotent
List recent captures (newest first).
Inputs: limit, tool_name, session_id, project_root.
capture_purgeADestructiveIdempotent
Delete captures by age/session/project (filter required).
Inputs: session_id, project_root, older_than_sec.
capture_putB
Sandbox a verbose tool output to FTS5 store; returns id + preview.
Inputs: output (required), tool_name (required), meta, session_id, +2 more.
capture_searchBRead-onlyIdempotent
BM25 search across sandboxed tool outputs. Returns id, snippet, bytes.
Inputs: query (required), limit, tool_name, session_id, +1 more.
checkpointB
Unified checkpoint CRUD. op = create | list (default) | restore | delete | prune | compare.
Inputs: op, project, keep_last, max_files, +2 more.
corpus_buildBIdempotent
Build a thematic corpus from observations filtered by type / tags / symbol.
Inputs: name (required), project, filter_tags, filter_type, +1 more.
corpus_queryBRead-onlyIdempotent
Format all observations of a named corpus as markdown context + a question, ready for answering.
Inputs: name (required), question (required), project.
detect_breaking_changesBRead-onlyIdempotent
Breaking API changes vs a git ref: removed funcs/params, added required params, signature changes.
Inputs: project, since_ref.
discover_project_actionsARead-onlyIdempotent
Detect conventional project actions from build files (tests, lint, build, run) without executing.
Inputs: project.
edit_lines_in_symbolADestructive
Edit code without reading the file first: exact old_string -> new_string, like Edit, matched only inside one function or class. Edit refuses a file you have not Read, which in a large file means reading all of it; this needs only the symbol name. replace_all=true changes every occurrence inside that symbol.
Inputs: new_string (required), old_string (required), symbol_name (required), project, +2 more.
find_dead_codeARead-onlyIdempotent
Project-wide audit of unreferenced functions/classes (zero callers, excludes entry points, tests, route handlers).
Inputs: project, max_results.
find_hotspotsBRead-onlyIdempotent
Rank functions by hotspot kind. complexity (all langs) | allocation (Java) | performance (Java).
Inputs: kind, project, min_score, max_results.
find_impacted_test_filesARead-onlyIdempotent
Infer pytest files likely impacted by changed files or symbols.
Inputs: project, max_tests, symbol_names, changed_files.
find_import_cyclesBRead-onlyIdempotent
Detect import cycles (strongly-connected components) in the file-level import graph (Tarjan's).
Inputs: project, max_cycles.
find_semantic_duplicatesARead-onlyIdempotent
Find duplicate functions. method='ast' (fast, hash-based, catches copy-paste) or 'embedding' (Nomic cosine, catches conceptual clones, tagged sim=min..mean per cluster).
Inputs: method, project, min_lines, max_groups, +1 more.
find_symbolARead-onlyIdempotent
Where is X defined: file, line, signature and preview in one call, the definition only where Grep returns every mention. Functions and classes first, then module constants and variables.
Inputs: name, hints, kinds, level, +6 more.
get_call_chainBRead-onlyIdempotent
Shortest dependency path between two symbols (BFS through the dep graph).
Inputs: to_name (required), from_name (required), level, project.
get_changed_symbolsBRead-onlyIdempotent
Symbol-level summary of worktree changes (or HEAD vs ref).
Inputs: ref, project, max_files, max_symbols_per_file.
get_change_impactBRead-onlyIdempotent
Impact analysis: direct + transitive dependents of a symbol.
Inputs: name (required), project, max_direct, max_transitive, +1 more.
get_classesBRead-onlyIdempotent
List classes (name, lines, methods, bases, file).
Inputs: hints, project, compress, file_path, +1 more.
get_class_sourceCRead-onlyIdempotent
Fetch a class source body (including methods).
Inputs: name, hints, level, names, +6 more.
get_db_schemaARead-onlyIdempotent
Condensed SQL-migration snapshot: tables (cols, types, nullability, defaults), PKs, FKs, indexes, RLS policies.
Inputs: tables, dialect, project, migrations_dir.
get_dependenciesARead-onlyIdempotent
Outgoing deps of a symbol: what X calls/uses (downstream).
Inputs: name (required), depth, project, compress, +1 more.
get_dependentsBRead-onlyIdempotent
Incoming deps: who calls/uses X, direct references only.
Inputs: name (required), project, compress, max_results, +1 more.
get_diagnosticsARead-onlyIdempotent
Type-checker errors for this project, grouped by file, each mapped to its enclosing symbol. Runs the checker the project already declares (tsc / mypy / pyright) - no new dependency. Use after an edit instead of shelling out to a build: the output is bounded and says exactly what it truncated.
Inputs: checker, project, timeout, file_path, +2 more.
get_edit_contextARead-onlyIdempotent
Pre-edit bundle: source + direct deps + callers + same-file siblings + impacted tests.
Inputs: name, symbol, project, max_deps, +2 more.
get_entry_pointsBRead-onlyIdempotent
Score functions by likelihood of being execution entry points: routes, handlers, main, exported APIs.
Inputs: project, max_results.
get_env_usageARead-onlyIdempotent
Cross-reference an env var across code, .env files, and workflow configs. Shows where it's defined, read, written.
Inputs: var_name (required), project, max_results.
get_feature_filesBRead-onlyIdempotent
Files matching a feature keyword + traced imports, classified by role (core, test, config).
Inputs: keyword (required), project, max_results.
get_file_dependenciesBRead-onlyIdempotent
Files imported by this file (outgoing file-level import edges).
Inputs: file_path (required), project, max_results.
get_file_dependentsBRead-onlyIdempotent
Files that import this file (incoming file-level import edges).
Inputs: file_path (required), project, max_results.
get_full_contextCRead-onlyIdempotent
Symbol bundle: location + source + deps/dependents (depth=1) or + change_impact (depth=2).
Inputs: mode, name, depth, names, +5 more.
get_functionsARead-onlyIdempotent
List functions in a file (file_path=...) or across the project.
Inputs: hints, project, compress, file_path, +1 more.
get_function_sourceBRead-onlyIdempotent
Full source of a function or method by name, no path needed: reads the symbol instead of the whole file.
Inputs: name, hints, level, names, +6 more.
get_git_statusBRead-onlyIdempotent
Structured git status: branch, ahead/behind, staged, unstaged, untracked.
Inputs: project.
get_importsBRead-onlyIdempotent
List imports (module, names, line).
Inputs: project, compress, file_path, max_results.
get_project_summaryBRead-onlyIdempotent
Project overview: file count, packages, top classes/functions, infra dirs.
Inputs: project.
get_routesBRead-onlyIdempotent
Detect API routes and pages in a Next.js App Router project: path, file, HTTP methods, type.
Inputs: project, max_results.
get_statsCRead-onlyIdempotent
Unified stats dispatcher. category = usage (default) | session_budget | tca | dcp | linucb | warmstart | leiden | speculation | lattice.
Inputs: project, category, context_type, budget_tokens.
get_structure_summaryBRead-onlyIdempotent
Structure of one file (functions, classes, imports, line counts), or project-wide if file omitted.
Inputs: project, file_path.
insert_near_symbolC
Insert content before or after an indexed symbol.
Inputs: code, name, source, content, +5 more.
list_filesBRead-onlyIdempotent
List indexed files, optionally filtered by glob.
Inputs: glob, query, pattern, project, +1 more.
list_projectsARead-onlyIdempotent
List all registered workspace projects with index status.
Inputs: no named parameters.
memory_adminBDestructive
Single dispatch for all memory admin / maintenance ops (status, doctor, dedup_sweep, distill, roi_gc, consistency, vector_reindex, etc.).
Inputs: op (required), limit, dry_run, rebuild, +1 more.
memory_deleteADestructiveIdempotent
Soft-delete an observation by ID (sets archived=1).
Inputs: id (required), project.
memory_getARead-onlyIdempotent
Layer 3: full observation content by IDs (~200 tokens/result). Final progressive-disclosure layer.
Inputs: ids (required), full, project.
memory_indexBRead-onlyIdempotent
Layer 1: compact index of recent observations — ID, type, title, importance, age, citation URI.
Inputs: limit, project, type_filter.
memory_saveC
Persist a fact, guardrail, or note across sessions.
Inputs: type (required), title (required), content (required), why, +13 more.
memory_searchBRead-onlyIdempotent
Layer 2 FTS5 search over memory observations, compact rows with snippets (~60 tokens/result).
Inputs: query (required), limit, project, type_filter.
move_symbolADestructive
Move a symbol to a different file, updating imports in all call sites.
Inputs: symbol (required), target_file (required), project, create_if_missing.
read_linesARead-onlyIdempotent
Read an exact line range from a file (1-indexed, inclusive). The tool to reach for when you hold a LINE NUMBER rather than a symbol name: a traceback frame, a grep -n hit, a compiler or linter error. Replaces sed -n '105,150p' file, head, tail and cat + scroll. Names the function/class holding the first line, so "which function is line N in" takes one call.
Inputs: end, file, line, path, +8 more.
reasoning_listBRead-onlyIdempotent
List stored reasoning chains by access_count then recency.
Inputs: limit, project.
reasoning_saveB
Persist a reasoning trace (goal + steps + conclusion) for later reuse.
Inputs: goal (required), steps (required), conclusion (required), project, +3 more.
reasoning_searchBRead-onlyIdempotent
Search stored reasoning chains by goal similarity (FTS5 + Jaccard).
Inputs: query (required), limit, project, threshold.
reindexCIdempotent
Rebuild the project index.
Inputs: force, project.
replace_symbol_sourceBDestructive
Rewrite a whole function or class by name, no Read needed.
Inputs: code, name, source, content, +4 more.
run_impacted_testsB
Run pytest on files impacted by the current worktree changes.
Inputs: compact, project, max_tests, timeout_sec, +4 more.
run_project_actionBDestructive
Run a discovered project action by id (bounded output, bounded timeout).
Inputs: action_id (required), project, timeout_sec, include_output, +1 more.
search_codebaseARead-onlyIdempotent
Use instead of Grep/rg on code. Each hit also names the function or class that contains it (in), so "who calls X" or "where is X used" takes one call. Regex by default; semantic=true ranks symbols by meaning.
Inputs: q, query, regex, pattern, +4 more.
search_in_symbolsBRead-onlyIdempotent
Regex search that returns the enclosing function/class for each match, in addition to file:line.
Inputs: pattern (required), project, max_results.
set_project_rootAIdempotent
Register a new project root and switch to it. If the path is already registered, this becomes a cheap active-root switch (no reindex) unless force=true is set.
Inputs: name, path, root, force, +1 more.
switch_projectCIdempotent
Switch the active project.
Inputs: name, path, root, project.
ts_discoverARead-onlyIdempotent
Scan Claude Code transcripts for missed Token Savior opportunities (native-call chains that should have been a single TS call) and/or report TS-vs-native adoption ratios. Scans ALL transcript projects by default; pass project= to filter. format='table' (default) or 'json' returns ranked Findings; format='adoption' or 'adoption_json' returns the TS adoption summary with trend + worst sessions. Read-only, PII-safe.
Inputs: limit, format, project, since_days.
ts_executeADestructive
Run a JS script in a Node sandbox with a typed facade. The script body executes as async () => { <body> }; use await tools.<name>(args) to call any allowed tool (find_symbol, get_function_source, get_dependents, search_codebase, replace_symbol_source, etc.). Return the final value. Collapses find->read->deps chains into one round-trip.
Inputs: js, body, code, script, +1 more.
ts_searchARead-onlyIdempotent
Find the top-K Token Savior tools most relevant to a natural-language query via embedding cosine similarity. Use when the manifest is in 'tiny' or 'code_mode' profile or you don't know which tool fits. Returns each candidate with its full inputSchema (format='schema') or a one-line TypeScript signature (format='ts') suitable for ts_execute scripts.
Inputs: q, query, top_k, format, +2 more.
ts_stale_contextARead-onlyIdempotent
Scan the recent session transcript(s) and list tool results made obsolete later in the SAME session — a file read then re-read, a file read then edited, a Bash command re-run. Returns the stale refs so you can drop that content or refetch the fresh copy, keeping the context window lean. Agent-agnostic, read-only, PII-safe. format='table' (default) or 'json'.
Inputs: limit, format, project, since_days.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 72 tools
Multiple tool families overlap heavily: get_dependencies/get_dependents/get_change_impact/get_full_context/get_edit_context all analyze symbol relationships; search_codebase/search_in_symbols/ts_search all search code; memory_search/reasoning_search/capture_search all search stores. Descriptions help somewhat, but boundaries remain unclear and agents must memorize subtle distinctions to avoid misselection.
Nearly all tools use snake_case with predictable verb_noun patterns and consistent family prefixes (get_, memory_, capture_, reasoning_, ts_, corpus_). Minor deviations like 'checkpoint' (noun-only) and 'reindex' are readable but slightly inconsistent.
72 tools is far beyond the typical 3-15 range and meets the rubric's extreme mismatch threshold. Even for a broad code-intelligence platform, this creates an overwhelming selection burden and increases the chance of wrong tool choice.
The surface covers code navigation, editing, refactoring, dependency analysis, git status, diagnostics, memory, reasoning, captures, and project management comprehensively. Only minor gaps exist, such as dedicated file creation/deletion and git commit/push operations, but major workflows are supported.
Maintenance
Related MCP Connectors
MCP server for building and testing AI agents with multi-model experimentation and insights.
An MCP server that gives your AI access to the source code and docs of all public github repos
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Team memory for AI coding agents and code reviews, reviewed by humans and served over MCP.
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables Large Language Models to interact with Git repositories through a robust API, supporting operations like repository initialization, cloning, file staging, committing, and branch management.284,408 npm245Apache 2.0
- FlicenseNot gradedqualityDmaintenanceAn MCP server for efficient code indexing and symbol retrieval using tree-sitter AST parsing to fetch specific functions or classes without loading entire files. It significantly reduces AI token costs by providing O(1) byte-offset access to code components across multiple programming languages.-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides structure-aware code analysis (symbol trees, dependencies, docs) to reduce AI agent token consumption by up to 99%, along with Git commit intelligence.MIT
- AlicenseNot gradedqualityBmaintenanceMCP server for local-first code intelligence, providing structural code graph, semantic search, and impact analysis to AI agents.2MIT