Mapshift
The scripts embedded in Astro files are indexed by the code map, so component logic can be located and traced.
Indexed by the code map for definitions and calls in C and C++ code, supporting lookup and call-graph tracing.
Indexed by the code map for definitions and calls, supporting lookup and call-graph tracing.
Indexed by the code map for definitions and calls, supporting lookup and call-graph tracing.
Indexed by the code map for definitions and calls, supporting lookup and call-graph tracing.
Indexed by the code map for definitions and calls, supporting lookup and call-graph tracing.
Indexed by the code map for definitions and calls, supporting lookup and call-graph tracing.
Indexed by the code map for definitions and calls, supporting lookup and call-graph tracing.
Wires the code-map tools and per-request model/effort advice into GitHub Copilot (VS Code agent mode and the GitHub Copilot CLI), with a rules-file section telling the agent to consult the map first and a web dashboard for activity and savings.
Indexed by the code map for definitions and calls, supporting lookup and call-graph tracing.
Beta setup that adds the map tools and model-routing advice to the Hermes coding agent, plus the local web dashboard.
Fully indexed by the code map with call and import tracking, letting agents query where things are defined and who calls them.
Indexed by the code map for definitions and calls, supporting lookup and call-graph tracing.
Fully indexed by the code map with call and import tracking, enabling code lookup and call-graph tracing.
Indexed by the code map for definitions and calls, supporting lookup and call-graph tracing.
Indexed by the code map for definitions and calls, supporting lookup and call-graph tracing.
Indexed by the code map for definitions and calls, supporting lookup and call-graph tracing.
Indexed by the code map for definitions and calls, supporting lookup and call-graph tracing.
Fully indexed by the code map with call and import tracking for definitions, calls and entry points.
Indexed by the code map for definitions and calls, supporting lookup and call-graph tracing.
Indexed by the code map for definitions and calls, supporting lookup and call-graph tracing.
Indexed by the code map for definitions and calls, supporting lookup and call-graph tracing.
Indexed by the code map: definitions and calls are recorded and linked so agents can trace how Rust code is used.
Indexed by the code map for definitions and calls, supporting lookup and call-graph tracing.
Indexed by the code map for definitions and calls, supporting lookup and call-graph tracing of smart contracts.
The scripts embedded in Svelte components are indexed by the code map, so component logic can be located and traced.
Indexed by the code map for definitions and calls, supporting lookup and call-graph tracing.
Indexed by the code map for definitions and calls, so infrastructure definitions can be located and traced.
Fully indexed by the code map with call and import tracking, so agents can locate and trace TypeScript definitions and their callers instead of reading whole files.
Indexed by the code map for definitions and calls, supporting lookup and call-graph tracing.
Indexed by the code map for definitions and calls in shell scripts, supporting lookup and call-graph tracing.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Mapshift helps coding agents spend fewer tokens without doing worse work. It does two things:
πΊοΈ Maps your code. Every function, class and call in your project, kept fresh on its own. Your agent asks the map where things are instead of opening file after file.
π Shifts to the right model. Each request gets the model and thinking effort it actually needs: a light model for a quick question, the strong one for risky or far-reaching changes.
It runs entirely on your computer. No account, no server, no telemetry. Your code never leaves your machine.
Contents
Related MCP server: tree-sitter-analyzer
Quick start
You need Node.js 22.13 or newer. Then run one line:
npx mapshift@latest setupSetup finds every coding agent on your computer (Codex, Gemini CLI, Antigravity, Grok, Cursor, VS Code, Windsurf, Claude Code and the rest below), shows exactly which files it will change, backs each one up, and asks before changing anything. Restart your agents and they are ready.
Claude Code gets the full experience (live model switching and a dashboard) as an add-on. In a terminal session:
/plugin install mapshift --marketplace riverahendrick/mapshiftIn the desktop app, click + next to the prompt box, then Plugins, Add marketplace with riverahendrick/mapshift, then Add plugin.
Installed a new coding agent later? Run mapshift setup again: it adds Mapshift only where it is missing. mapshift setup --check lists the agents that still need it, and mapshift update points them out too. In Claude Code, /mapshift setup does the same, and the add-on tells you once a day when it finds an agent without Mapshift.
Check Node.js is 22.13 or newer:
node --version.Run
npx mapshift@latest setup --yes. It installs a lasting copy and wires up every supported agent it finds.If you are Claude Code, also run
claude plugin marketplace add riverahendrick/mapshiftandclaude plugin install mapshift@mapshift.Run
mapshift setup --checkand confirm it says every coding agent found has Mapshift.Tell the person to restart their agents, and that
mapshift uninstallremoves everything again.
What you get in each agent
Agent | πΊοΈ Map tools | π Model routing | π Dashboard |
Claude Code | β | β Automatic, every request | β Panel beside the chat, plus a status band |
Codex (CLI and IDE) | β | π‘ Advice |
|
Gemini CLI | β | π‘ Advice |
|
Antigravity ( | β | π‘ Advice | β
Status line, |
Grok CLI | β | π‘ Advice | β
Status line, |
Cursor (beta) | β | π‘ Advice | Web dashboard |
Windsurf, VS Code (Copilot agent mode), GitHub Copilot CLI, Claude Desktop, Kimi Code | β | π‘ Advice | Web dashboard |
opencode, Kiro, Qwen Code, Hermes, Factory Droid, Qoder, Pi (all beta) | β | π‘ Advice | Web dashboard |
"Beta" means setup follows the agent's documentation but has not yet been tried on a real install. Setup only ever changes your personal settings, backs each file up first, and leaves alone any file it cannot edit safely (a config with comments, or an older layout), saying so.
Seeing it work. Agents with a rules file (GEMINI.md, AGENTS.md and the like) get a short Mapshift section at the top of it, above any other tool's, so the agent reaches for the map first. It also asks the agent to end each code task with one line, such as Mapshift: USED β tracing who calls withSavings; this session: 1,626 instead of 14,549 (from a real Antigravity run), with the figures copied from Mapshift's own answer line, or Mapshift: NOT USED β <why>. Rerunning mapshift setup moves a section an older version put at the bottom.
Claude Code lets an add-on change the model on every request, so routing there is fully automatic. The other agents do not allow that today. There Mapshift advises instead: its instructions ask the agent to hand routine side work to lighter helpers where the agent has them, and /mapshift shows which model and effort the last request needed. If an agent adds a way to switch models, Mapshift will use it.
Code Mode (Claude Code, optional). Claude Code has an experimental mode in which Claude writes a short program that makes several tool calls in one step: fewer round trips and less output to read. It works only in terminal sessions (not the Desktop app, VS Code or claude -p), needs Claude Code 2.1.323 or newer, and a chat started in it can only be resumed with it on. mapshift code-mode status checks whether it can run on your computer and why not, mapshift code-mode on turns it on only when it can, and mapshift code-mode off or mapshift uninstall takes it out again. Mapshift never turns it on by itself.
Dashboards
The same numbers in three places. All of them read local files only.
In Claude Code:
/mapshiftopens a panel beside the chat, with the mode, the model in use, gauges for every usage limit, today's savings, and how much further each limit goes because of Mapshift.In any terminal:
mapshift ui(or justmapshift) opens a live dashboard. Switch tabs with the arrow keys or a click;rrefreshes,qquits.In your browser:
mapshift dashopens a private page on127.0.0.1that only this computer can reach. It follows your light or dark theme.
Screenshots from a short demo on the public cobra repository: three questions on a light model and two on a standard one, all real.
How the map works
Builds itself. The first time an agent uses a map tool in a project, the map builds in the background. There is nothing to run and nothing to remember.
Stays fresh. Before every answer it checks which files changed (size and time, then content) and re-reads only those.
Understands 41 languages, plus the scripts inside Vue, Svelte and Astro files:
Full call and import tracking: TypeScript, JavaScript, Python, Go, Java, Kotlin and C#.
Definitions and calls: Rust, PHP, Dart, Swift, Ruby, Scala, Lua, Elixir, PowerShell, C, C++, CUDA, Bash and Zsh, Zig, OCaml, Haskell, Julia, Clojure, Nix, Solidity, R, Erlang, Gleam, Perl, Elm, GDScript, Common Lisp, Emacs Lisp, Racket, Scheme, Ada, ReScript, GLSL and Terraform.
Follows the call graph. A question in words first finds the definitions that match it, then walks the call links around them. The function that ties the matches together (the entry point calling every matched helper) moves up to second place; the best word match keeps first.
Is honest about what it knows. Every call link is marked: confirmed through an import, a fair guess, or ambiguous. Files it skips (very large, generated, unreadable) are listed by name, never silently missing.
Lives outside your project. The map is kept in
~/.mapshift/, so nothing is added to your repository, and all worktrees of a repository share one map.Gives starting points (Claude Code). With each prompt, the agent gets the few places the request is clearly about: location, signature and callers. When the map has no clear answer, nothing is added.
Works on its own. Turning model switching off leaves the map running.
/mapshift map offturns the map's starting points off too, and/mapshift map onbrings them back.
Agents get five tools. map_find, map_trace and map_file also take a list, so an agent that needs several things asks for all of them in one call instead of one call each:
Tool | What it answers |
| "Where is this done?", by plain words or by name, with the code, its callers and what it calls |
| Who calls a function, what it calls, or everything a change to it can reach |
| A file's whole outline in a few lines |
| The project at a glance: languages, main folders, entry points, most used code |
| Every line matching some text, grouped by the function it sits in |
How routing decides
The wording. Is it a quick question, an everyday change, complex work, or risky work (security, money, data, production)? Pasted logs and code are set aside so they do not inflate the request.
The map. For a change, the map measures how far it spreads: how many functions and files call the code being changed. A change that reaches 60 functions across 13 files is harder than its wording suggests, so it moves up a level. A question stays a question, however widely used the code it asks about.
Quality comes first:
Mapshift never moves down on risky work or far-reaching changes.
It moves up after failing tests or repeated errors.
Your own choice always wins.
Usage limits. A model whose usage limit is reached is never asked again until the limit resets, even when it is the model picked in the app. Until then the closest usable model takes over: one step weaker with more thinking effort for small work, one step stronger for hard work. A toast says which model stands in and for how long. When the whole account is at its limit, nothing is rerouted, since no model can help.
There are five modes: β‘ Auto (the default), π Quality, πͺ Saver, ποΈ Manual and βΈοΈ Off. Each project remembers its own mode. Off stops model switching only; the map keeps saving tokens.
How the numbers are counted
Every number Mapshift shows comes from its local logs, by these rules:
Map tokens saved:
A map answer costs its own size.
It is credited with the full size of the files it pointed to, but only those the agent did not open anyway in that chat.
If the agent read them all, the answer saved nothing.
The line on each map answer ("πΊοΈ Mapshift: 806 tokens here instead of 2,977 to read that file whole") compares the answer with reading in full only the files it points at, never the whole project. It appears only when the difference is real and costs about 25 tokens. From the second answer on it adds the session's totals ("Β· this session: 1,985 instead of 40,480"), which count every answer, an overview included as pure cost. "Session" means since the agent started Mapshift's server, which is usually one chat. Some tools instead compare a project overview with reading the entire project, which is how a single overview can claim millions of tokens saved.
Without Mapshift means the same requests run on the model you picked yourself, plus the files the map saved the agent from reading.
With Mapshift is what was actually used.
Model switching can cost more than it saves when hard work needs a stronger model. Mapshift shows that as it is ("$0.40 more, spent on stronger models for harder work").
Limits stretched (Claude Code): each limit's use is divided by today's with Γ· without ratio, giving "you'd be at 61% without Mapshift, not 48%". At your pace since the limit reset, the panel also shows how much longer it lasts before it runs out. Limits are counted in usage, which follows cost closely but not exactly, so this is an estimate too.
Estimates: sizes in tokens are estimated at four characters per token, and dollar values use each provider's list prices. Your plan may cost less, so these are labelled estimates. On a subscription, the limit gauges show what really matters.
/mapshift trace in Claude Code shows the inputs behind each decision.
How it compares
Two other open-source tools give coding agents a code map: Trail-code (formerly Graft) and CodeGraph. Both are good projects, MIT like Mapshift. The table below was checked against their source code (Trail-code 0.28.0, CodeGraph 1.6.2) in November 2026.
Mapshift | Trail-code (Graft) | CodeGraph | |
First build | β Automatic, on the first question |
|
|
Stays fresh | β Checked before every answer | β Checked before every answer | β File watcher |
Where the index lives |
|
|
|
Telemetry | β None | On by default (opt out) | On by default (opt out) |
Background process | β None | β None | A daemon per project |
Picks the model per request | β Claude Code: automatic, and never a model at its usage limit. Others: advice | β | β |
Dashboards | β Claude Code panel, terminal, web | Status line, | Graph viewer (hidden behind a setting) |
Token savings shown | β Whole-file sizes, credited only if the agent did not open those files anyway (Claude Code); an upper bound elsewhere | Whole-file sizes | Not tracked (a benchmark in the README) |
Usage limits and cost | β 5-hour and weekly limits, cost with and without | $ saved in the status line | β |
Map tools for agents | 5 | 6 | 8 (1 shown by default) |
Languages | β 41, plus Vue, Svelte and Astro (42 grammars) | 28, plus Vue, Svelte and Astro | 32 grammars, 41 listed |
Agents it sets up | 18 | 13 | 20 |
Measured: right code first, 120 sealed questions | 86 (72%) | 59 (49%) | not measured |
Measured: right code in the top 3 | 101 (84%) | 68 (57%) | not measured |
Measured: plain-English questions, right code in the top 3 | 35 of 48 | 15 of 48 | not measured |
Measured: median answer size | 447 tokens | 827 tokens | not measured |
Measured: median time per command-line lookup, start-up included | 0.58 s | 1.9 s | not measured |
Measured: index size, six projects | 0.9 to 5.5 MB | 2.1 to 14.7 MB | not measured |
Measured: cold build time | Faster on 4 of 6 projects | Faster on 2 of 6 (hono, bat) | not measured |
The measured rows come from a sealed benchmark against Graft 0.29.0: 120 questions on six public projects (postcss, hono, rich, werkzeug, echo and bat, in JavaScript, TypeScript, Python, Go and Rust). The questions were written from the projects' source by an author who never ran either tool, and their hash was published before the Mapshift version under test was frozen. Nobody tuning Mapshift saw a question before the single scored run. They mix how a developer asks, how an agent searches, exact names, and "who calls this"; on caller questions both tools found all 12. Graft built two of the six maps faster: bat's slow build came from one folder of saved terminal output, which Mapshift now skips (after the run, bat built in about 6 to 8 s against Graft's 12.4 s). Every question, answer, loss and caveat is in bench/README.md, with the commands to run it yourself; the questions themselves are in bench/sealed.
Where they are ahead: CodeGraph sets up more agents (20 against 18), detects web framework routes, and finds dead code and import cycles. Trail-code shares team learnings through the repository, draws the code graph, posts a change's blast radius on pull requests, and can add exact call links from language servers. If you need one of those, use them; Mapshift's tools work alongside either.
Commands
Command | What it does |
| Add Mapshift to every coding agent it finds ( |
| Map, savings and limits as text |
| The dashboard right in the terminal (also opens when you run |
| Open the dashboard in your browser |
| Pause Mapshift in every agent, or bring it back |
| Get the newest version now, and update the Claude Code add-on too ( |
| Update by itself every 3 days (on by default; |
| Claude Code's experimental Code Mode, turned on only after checking it can run on this computer ( |
| Take out everything setup added |
| Build or update the map of this project |
| Find code by plain words or by name |
| Who calls it ( |
| A file's outline: every definition and its lines |
| The whole project at a glance |
| Every matching line ( |
| Which model and effort a request needs |
In Claude Code, /mapshift opens the dashboard, /mapshift auto, quality, saver, manual or off switch modes, and /mapshift map on or map off turns the map's starting points on or off. /mapshift setup adds Mapshift to the other coding agents on the computer.
Update, turn off or remove
Mapshift keeps itself up to date. Every 3 days, when one of your agents starts it, it checks npm for a new version in the background and installs it, along with the Claude Code add-on. Nothing waits on it, and new features simply arrive. The next chat you open uses them. mapshift auto-update status shows the last check, and ~/.mapshift/logs/update.log keeps every result.
mapshift update # get the newest version right now
mapshift auto-update off # stop updating by itself (on brings it back)
mapshift off # pause it everywhere
mapshift on # bring it back
mapshift uninstall # remove everything setup added, exactlySetup backs up every file before changing it and only writes between its own clearly marked lines, so your own settings stay as they were.
Privacy and safety
Fully local. No telemetry, no accounts. The map and its logs stay in
~/.mapshift/. The only request Mapshift makes is asking npm for its newest version: every 3 days in the background (see Updates), or when you runmapshift update. That request carries nothing about you or your code.Never touches credentials. Mapshift never reads your login files and never routes your traffic through anything.
Safe with projects you do not trust. Mapshift never starts a program from inside a project folder, it never follows links that point outside the project, and a project's own git settings cannot make it run anything.
Your settings only. Setup changes personal settings only, never files shared with your team.
FAQ
Does it make my agent worse? Routing is built quality first: it only goes lighter where it is safe, never on risky or far-reaching work, and moves up after failures. In Claude Code you can always press Think harder or pick a mode.
Does my code leave my computer? No. Mapshift reads your files locally and sends nothing anywhere.
Which plans does it work with? Subscriptions and API keys alike. On a subscription the dashboard shows your 5-hour and weekly limits; with an API key it shows dollars.
Windows, macOS, Linux? All three. It needs nothing but Node.js: no compilers, no native modules.
License
MIT. The bundled language grammars keep their own open-source licenses; see THIRD_PARTY_NOTICES.md.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Your AI agent is smart enough to code all day. Local firewall & zero-loss runtime.
No-data MCP handoff for local Claude Code to Codex harness moves. $49 lifetime.
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
Cuts coding agent token burn up to 72% continuously via contradiction-free memory & verification.
Related MCP Servers
- AlicenseAqualityAmaintenanceEnterprise-grade (40m+ lines) codebase intelligence in a zero-setup, private and local MCP: managed indexing, hybrid semantic search, polyglot code dependency graphs, and DB/API/infra knowledge. Benchmark: 61% less tokens, 84% fewer calls, 37x faster than standard AI grep.262,229 npm3,382AGPL 3.0
- AlicenseBqualityBmaintenanceAn MCP code-intelligence server for AI agents with pre-indexed AST cache, 62 MCP tools, and TOON-compressed output, enabling token-efficient code analysis and project health grading entirely locally.9256 PyPI61MIT
- AlicenseNot gradedqualityDmaintenanceConsolidates code understanding, documentation, browser automation, memory, and knowledge graph into a single MCP server with progressive discovery for up to 98% token reduction.Apache 2.0
- FlicenseBqualityDmaintenanceA fully local, privacy-first MCP server that gives AI coding assistants deep repository intelligence with file-and-line-cited answers, persistent semantic memory, and agentic abilities like task planning and code reviewβall without any cloud API calls.23-