Skip to main content Switch to mobile version grokmap 0.8.0 Measure comprehension debt: the AI-written code in your repo that nobody understands.
pip install grokmap==0.8.0 Copy PIP instructions
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 · VS Code · CI and PR comments
🌐 English · 简体中文 · 繁體中文 · 日本語 · 한국어 · Español · Português (Brasil) · Deutsch · Français · Русский · हिन्दी · தமிழ்
Coding agents now write a large share 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.
Grok-map 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.
$ grokmap status Grok-map · shopcart @ c3088b29ff Comprehension debt 34.5% Lines scanned 255 in 12 files Written by AI 218 lines (85.5%) — claude 141, copilot 56, cursor 21 understood 83 (38%) fading 21 skimmed 73 nobody checked 41 Critical paths 40.7% debt over 86 lines Understood by alex@example.com (53), priya@example.com (51) Riskiest files lines AI unread debt src/shopcart/payments/client.py 64 64 33 52% src/shopcart/api/routes.py 33 33 0 50% src/shopcart/api/auth.py 23 23 0 50% Pay it down: ask your coding agent to run `grokmap quiz
Grok-map is built with Claude. Here is our own number: (from grokmap badge on this repository; every commit is listed as Claude's in .grokmap.toml or carries a Claude trailer).
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 VS Code, 74% of commits from August to October 2026 carry a Copilot co-author trailer (73% of merged changes). Most recent commits in the MCP reference servers carry a Claude trailer, but largely from one maintainer's unsquashed rewrite branch: per merged change it is about 41%. Read the full study, including its limitations.
New to the idea? What is comprehension debt, and how do you measure it?
How you pay it down: your agent quizzes you
Grok-map 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:
you > yes, quiz me before I commit agent > (runs: grokmap quiz --uncommitted) Q1 of 3. A charge request times out after the provider already took the money. What stops the retry from charging the customer twice? you > the idempotency key — it's a hash of order id and amount, so the retry reuses it agent > Correct (1/1). The provider sees the same Idempotency-Key and returns the first charge. Q2 of 3. A card is declined with HTTP 402. How many times do we call the API, and why? you > three times? because of the retry decorator agent > Not quite (0/1). 4xx errors are raised with retryable=False, and the decorator re-raises those immediately, so it's one call. Only 5xx and network errors are retried. ... agent > Score 0.67. Recorded (grokmap mark … --score 0.67 --method quiz). Worth rereading the error handling in charge() — that's where the retry rules live. 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.
pipx install grokmap # or: pip install grokmap Or try it on any repository without installing anything. tour reads git history only and writes nothing:
cd some-repo && uvx grokmap tour Python 3.11+ and git. No other dependencies, no network calls, nothing leaves your machine.
Add the skill to your coding agent
/plugin install grokmap --marketplace Aadithya-kl/grokmap (or /plugin marketplace add Aadithya-kl/grokmap, then /plugin install grokmap@grokmap). The plugin starts the MCP server with uvx, so it needs uv.
Any agent that reads SKILL.md files (Codex, Cursor, Gemini CLI, OpenCode…):
npx skills add Aadithya-kl/grokmap 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.
{ "mcpServers": { "grokmap": { "command": "uvx", "args": ["grokmap-mcp"] } } }
That block works in Cursor (.cursor/mcp.json), Windsurf, VS Code and most clients that start the server in your project folder. Which repository it reads: the folder the server starts in; if that isn't a git repository, the folder your client shares as a root (Cursor, VS Code and Claude Code do); or a repo path the agent passes, which must be inside one of those (add more with --allow-repo PATH). Claude Desktop can start servers in / without sharing a project folder, so give it one there: "args": ["--directory", "/path/to/project", "grokmap-mcp"] with uvx, or "cwd": "/path/to/project" where your client supports it. The first scan of a large repository can take a minute or more: the server starts it in the background, reports progress, and a tool that runs out of time says it is still scanning; asking again picks up where it left off. Elsewhere:
claude mcp add grokmap -- uvx grokmap-mcp # Claude Code (the plugin above already includes it) codex mcp add grokmap -- uvx grokmap-mcp # Codex CLI code --add-mcp '{"name":"grokmap","command":"uvx","args":["grokmap-mcp"]}' # VS Code Already installed Grok-map? pip install "grokmap[mcp]" and use grokmap mcp as the command instead. grokmap-mcp --help shows these options.
Prefer Docker? docker build -t grokmap-mcp . in this repo, then use docker run -i --rm --user "$(id -u):$(id -g)" -v "$PWD:/repo" grokmap-mcp as the command (--user runs it as you, so its cache in .git/grokmap stays yours).
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 mcpservers.org.
VS Code extension: a dashboard, quizzes and the gutter
The Grok-map extension adds a Grok-map panel to the sidebar, which can also open as an editor tab:
Repositories: pick any repository without opening it as a folder.
Dashboard: how much of the AI-written code anyone understands, and the files that need attention.
Quizzes: take one right there. Questions are written and graded by the AI model you already have in VS Code (such as Copilot), and the result goes straight into the ledger.
This branch: the AI-written lines your branch adds that you haven't checked, with Quiz me before I push.
Files or folders, code only: see which areas nobody understands, with tests, docs and data left out by default. Hover a row to quiz, mark as reviewed, or ignore it.
Progress and critical paths: what you and the team checked this week, the understood-% trend, and critical folders shown and quizzed first.
Hand-off: with no model, one click passes the quiz to Claude Code, Copilot Chat, Kilo Code, Cline, Roo Code or Cursor.
Your language: the panel, the gutter and the quiz questions come in English, Chinese (simplified and traditional), Japanese, Korean, Spanish, Portuguese, German, French, Russian, Hindi or Tamil. It follows VS Code, or pick one in ⚙ Settings.
In the editor margin, every AI-written line is coloured: red where nobody has checked it, orange where it was only skimmed, yellow where understanding is fading, green where someone has shown they understand it. Hover a block to see which agent wrote it, in which commit, and who understands it. The status bar shows the file's debt. It follows your edits as you type, and works in VS Code, Cursor, Windsurf and VSCodium.
Search Grok-map in the Extensions panel and click Install, or run code --install-extension aadithya-kl.grokmap. It needs the CLI on your PATH (pip install grokmap), or set grokmap.command to uvx grokmap. Cursor, Windsurf and VSCodium install it the same way, from Open VSX.
grokmap.nvim colours the sign column the same way, with :GrokmapHover (who wrote this line, who understands it), :GrokmapQuiz, and a statusline component. See its README for lazy.nvim setup.
cd your-repo grokmap tour # a first look: no setup, writes nothing grokmap init --ci # .grokmap.toml + ledger + a merge rule + a GitHub workflow grokmap status # the numbers grokmap report --open # the interactive heatmap grokmap hook install --trailer # tag commits your coding agent makes, so none are missed 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.
grokmap init --ci writes this workflow for you (.github/workflows/grokmap.yml):
name: grokmap on: pull_request: push: branches: [main] schedule: - cron: "23 6 * * 1" # Monday digest permissions: contents: read jobs: grokmap: runs-on: ubuntu-latest permissions: contents: write # the badge branch (pushes to main only) pull-requests: write # the PR comment issues: write # the weekly digest issue steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 # blame needs full history persist-credentials: false - uses: Aadithya-kl/grokmap@v0 # or pin a commit SHA with: badge: ${{ github.event_name == 'push' }} digest: ${{ github.event_name == 'schedule' }} # max-unread-critical: 0 # fail a PR that adds unchecked AI code on a critical path # max-unread: 200 # fail a PR that adds more than 200 unchecked AI lines # max-debt: 40 # fail when the repository is above 40% debt Pull requests: one comment, kept up to date, with the AI-written lines the PR adds, how many anyone understands, which are on critical paths, and the owners to ask.
Pushes to main: refreshes a README badge on the grokmap-badge branch. Add it to your README with [](https://github.com/Aadithya-kl/grokmap)
Mondays: a digest comment on a "Grok-map weekly digest" issue: new AI code, what the team checked, the trend, and what's still unchecked. Close the issue to stop it.
Everything is report-only until you set a limit.
On every pull request it posts one comment (and keeps it up to date) like this:
Grok-map: 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.
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, caches blame results between runs, and exposes debt and ai-lines as outputs. Everything is report-only unless you set a limit. Other inputs: critical: true makes max-debt apply only to the critical paths in .grokmap.toml; working-directory runs it in a folder of the workspace (for example when actions/checkout used path:); comment: false turns the comment off.
What a pull request can't change: on pull requests the Action reads .grokmap.toml and the ledger from the base branch, so a PR can't pass its own gate by adding ledger lines or excluding files. Ledger records the PR adds are listed separately in the comment, under "Self-reported in this PR", with who committed them; they count once merged.
The gate is advisory unless you protect the ledger. Anyone who can merge to the base branch can write any ledger record. To make max-debt / max-unread a real gate, require reviews for .grokmap/ with a CODEOWNERS entry and a branch rule.
Pull requests from forks get no comment (their token is read-only); the table is in the job summary instead.
Shallow clones: use fetch-depth: 0. On a shallow clone the limits refuse to decide instead of passing on partial numbers.
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 is last-touch: whoever changed a line last, as git blame sees it. A person's formatting commit over AI code makes those lines theirs, and an agent's rename in human code makes them AI-written. List such commits in .git-blame-ignore-revs (Grok-map reads it, as GitHub does) or in ignore_commits = ["3f2a9c1"] in .grokmap.toml. In a shallow clone, lines older than the clone's history count as unknown, and Grok-map warns that the numbers are incomplete.
AI detection. A commit counts as AI-written only when it carries evidence the tools themselves leave behind:
Co-authors are matched on an agent's own identity (its noreply email or bot account), never on a first name, so Co-authored-by: Claude Dupont
Squash merges: a squash commit keeps the co-author trailers of the commits in it, so one agent trailer anywhere in a pull request makes the whole squashed pull request count as AI-written, including lines a person wrote. For accurate numbers, rebase-merge (or merge) instead, or analyse the branch before it's squashed.
Understanding. Each ledger record stores a short key for every line a person was quizzed on, made from the line and the lines around it. A line is understood when someone passed a quiz on it and neither it nor its neighbours have changed since (whitespace aside), so an edit, or an identical line added somewhere else later, needs checking again. It is 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. Human-written code counts as zero debt, so a repository that's mostly human has low debt even if nobody has checked its AI code; status also shows the plainer number, the share of AI-written lines someone has understood.
grokmap trend uses git log --numstat with the same detection, so you can see when AI started writing most of your code. Lines count in the week or month (UTC) of their author date, so rebased work keeps its original date. Results are cached in git's directory, and later runs read only the new commits.
Blame results are cached per file in git's own directory (.git/grokmap/), checked against history on every run. Measured on fastapi (2,855 scanned files, 236,000 lines, 8,187 commits) on a 2-core Xeon cloud VM: the first grokmap status took 65 s, later runs about 1 s. First scans scale with cores (GROKMAP_JOBS), are saved as they go, and report and trend take longer.
.grokmap.toml (or [tool.grokmap] in pyproject.toml):
[grokmap] pass_score = 0.7 # quiz score that counts as understood decay_days = 180 # 0 = understanding never fades max_debt = 40 # default limit for `grokmap check` exclude = ["docs/**", "examples/**"] critical = ["src/payments/**", "src/auth/**"] ignore_commits = ["3f2a9c1"] # formatting commits blame should look past people = "pseudonymous" # show person-1a2b3c instead of emails (the ledger keeps emails) [grokmap.ai_patterns] internal-bot = "^co-authored-by:.*internal-bot" render-farm = "author:render-farm" [grokmap.ai_commits] "3f2a9c1" = "claude" # before your team added trailers [grokmap.owners] # who should understand each area; without it, CODEOWNERS is used "src/payments/**" = ["priya@example.com"] Lock files, build output, vendored code, minified files, media and binaries are skipped by default. Globs work like .gitignore paths with a slash: docs/** is the top-level docs folder, **/docs/** is a docs folder at any depth, and a pattern with no slash (*.lock) matches file names anywhere. grokmap status says how many files were left out. Every setting is checked when it's read: a typo or an impossible value is an error, not silently ignored.
Is this surveillance? No. Grok-map measures code, not people. Nobody is quizzed unless they ask, the ledger only holds what people chose to record, and the main number is about the codebase. If your team would use it to rank people, don't adopt it.
What does it store about people? The ledger holds, per record, who answered (an email by default), the score, the method, the time and which lines. Status, the report, who and the MCP tools show per-person counts, the panel shows your own weekly streak, and low scores are recorded too (they count as skimmed). With people = "pseudonymous" every result shows a stable pseudonym per repository instead of emails; the ledger itself is unchanged. To erase someone: remove their lines from .grokmap/ledger.jsonl and commit that. Git history, and union merges from branches made before the removal, still hold the old lines; rewriting history is the only way to remove those.
What about AI code pasted from a chat window? Grok-map 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? Grok-map 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: detection for more agents, a JetBrains plugin, and following understanding through files that are split or merged (renames already work).
See CONTRIBUTING.md. The short version:
git clone https://github.com/Aadithya-kl/grokmap && cd grokmap python -m venv .venv && . .venv/bin/activate && pip install -e ".[dev]" pytest && ruff check src tests python scripts/make_demo.py /tmp/grokmap-demo && grokmap -C /tmp/grokmap-demo report --open Most useful contributions: detection signatures for more agents (with a real example commit), and reports of false positives.
Released: Dec 4, 2026
Author: K. L. Aadithya
Both files in this release have provenance metadata.
View provenance details
MIT View SPDX License List
agent-skills ai claude-code code-review codex comprehension-debt copilot git mcp mcp-server
Development Status 4 - Beta
Intended Audience Developers
Operating System OS Independent
Programming Language Python :: 3
Topic Software Development :: Quality Assurance
Software Development :: Version Control :: Git
Release files for grokmap 0.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 262.2 kB
Release files / grokmap-0.8.0.tar.gz
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 Dec 4, 2026.
Release files / grokmap-0.8.0-py3-none-any.whl
Security for grokmap 0.8.0
Both files in this release have been uploaded with provenance metadata.
With provenance grokmap-0.8.0.tar.gz Dec 4, 2026
With provenance grokmap-0.8.0-py3-none-any.whl Dec 4, 2026
Attestation for grokmap-0.8.0.tar.gz
Attestation for grokmap-0.8.0-py3-none-any.whl
A 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.
Release history Release notifications | RSS feed
Dec 5, 2026 2 release files Full provenance
Dec 4, 2026 2 release files Full provenance
Nov 29, 2026 2 release files Full provenance
Nov 28, 2026 2 release files Full provenance
Nov 26, 2026 2 release files Full provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation
Deployed from 4d99e05











