Measure and manage comprehension debt in a Git repository through local MCP tools.
Rate change risk for files/folders based on AI-written, understood, skimmed, fading, and unread lines, with advice.
Rate change risk for files/folders based on AI-written, understood, skimmed, fading, and unread lines, with advice.
Summarize repo-wide debt, AI , critical paths, and riskiest files.
Summarize repo-wide debt, AI , critical paths, and riskiest files.
Find who has shown understanding of a path and who recently committed to it.
Find who has shown understanding of a path and who recently committed to it.
Generate quiz briefs for specific paths, uncommitted changes, or diffs, including grading and recording instructions.
Generate quiz briefs for specific paths, uncommitted changes, or diffs, including grading and recording instructions.
Record understanding after a quiz, explanation, review, or pairing in the shared ledger; this is the only write tool.
Record understanding after a quiz, explanation, review, or pairing in the shared ledger; this is the only write tool.
Summarize a PR/branch’s AI-written additions and how much is understood, including ready-to-post markdown.
Summarize a PR/branch’s AI-written additions and how much is understood, including ready-to-post markdown.
Show AI-vs-human code trends over time by agent, week, or month.
Show AI-vs-human code trends over time by agent, week, or month.
Analyzes a local git repository's history and working tree to trace line ownership, identify AI-authored commits, and compute comprehension debt and quiz coverage.
Find the AI-written code nobody on your team understands, and pay it down one short quiz at a time.
▶ Live demo · Website · Study: how much of open source is AI-written? · Install · Agent skill · MCP server · CI and PR
Coding agents now write a large of the code we ship. The tests pass, the diff looks clean, it gets merged. A month later something breaks at 2am, and nobody on the team can explain how that module works.
That gap has a name: comprehension debt , the difference between how much code is in your system and how much of it any person actually understands. It doesn't show up in linters, coverage or code review dashboards.
grokmap measures it. It traces every line in your repo to the commit that wrote it, recognises commits made by AI agents (Claude Code, Copilot, Cursor, Codex, Aider, Devin, Gemini…), and checks them against a shared ledger of who has shown they understand that code. Then it draws you a map.
How much of your code is AI-written?
grokmap status answers that in seconds, and grokmap trend shows how it changed month by month. We ran it on 18 well-known open-source projects. In the MCP reference servers , 94% of commits from August to October 2026 were co-authored by Claude; in VS Code, 74% were co-authored by Copilot. Read the full study , including its limitations.
New to the idea? What is comprehension debt, and how do you measure it?
Related MCP server: Mapnostics
How you pay it down: your agent quizzes you
grokmap ships an agent skill . After your coding agent writes something substantial, it offers a two-minute quiz on exactly the lines you haven't shown you understand, grades you honestly, and records the result:
Understanding is tracked per line . If the agent later rewrites a line you were quizzed on, that line counts as new, not-yet-understood code again. Understanding older than 180 days shows as fading .
Or try it without installing: uvx grokmap status
Python 3.11+ and git. No other dependencies, no network calls, nothing leaves your machine.
Add the skill to your coding agent
(or /plugin marketplace add Aadithya-kl/grokmap , then /plugin install grokmap@grokmap )
Any agent that reads SKILL.md files (Codex, Cursor, Gemini CLI, OpenCode…):
or copy skills/grokmap/ into your agent's skills folder.
Then just say "quiz me on the payments module" , or let the agent offer after it finishes a change.
MCP server: let your agent check before it edits
The skill teaches the agent to quiz you. The MCP server goes further: before the agent changes code, it can ask "does anyone on this team actually understand this?" and be more careful when the answer is no.
That block works in Claude Desktop, Cursor ( .cursor/mcp.json ), Windsurf and most other clients. Elsewhere:
Already installed grokmap? pip install "grokmap[mcp]" and use grokmap mcp as the command instead.
Prefer Docker? docker build -t grokmap-mcp . in this repo, then use docker run -i --rm -v "$PWD:/repo" grokmap-mcp as the command.
For the files it's to change: a risk level from none to very high , who understands them, and how to act (explain the change, keep the diff small, offer a quiz).
Debt, AI and the riskiest files.
Who has shown they understand a file or folder, so it knows whom to ask.
The exact lines you haven't shown you understand, plus grading rules.
Records a quiz, explanation, review or pairing result in the shared ledger. The only tool that writes.
The AI-written lines a branch adds and how many are understood.
How much of the code added each week or month each agent wrote.
Plus a quiz_me prompt. Every tool returns structured results with a published output schema, so agents read fields instead of parsing text. Everything runs locally on your git history: no network calls, no API keys. Find it in the official MCP Registry ( io.github.Aadithya-kl/grokmap ), on Glama and on cursor.directory .
Commit .grokmap/ledger.jsonl so your whole team shares one map. It's one JSON object per line with a merge=union git rule, so merges don't conflict.
Debt, AI , who understands what, riskiest files. --json and --markdown for scripts and PR .
grokmap report [-o file] [--open]
Self-contained HTML heatmap: a zoomable treemap, hover details, filterable file table, light and dark themes.
grokmap quiz [paths] [--uncommitted | --staged | --diff main]
A quiz brief for your agent: the exact lines you haven't shown you understand, plus grading rules.
grokmap mark --score 0.8 [--method quiz|explain|review]
Record understanding. path:10-40 or --lines for line ranges, folders expand to their files.
grokmap diff [--base origin/main]
The AI-written lines a branch adds and how many are understood. --markdown for a PR , --max-unread N to gate merges.
grokmap trend [--by week|month]
How much of the code added over time was written by each agent.
Who understands the AI-written code in a file or folder.
grokmap check [--max-debt 40] [--critical]
Exits 1 above the limit. For CI.
An SVG badge for your README:
Adds config, ledger and .gitattributes .
Runs the MCP server over stdio (needs grokmap[mcp] ).
On every pull request it posts one (and keeps it up to date) like this:
grokmap: comprehension check This change adds 5 AI-written lines (claude 5) and 1 human-written line. 4 of the AI lines (80%) have been understood by someone on the team. File AI lines Understood Not checked src/shopcart/pricing.py 1 0 1 src/shopcart/loyalty.py 4 4 0 Before merging, the author can ask their coding agent to run grokmap quiz --diff origin/main for a 2-minute quiz on the unchecked lines.
grokmap: comprehension check
This change adds 5 AI-written lines (claude 5) and 1 human-written line. 4 of the AI lines (80%) have been understood by someone on the team.
src/shopcart/pricing.py
src/shopcart/loyalty.py
Before merging, the author can ask their coding agent to run grokmap quiz --diff origin/main for a 2-minute quiz on the unchecked lines.
It also writes the repo summary to the job page, uploads the heatmap as an artifact, and exposes debt and ai-lines as outputs. Everything is report-only unless you set a limit.
Attribution. For every tracked text file, git blame -w maps each line at HEAD to the commit that last changed it. Blank lines and lone brackets are ignored.
Attribution. For every tracked text file, git blame -w maps each line at HEAD to the commit that last changed it. Blank lines and lone brackets are ignored.
AI detection. A commit counts as AI-written only when it carries evidence the tools themselves leave behind: Agent Signals Claude / Claude Code Co-Authored-By: Claude , "Generated with Claude Code", Claude-Session: , claude[bot] GitHub Copilot Copilot coding agent as author, Co-authored-by: Copilot Cursor cursoragent@cursor.com author or co-author OpenAI Codex chatgpt-codex / codex[bot] , Codex co-author Aider aider: message prefix, (aider) author suffix Charm Crush [email protected] co-author Devin, Gemini / Jules, Amazon Q, Windsurf their bot authors or co-author trailers Your own any regex in [grokmap.ai_patterns] , or specific commits in [grokmap.ai_commits] Squash merges keep co-author trailers, so detection survives the usual GitHub workflow.
AI detection. A commit counts as AI-written only when it carries evidence the tools themselves leave behind:
Co-Authored-By: Claude , "Generated with Claude Code", Claude-Session: , claude[bot]
Copilot coding agent as author, Co-authored-by: Copilot
cursoragent@cursor.com author or co-author
chatgpt-codex / codex[bot] , Codex co-author
aider: message prefix, (aider) author suffix
[email protected] co-author
Devin, Gemini / Jules, Amazon Q, Windsurf
their bot authors or co-author trailers
any regex in [grokmap.ai_patterns] , or specific commits in [grokmap.ai_commits]
Squash merges keep co-author trailers, so detection survives the usual GitHub workflow.
Understanding. Each ledger record stores short hashes of the lines a person was quizzed on. A line is understood when someone passed a quiz on its current content, skimmed for a low score or a review , fading when the pass is older than decay_days .
Understanding. Each ledger record stores short hashes of the lines a person was quizzed on. A line is understood when someone passed a quiz on its current content, skimmed for a low score or a review , fading when the pass is older than decay_days .
Debt = unread AI lines + ½ × (skimmed + fading) AI lines, divided by all meaningful lines.
Debt = unread AI lines + ½ × (skimmed + fading) AI lines, divided by all meaningful lines.
grokmap trend uses git log --numstat with the same detection, so you can see when AI started writing most of your code.
Results are cached per file blob in .grokmap/cache.json . A 318,000-line repo with 3,000 files takes 17 seconds the first time and a second after that.
.grokmap.toml (or [tool.grokmap] in pyproject.toml ):
Lock files, build output, vendored code, minified files, media and binaries are skipped by default.
Is this surveillance? No. grokmap measures code , not people. Nobody is quizzed unless they ask, the ledger only holds what people chose to record, and the main number is the codebase. If your team would use it to rank people, don't adopt it.
What AI code pasted from a chat window? grokmap can't see it, so it counts as human-written. Detection is deliberately conservative: it only flags commits with real evidence and never guesses from code style. Adding an AI-Assisted: trailer (or your own pattern) fixes this going forward.
Can I game it? You can mark code as understood without a quiz, the same way you can approve a PR without reading it. The point is an honest map for your own team, and the skill is written to never record a score the person didn't earn.
Does the quiz send my code anywhere? grokmap itself makes no network calls. Your coding agent reads the brief like any other file it already works with.
To grok is to understand something so thoroughly it becomes part of you. This is a map of what your team groks.
Ideas the project wants help with are tracked as issues . The good first issues are small and well scoped. The biggest ones: an editor extension that colors understood and unread lines in the gutter, keeping understanding across file renames, and detection for more agents.
See CONTRIBUTING.md . The short version:
Most useful contributions: detection signatures for more agents (with a real example commit), and reports of false positives.
Show how much of the code added over time was written by each AI agent versus people, per week or month.
Inputs: by, repo, since. Returns: by, periods, summary
Rate how risky it is to change specific files or folders, based on how much of their AI-written code anyone on the team has shown they understand.
Inputs: paths (required), repo. Returns: repo, results
Summarize a branch or pull request: the AI-written lines it adds compared with base and how many of them anyone understands.
Inputs: base, repo. Returns: ai, base, files, human, +6 more
Build a quiz brief: the exact AI-written lines a person has not yet shown they understand, with rules for quizzing them.
Inputs: who, repo, paths, diff_base, +2 more. Returns: who, truncated, line_count, record_with, +2 more
Record in the shared ledger (.grokmap/ledger.jsonl) that a person showed they understand these lines.
Inputs: paths (required), score (required), who, note, +2 more. Returns: who, files, lines, score, +4 more
Summarize comprehension debt for the whole repository: how much code is AI-written, how much of that anyone understands, and which files are riskiest.
Inputs: top, repo. Returns: head, repo, risk, total, +2 more
List the people who have shown they understand the AI-written code at a path, and who committed to it lately.
Inputs: path (required), repo. Returns: note, path, unread, ai_lines, +2 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Scored 2026-11-28 08:01 across 7 tools
Each tool has a distinct scope: whole-repo overview (repo_status), per-path risk (comprehension_risk), reviewer lookup (who_understands), quiz generation (quiz_brief), ledger write (record_understanding), branch/PR analysis (pr_comprehension), and time-series (ai_trend). Descriptions explicitly cross-reference siblings ("for the whole repository use repo_status", "for a risk rating use comprehension_risk"), so overlapping-sounding tools are cleanly separated. Read vs. write boundary between quiz_brief and record_understanding is stated unambiguously.
All names are snake_case and mostly follow a _ shape (comprehension_risk, repo_status, quiz_brief, pr_comprehension, ai_trend). Two deviate: record_understanding is verb_noun while who_understands is a question phrase, breaking the otherwise nominal pattern. Still readable and predictable overall.
Seven tools is well-scoped for a comprehension-debt analysis server: six read-only analyses covering repo, file, person, branch, and trend views plus exactly one mutating tool. Each tool earns its place with no filler or redundant variants.
The lifecycle is well covered: assess risk, identify reviewers, quiz, record understanding, analyze PRs and trends. Minor gaps remain — there is no way to enumerate or paths (agents must rely on riskiest_files from repo_status), and no tool to inspect or audit previously recorded ledger entries beyond the latest write.
Related MCP Connectors
Mapnostics io.github.ffteema Codebase intelligence for AI agents — dead code, blast radius, ownership. Code Analysis Developer Tools 1
Codebase intelligence for AI agents — dead code, blast radius, ownership.
Repowise dev.repowise Codebase intelligence for AI coding agents: graph, git history, docs, decisions, code health. Code Analysis Version Control Developer Tools 1 8,347
Codebase intelligence for AI coding agents: graph, git history, docs, decisions, code health.
Spiderbrain ai.spiderbrain Deterministic context layer for your codebase: change impact, blast radius, answers with receipts. Code Analysis Developer Tools RAG Systems 1 3
Deterministic context layer for your codebase: change impact, blast radius, answers with receipts.
TeamShared C io.github.xhad Shared memory for coding agents. Stop re-explaining your codebase every session. Knowledge & Memory Developer Tools 218 1
Shared memory for coding agents. Stop re-explaining your codebase every session.
lore-mcp EliotShift A license A quality C maintenance Architectural memory layer for AI coding. Automatically extracts decisions, detects security gaps, and analyzes git history from your codebase in one command. Updated 7 months ago ( 2026-04-18 15:40 UTC ) 3 28 npm 2 MIT
Mapnostics official mapnostics A license - Not graded quality C maintenance Codebase intelligence for AI agents - dead code, blast radius, ownership. Updated 3 months ago ( 2026-09-10 16:04 UTC ) MIT
Feinman MrTheMech A license - Not graded quality C maintenance Enables AI coding agents to understand unfamiliar codebases through project summaries, file explanations, feature tracing, change planning, test discovery, guided walkthroughs, and token-efficient repository digests. Updated a month ago ( 2026-10-24 11:24 UTC ) 1 Apache 2.0
gitrisk-mcp 0xmortuex A license A quality B maintenance Enables AI assistants to mine a git repository's history and answer pre-change questions: which files are riskiest, who genuinely knows a file or directory (blame-weighted, with bus factor and inactive authors), which files secretly change together, churn timelines, commit , and release notes. It runs read-only against real git with noise filtering and reproducible, documented formulas. Updated 16 days ago ( 2026-11-13 17:54 UTC ) 9 MIT
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
