readfirst
Summary: This server gives an AI agent read-first knowledge about a repository—what to read, check, and avoid before editing files—drawn from a committed .readfirst/map.json and git history.
Read before editing (
read_list): for given file paths, returns the project rules and risks that apply, the checks to run, the tests that reach the code, the files that depend on it, and where it broke before.Read before finishing (
changed_read_list): same information for every file changed on the branch since a base ref (defaultorigin/main, elsemain), with each rule and risk judged against the change under a verdict—what to do, what is blocked, what was not checked, other repositories.Avoid duplication (
find_existing): before writing a new function, helper, or module, finds existing functions, classes, files, and map entries that may already do the job (word match on names and paths).Map health (
check_map): reports whether.readfirst/map.jsonstill covers the code—files in no group, patterns matching nothing, broken rules.Stale map edits (
pending_map_edits): reports unmerged map edits proposed by hosted upkeep onreadfirst/upkeep, how many merges they cover, and how long they've waited.Repository-wide review (
audit_repo): produces a report on rules and risks whose files changed a lot, hot spots that moved, groups never filled in, code no test reaches, blind spots, and the files that broke most in the last 12 months.No server-side code execution or model calls from the client side: it works from the local git checkout plus the map, and is meant to be called at the start (and end) of a coding task.
readfirst
What to read and check before you — or your AI agent — change a file.
It found bugs now fixed upstream in Saleor, Wagtail, n8n, django-allauth and WYGIWYH: 136 real findings across 68 open-source repositories.
Start in 30 seconds
Any language; needs Node 20+.
npx readfirst init --agent --ci # a first map, your agents wired to it (Claude Code, Cursor, Codex, Gemini, ...), the PR Action
npx readfirst read <file> # before changing a file: its rules, risks, checks, tests and callers
npx readfirst verify # before you finish: the checks pass and nothing the map ties to the change was left out
Commit .readfirst/map.json. Filled maps for real repositories: examples/.
Related MCP server: codemap
What it does
Coding agents can follow imports. What they don't know is what your team knows: "amounts here are in cents", "this table is read by the mobile app, keep old columns", "run the payment e2e after touching this". readfirst keeps that in one file next to the code and hands it out, file by file, when someone is about to change something.
Your rules and risks, per file, from
.readfirst/map.json, with the checks to run and the files that change together.Where the code broke before, from git history:
npx readfirst audit, no map needed.Bug shapes taken from real bugs:
npx readfirst scan, no map needed (results computed and thrown away,expect(...).resolvesnobody awaits, and four more).
No server, no account, no model calls. It reads your git checkout and the map.
Free and hosted
Free (MIT) | Pro, $39 a month (readfirst-app) | |
Where it runs | your machine and your CI; your code goes nowhere | the readfirst-app GitHub App reads your repositories on our server |
The map |
| written for you from the code and its history (the free hosted fill is paused until three paying subscribers), and kept in step after each merge |
Pull requests | the Action posts what to read and check | PR watch comments on every pull request, whoever opened it: rules a change may break, files left out, the same table written elsewhere |
Bug shapes | the 6 published shapes ( | the full hosted set, a repository audit and fix PRs |
Where outside input goes | — | flows: from each route to the writes it reaches and the checks on the way |
Agents | Claude Code plugin and hook, MCP server, Cursor rules | the same, plus reproduced-bug reviews in a sandbox (one a month) |
Details: the guide.
What it caught
Saleor: an "only recalculate what changed" option recalculated every discounted price (#19984).
Wagtail: a superuser who submits a page got the moderation email about their own submission (#14790).
n8n: the RabbitMQ node handed back its channel before the queue bindings were made (#43033, fixed by the n8n team after our issue).
django-allauth: a provider callback returned a 500 on a non-ASCII value (f1e06cc, fixed the day it was reported).
WYGIWYH: client registration answered a 500 instead of a refusal on a non-ASCII token (#649, merged with its regression test).
Across 68 open-source repositories the hosted shapes recorded 897 hits, 849 judged: 100 bugs in app code, 36 tests that pass even when their check fails, and 312 false positives kept on record. The counts come after tuning on the same repositories, so read them as "what is there", not as precision. Reports still with their maintainers: the guide.
More
The Claude Code plugin and hook, MCP for any agent, Cursor rules, the GitHub Action, the map format, audit, find,
monorepos and pinning a version: the guide.
License
MIT
Available Tools
6 toolsaudit_repoA
The whole repository against .readfirst/map.json, as a report: rules and risks whose files changed a lot since they were written, hot spots that moved, groups never filled in, code no test reaches through imports, what readfirst could not see, and the files that broke most in the last 12 months (this part needs no map). Use it before larger work, or to decide what to add to the map.
Inputs: no named parameters.
changed_read_listA
The same read list for every file changed on this branch since the base (default origin/main, else main), each rule and risk judged against the change, under a verdict: what to do, what is blocked, what was not checked, other repositories. Call it before finishing, then run the checks it lists.
Inputs: base.
check_mapA
Whether .readfirst/map.json still covers the code: files in no group, patterns that match nothing, broken rules.
Inputs: no named parameters.
find_existingA
Before writing a new function, helper or module: the functions, classes, files and map entries that may already do it, matched by words (not meaning) against names and paths. Give a few words about what it does, e.g. "payment retry" or "csv export". If one fits, use or extend it instead of writing another.
Inputs: query (required).
pending_map_editsB
Map edits the hosted upkeep proposed that nobody has merged yet: how many merges they cover and how long they have waited on the readfirst/upkeep branch (from the clone's refs, as of the last fetch). Tell the user when there are any, so the map stays in step.
Inputs: no named parameters.
read_listA
What to read and check before changing these files: the project rules and risks that apply, the checks to run, the tests that reach the code and the files that use it, and where the file broke before (from git history). Call it before editing.
Inputs: files (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a defensible distinct role, but two near-pairs exist: read_list vs changed_read_list (both emit rule/risk/check guidance, differing only in scope) and check_map vs audit_repo (both validate against map.json, one structural, one report-style). Descriptions do help disambiguate, so misselection risk is moderate rather than severe.
All names are lowercase snake_case, which is consistent, but the conventions are mixed: verb_noun (check_map, audit_repo, find_existing) alongside noun phrases (read_list, changed_read_list, pending_map_edits). It's readable but not a single predictable pattern.
Six tools is well within a healthy range for a pre-edit context/guardrail server, and each earns a place. The read_list/changed_read_list pair arguably could be one tool with a flag, making it slightly leaner than ideal.
Covers the core loop: read guidance before edits, changed-file verdicts, map coverage checks, pending upkeep edits, repo-wide audits, and duplicate discovery. The main gap is the absence of any tool to create or update the map itself (edits arrive only via the hosted upkeep branch), which is a deliberate but limiting omission.
Maintenance
Related MCP Connectors
Code-map tools for AI agents: see a repo's structure first, then edit only what matters.
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Codebase intelligence for AI agents — dead code, blast radius, ownership.
Codebase memory for AI coding agents: files, lines, callers and tests for any public GitHub repo.
Related MCP Servers
- AlicenseAqualityCmaintenanceProvides AI coding agents with durable architecture memory for repositories by generating structured project maps of responsibilities, relationships, and risks.618 npmMIT
- AlicenseNot gradedqualityAmaintenanceAuto-generates and refreshes a budget-bounded codebase map inside AGENTS.md for MCP-enabled coding agents, with tools to return, update, and check the map.MIT
- AlicenseAqualityAmaintenanceGives coding agents read-only tools that return, in one call, a declaration's callers traced up to entry points or its callees down to 8 levels, plus a map of directories, files, declarations and every usage of a symbol. Maps TypeScript, JavaScript, Go, Python and Java using each language's own compiler, so a change's impact can be traced across imports, methods, interfaces and decorators.411Apache 2.0
- AlicenseAqualityBmaintenanceEnables coding agents to map a multi-repo workspace by resolving which repository a service name refers to, reading short per-repo cards, listing related repos with file-and-line evidence, finding where a table, package, path, or symbol lives across repositories, and refreshing the map. It answers orientation, localization, and cross-repo impact questions without the agent re-exploring every sibling repo.1231 PyPI4Apache 2.0