Mapwright
A live map of what your coding agent is building.
Structure, architecture, data model, cloud, API flows, logic and every step, drawn from the code as the agent writes it,
and readable by the agent itself for a fraction of the tokens.
Website · Live demo · Quickstart · What you see · Token cost · Verification · Works with · Setup & deploy guide · Commands
Beta. Mapwright is ready for testing and feedback. The core (tracking, verification, MCP tools, hooks, the map UI) is stable enough for daily use; expect rough edges in the UI and in JS/TS analysis. Please report what you find.
Why
When an agent builds a project, you get files. You do not get the picture: how the pieces fit, what talks to the database, which mechanisms it used, what changed in each turn, and whether what it says it did is what it actually did. And the agent itself spends a large share of its tokens rediscovering the same structure by listing directories and reading files.
Mapwright watches the code, not the agent's description of it. It builds the map with static analysis, keeps a version of every file at each step, and gives the agent a compact text view of the map so it can stop exploring. The agent's only job is to say when a step is done and what the plan is; everything else is computed, and everything it claims is checked.
Quickstart
pipx install mapwright-agent # zero dependencies, Python 3.10+; the command is `mapwright`
cd your-project
mapwright init --connect claude-code # baseline + MCP server + hooks for this project
mapwright open # the map in your browser
Then work with your agent as usual. Other agents: mapwright connect --list.
Other ways to install: pipx install git+https://github.com/1mystic/Mapwright.git (latest), or a wheel from the
releases. The PyPI name mapwright belongs to an unrelated project, hence mapwright-agent.
- Keep history inside the project:
mapwright init --local(see Commands). - Big repo?
initsuggests folders to ignore (generated code, data shards);.gitignoreis respected by default. - Use the hosted site:
mapwright open --webopens mapwright.pages.dev, which talks to your local Mapwright; your code never leaves your machine. - Stop it:
mapwright down; remove an agent withmapwright disconnect. All the ways. - Forget or rotate:
mapwright forgetstops tracking this project (--purgealso deletes its history);mapwright token --rotatewrites a new API token, then restart the daemon and runmapwright open.
Full guide, including the VS Code extension: docs/SETUP.md.
What you see
An IDE-style interface (dark and light), live while the agent works, with every view also available at any earlier step:
| View | Shows | Built from |
|---|---|---|
| Overview | Counts, what the agent just did, layers, mechanisms, entry points, infrastructure, hotspots, plan, verification | everything below |
| System | The whole system as one abstract, icon-based picture (clients → interface → logic → data → outside services, plus platform); click a component for what is inside it | layers, routes, tables, infrastructure |
| Architecture | Modules grouped into layers (interface, services, data, integrations, UI …), imports, external packages | Python ast, JS/TS imports |
| Files | How the project is organised, with added and changed files marked | the file tree |
| Classes | Classes, attributes, methods, inheritance and "uses" links | Python, JS/TS |
| Data | Tables, columns, keys and relations | SQL (also inside code strings), SQLAlchemy, Django, Prisma, zod schemas, Firestore/Storage collections with their security rules |
| Cloud | Containers, services, databases, caches, queues, buckets, functions, CI, external APIs | Dockerfile, compose, Terraform, Kubernetes, serverless, CI, .env.example, SDK imports |
| Processes | Each HTTP route → handler → the functions it calls → the tables they touch | routes (FastAPI, Flask, Express, Next.js), call graph |
| Logic | Every function by complexity, with algorithm hints, and a flowchart of its control flow | Python ast (JS/TS: outline), React components and hooks tagged |
| Concepts | Mechanisms in use (29 kinds: caching, retries, queues, auth, rate limiting, ORM, LLM calls …) with evidence in the code | the concept catalog |
| Timeline | Every step: what was asked, files changed with diffs, design changes, verification | the step store |
Overview opens first. The System view pans and zooms like the other diagrams (wheel at the cursor, drag, double-click to fit). Ctrl/Cmd + = / - / 0 zooms the whole interface.
Click any box to inspect it; double-click to open the code, the flowchart or the call graph. Search everything with ⇧⇧. The bottom panel holds steps, todos, problems and the agent's activity.
How it keeps token cost low
The agent never draws a diagram, writes a summary or lists files. It uses a few small tools:
| Tool | The agent sends | It gets back |
|---|---|---|
map |
nothing (or a folder to expand) | The whole map in about 600 tokens: layers, modules and key symbols, routes, tables, infra, mechanisms, algorithms, open todos, recent steps. No source code. |
find · symbol |
a name | Where it is; its callers, callees, tables, routes and history. No source code. |
step |
a title, e.g. "Add refunds" | A receipt of what actually changed (files, lines, new and changed functions, classes, tables) |
todo |
the plan, then "done" with evidence | Whether the evidence really changed |
claim · note · link |
an id from the catalog and a symbol | Whether the code backs it up |
All nine tool definitions together are under 3,000 characters, because they are sent with every request. The diagrams, icons, layouts and flowcharts are built by Mapwright from the code, so the agent spends no output tokens on them.
No cheating
Nothing the agent says is taken at its word:
- What changed in a step is computed from the files, not reported by the agent.
- A step title is checked against the changes: "Add tests" with no test file changed is flagged.
- A todo marked done needs evidence (a symbol or file) that changed after the todo was added.
- A claimed mechanism must be visible in the code of the symbol it names (
retry-backoffon a function with no retry loop is "unverified"). - Notes and links go stale when the code they point at disappears.
Everything that does not check out appears under Problems, in the agent's own map, and in exports.
Architecture rules
mapwright.toml in the project root (commit it) states what the code may depend on:
- Forbidden imports between layers or path globs, for example "the UI does not import the data layer".
- No import cycles between modules.
- Limits on complexity per function and on module size.
Violations appear in Problems and in the agent's map, and are checked at every step. mapwright check
lists them and exits 1 when one is broken, so CI or a pre-commit hook can fail on it. mapwright rules --init
writes a starter file that holds for the code as it is today.
[[forbid]] # an import that must not exist
from = "ui" # a layer name or a path glob
to = ["data"] # layers or globs
reason = "UI goes through services"
[limits]
no_cycles = true # import cycles between modules
max_complexity = 25 # per function
Full reference: Architecture rules in the commands guide.
Validation
Measured on this release (Python 3.13, Linux):
| Real agent run | Claude Code 2.1.325, headless, two turns (85 agent turns in all) building a URL shortener from an empty folder, then adding rate limiting and a stats endpoint, with Mapwright connected through mapwright init --connect claude-code. Tool calls: todo 23, step 9, claim 8, map 3, symbol 1, catalog 1, against 26 file writes and edits and 1 file read. Result: 9 steps with correct computed changes, 11 of 11 todos verified, 8 of 8 claims verified, 0 problems. |
| What the real run fixed | It surfaced two false alarms, both fixed in this release: tables created in SQL strings were missed (a step about tables was flagged), and camelCase names like TokenBucketLimiter did not count as evidence (4 honest claims showed as unverified). Stored warnings are re-checked with the current analysis, so the fixes apply to history too. |
| Scripted session | 7 turns building an order service; the deliberately dishonest 7th turn produced exactly 3 problems (wrong step title, unearned todo, unbacked claim) and nothing else. |
| Dogfooding | Mapwright maps its own repository (mapwright init --local --connect claude-code). Its architecture rules file mapwright.toml is committed. |
| Tests | 125 passing (analysis, flowcharts, infra, tracking, verification, MCP over stdio, hooks, config writers, daemon API, the full session). |
| Speed | First scan of an 84-file repository 0.8 s; a new process starts warm in 0.01 s (cached by content hash). |
| Size | No runtime dependencies. Wheel about 1 MB, mostly the bundled diagram renderer. |
Works with
| Agent / editor | How | Command |
|---|---|---|
| Claude Code | MCP server + hooks (prompts, edits, turn ends → automatic steps), or the plugin | mapwright connect claude-code |
| Cursor | MCP server | mapwright connect cursor |
| VS Code (Copilot agent mode) | MCP server, plus the extension for the map beside your code | mapwright connect vscode |
| Windsurf · Gemini CLI · Codex CLI · opencode · Claude Desktop | MCP server (opencode also has a plugin for automatic steps) | mapwright connect <id> |
| Cline · Roo · Zed · JetBrains AI | MCP config to paste | mapwright connect --print <id> |
| Anything else | File watching: steps close after a quiet period; the agent can use the CLI | mapwright watch |
For agents that support Agent Skills, integrations/skills/mapwright/SKILL.md teaches the workflow with
the MCP tools or, without MCP, the same through the shell.
Privacy
Everything runs on your machine. The daemon listens on 127.0.0.1 only and needs a token. Secret-looking
files (.env, keys, credentials) are tracked as "changed" but never read. Code shown in the UI and in diffs
is passed through redaction. Nothing is sent anywhere. The optional hosted site is static: it only runs in your browser and calls your own local daemon (exact-origin allowlist plus the token); no code or history is uploaded.
Limits
- Static analysis: dynamic imports, metaprogramming and tables created at runtime are not seen. Algorithm hints are hints.
- Routes are found for FastAPI, Flask, Express-style routers, Next.js and React Router (config arrays,
<Route>JSX,lazyGroup-style helpers; shown asPAGE), not for hand-writtenhttp.serverhandlers. Route arrays built dynamically or mounted under a layout in another file show only their own paths. - Firestore and Cloud Storage rules (
firestore.rules,storage.rules) and staticcollection()/doc()calls appear asfirestore:/storage:collections with allowed operations; paths built at runtime, and Firestore use from Python, are not seen. SQL inside content strings (e.g. quiz text) can still be reported as tables; SQL found only in tests, examples, scripts or vendored code is kept out of the map. - Structure is drawn for Python, JS/TS, SQL and Prisma. Other languages are tracked for changes but not drawn.
- JS/TS flowcharts are an outline (branches and calls in order), not a full parse.
- Beta caveats: the UI and the System view's arrows (illustrative, not verified dependencies) are still being polished; Safari blocks the hosted site from reaching
127.0.0.1, usemapwright openthere. - Steps close at turn ends only with hooks (Claude Code, opencode); elsewhere the agent calls
stepor a quiet period closes it. - The VS Code extension was packaged and checked for syntax here, not exercised inside an editor.
Roadmap and feedback
Planned: a native Ubuntu .deb and macOS app, polish of the System view, more languages. See docs/ROADMAP.md and the
changelog. Bugs, ideas and traces from real projects are very welcome in issues;
running mapwright doctor first and pasting its output helps.
Project layout
src/mapwright/ analysis, tracking, MCP server, hooks, daemon, CLI, UI
integrations/ VS Code extension (.vsix included), Claude Code plugin, opencode plugin, Agent Skill
web/ website (landing, docs, setup) + scripts/build_site.py builds the live demo
docs/ SETUP, COMMANDS, AGENT_PROTOCOL, ARCHITECTURE, ROADMAP, RELEASING
scripts/ demo_session.py (scripted agent), build_site.py
tests/
MIT licensed. The diagram renderer is Mermaid 10.9.3 (MIT), bundled.
Metadata
Release files for mapwright-agent 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mapwright_agent-0.3.1.tar.gz | 3.3 MB | With provenance | Details for mapwright_agent-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mapwright_agent-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for mapwright_agent-0.3.1-py3-none-any.whl |
Total release size: 4.4 MB
Release files / mapwright_agent-0.3.1.tar.gz
| Download URL | mapwright_agent-0.3.1.tar.gz |
|---|---|
| Size | 3.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0c5faedbdf96fde0159a17c33c6c214cf2a1779c1e0e04ace84cb56b0b5a1d56
|
|
BLAKE2b-256 checksum How to use checksums |
4ccd158ce82b1e8dba75c27d4671128b254acbacb2b97c1639af200e70c8cde1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logRelease files / mapwright_agent-0.3.1-py3-none-any.whl
| Download URL | mapwright_agent-0.3.1-py3-none-any.whl |
|---|---|
| Size | 1.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5521d44e24d42bd79006e9c646ee00b584a7be4deb62ee1bf02cf6073b2cc2b0
|
|
BLAKE2b-256 checksum How to use checksums |
7b123c61966b4e1f85f5c040ed8f61e2954dd1a73e0dab8dfa8b9ad46a844d38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logSecurity for mapwright-agent 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mapwright_agent-0.3.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.