codemap
Skill0 starsChanged 55 days agoMITView on GitHub
Generate a hierarchical map of an unfamiliar repository so agents can navigate it without re-reading everything. Expensive — only for initial mapping of a codebase nobody has explored yet. If graphify is installed, use that instead.
16 other projects use a version of this, 5 of them edited.
Adopted by
Most recently taken up by
- thistleknot/skillsedited, first seen Nov 8, 2026
- openyida/openyidatheir own version, first seen Nov 3, 2026
- hmjBill/skillstheir own version, first seen Oct 29, 2026
- jellydn/my-ai-toolstheir own version, first seen Oct 18, 2026
- mike22890/opencode-skills-enedited, first seen Oct 15, 2026
- Asixa/codemap-skilltheir own version, first seen Oct 11, 2026
Used with
Projects with it also use simplify.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Hugging FaceSkillsimplify
Refactor code after tests pass. The "Refactor" phase of Red-Green-Refactor.
Also in 4 projects that use this
Other versions16 projects use a version of this.
Word for word · 0
None found.
Edited · 5
- akitaonrails/my-skills★ 28315% same
- arkan/skills★ 115% same
- mike22890/opencode-skills-cn★ 115% same
- mike22890/opencode-skills-en★ 115% same
- thistleknot/skills★ 015% same
Wrote their own version · 11
- JordanCoin/codemap★ 710same name
- openyida/openyida★ 231same name
- jellydn/my-ai-tools★ 127same name
- ulpi-io/browse★ 15same name
- lglucas/ai-dev-operating-system★ 12same name
- Asixa/codemap-skill★ 8same name
- beadnall/codemap★ 8same name
- shalomb/agent-skills★ 3same name
- htdxd/codemap-skill★ 2same name
- camilo-acevedo/claude-skills★ 0same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- clonedepsSkill
- deepworkSkill
- omcs-configSkill
- orchestrateSkill
- reflectSkill
- verification-planningSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 4 are distinctive, and 9 are very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 32
Read .slim/codemap.json directly — this is a single specific lookup, not a reason to delegate.
- Very specific: line 37
No state, or state without the root codemap.md (a fresh clone: the state is tracked, the maps are git-ignored) → continue to Step 2 …
- Very specific: line 68
Record state: Write .slim/codemap.json (a normal Write call — this is small, mechanical, and one file, so do it directly rather than …
- Very specific: line 165
Read .slim/codemap.json for last_commit, include_patterns, exclude_patterns, and folders.
- Distinctive: line 167
If the root is a git repository (git rev-parse --is-inside-work-tree):
- Very specific: line 169
if last_commit is recorded and still resolves, git diff --name-only <last_commit> HEAD for changes committed since the last codemap run.
- Very specific: line 202
Map root assets: document root-level files (package.json, index.ts, the plugin manifest, etc.) and the project's overall purpose.
- Very specific: line 216
If it already has a ## Repository Map section, skip — already set up.
- Distinctive: line 217
If it exists without that section, append the block below.
- Distinctive: line 218
If it doesn't exist, create it with the block below.
- Distinctive: line 238
When the user asks to clean the codemap, remove:
- Very specific: line 240
every generated codemap.md file (root and per-folder)
- Very specific: line 243
Ask before removing .slim/codemap.json or the ## Repository Map section in CLAUDE.md because they may be intentional project metadata.
“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
If the
graphifyskill is available in this session, use it instead — it builds a richer, persistent graph. This skill exists so the plugin works standalone.
Codemap
Codemap builds and maintains hierarchical codemap.md files describing the
why and how of each directory in a repository, so agents can orient
themselves by reading a short map instead of the whole tree.
This plugin ships no code, so there is no helper script to run state
detection for you. Everything below — file discovery, change detection, and
state bookkeeping — is a workflow the calling agent runs with Glob, Grep,
Read, Bash (for git), and delegation to explorer and fixer, not a
script invocation.
When to Use
- User asks to understand or map a repository.
- User wants codebase documentation for agents to navigate by.
- Starting work on an unfamiliar codebase before a larger task.
Workflow
Step 1: Check for Existing State
Read .slim/codemap.json directly — this is a single specific lookup, not a
reason to delegate. If it doesn't exist, check for legacy state at
.slim/cartography.json and move it to .slim/codemap.json if found.
- State exists and the root
codemap.mdexists → skip to Step 3 (Detect Changes). - No state, or state without the root
codemap.md(a fresh clone: the state is tracked, the maps are git-ignored) → continue to Step 2 (Initialize).
Step 2: Initialize (no usable state)
- Decide include/exclude patterns for core code/config files only. If
state exists, reuse its
include_patternsandexclude_patterns:- Include:
src/**/*.ts,package.json, and similar — whatever the repo's actual source layout is. - Exclude (mandatory): tests (
**/*.test.*,**/*.spec.*,tests/**,__tests__/**), docs (docs/**,*.mdexcept the rootREADME.mdif useful), build/deps (node_modules/**,dist/**,build/**,*.min.js). - Respect
.gitignore.
- Include:
- Delegate discovery to
explorer(Agent tool,subagent_type: "oh-my-claudecode-slim:explorer"). This is broad, uncertain-scope discovery — exactly whatexploreris for. Ask it to:Globevery file matching the include patterns, minus the excludes and.gitignoreentries;- return the set of folders that contain at least one matched file
(every ancestor directory up to the root), with a per-folder file
count — not the full file list. On a real repository the full sorted
path list runs to thousands of entries, which would dump raw context
into the caller against
explorer's stated purpose of returning compressed context. The per-folderfixerlanes in step 6 re-glob their own folder directly, so the full list is never needed upstream; Readroot-level files (package.json,README.md, the plugin/entry file) far enough to summarize the project's overall purpose for the root atlas in Step 4.
Record state. Write
.slim/codemap.json(a normal Write call — this is small, mechanical, and one file, so do it directly rather than delegating):{ "version": "1.0.0", "last_run": "2026-09-19T00:00:00.000Z", "root": ".", "include_patterns": ["src/**/*.ts", "package.json"], "exclude_patterns": ["**/*.test.ts", "dist/**", "node_modules/**"], "last_commit": "a1b2c3d", "folders": ["src", "src/agents", "src/config"] }last_commitis the currentgit rev-parse HEADwhen the root is a git repository,nullotherwise — it is what Step 3 diffs against, replacing the upstream script's per-file content hashes.Update ignore files, modeled on
clonedepsStep 4 — same marked-block style, so the entries can be removed cleanly later. Before writing anycodemap.mdstub, inspect existing.gitignoreand.ignore. Update the managed block in place when present; otherwise append it. Add only the missing exact lines below, never duplicate entries or modify unrelated rules..slim/codemap.jsonstays tracked and is not added to either file: it is a small state manifest, andclonedepstreats its ownclonedeps.jsonthe same way. The generated per-foldercodemap.mdfiles are derived artifacts, so they are what gets ignored — but unlikeclonedeps' cloned repos, they are not confined to one directory under.slim/; they are scattered through the tree, one per mapped folder plus the root. The ignore entry therefore has to match them by filename rather than by path..gitignore:# BEGIN oh-my-claudecode-slim codemap codemap.md # END oh-my-claudecode-slim codemap.ignore:# BEGIN oh-my-claudecode-slim codemap !.slim/ !codemap.md # END oh-my-claudecode-slim codemapThe
!.slim/line matches whatclonedepswrites: without it, search tools skip the dot directory and.slim/codemap.jsonbecomes invisible toGrepandGlobeven though git still tracks it.Create empty
codemap.mdstubs in every discovered folder that doesn't already have one:# <folder>/ <!-- Fill in this section with architectural understanding --> ## Responsibility <!-- What is this folder's job in the system? --> ## Design <!-- Key patterns, abstractions, architectural decisions --> ## Flow <!-- How does data/control flow through this module? --> ## Integration <!-- How does it connect to other parts of the system? -->For a handful of folders, write these directly. For many folders, delegate to one or more
fixerlanes in parallel (one lane per group of folders) — this is bounded, mechanical work.- Delegate codemap writing to
fixer— one lane per folder (or per folder group), each reading that folder's matched files and replacing the stub with real content per the "Codemap Content" section below. In this step, skip folders whosecodemap.mdalready has real content.
Step 3: Detect Changes (if state already exists)
Change detection here is git-based, not hash-based — the upstream script hashed every matched file's bytes so it could work without git; this plugin trades that generality for simplicity, since almost every real repo is a git repo. See the caveat at the end of this step.
- Read
.slim/codemap.jsonforlast_commit,include_patterns,exclude_patterns, andfolders. - If the root is a git repository (
git rev-parse --is-inside-work-tree):git status --porcelainfor uncommitted and untracked changes;- if
last_commitis recorded and still resolves,git diff --name-only <last_commit> HEADfor changes committed since the last codemap run; - combine both into one list of changed paths.
- Filter that list down to paths matching
include_patternsand notexclude_patterns. For a large change set, hand the list and the patterns toexplorerto filter withGlob/Grep; for a small one, filter it directly. - Derive affected folders: every ancestor directory of every changed
path, plus the root. Only these folders need their
codemap.mdupdated. An affected folder with no matched files left is removed: delete itscodemap.md. An affected folder not in the oldfoldersis new: give it a stub as in Step 2. - Delegate updates to
fixer(Agent tool,subagent_type: "oh-my-claudecode-slim:fixer"), one lane per affected folder. - Update state: rewrite
.slim/codemap.jsonwith the newlast_commit(currentHEAD),last_run, andfolders(old list plus new folders, minus removed ones). If the root isn't a git repo, just bumplast_run.
Caveat (real capability gap vs. upstream): this workflow has no
exception-allowlist — upstream could force-include a specific file that an
exclude pattern would otherwise drop, and here the only way to keep such a
file is to narrow the exclude pattern itself. Also, without git, there is no
cheap way to detect what changed since the last run. If the root is not a
git repository, or last_commit no longer resolves (e.g. history was
rewritten), say so plainly and fall back to a full Step 2 remap instead of
guessing.
Step 4: Finalize Repository Atlas (Root Codemap)
Once affected/new directories are mapped, create or update the root
codemap.md — the entry point for any agent entering the repository:
- Map root assets: document root-level files (
package.json,index.ts, the plugin manifest, etc.) and the project's overall purpose. - Aggregate sub-maps: a "Repository Directory Map" section listing, for
every folder with a
codemap.md, its Responsibility summary and a link to the detailed map. - Cross-reference: paths to sub-maps so agents can jump directly to detail.
Step 5: Register Codemap in CLAUDE.md
Claude Code auto-loads CLAUDE.md (project root and user home) into agent
context every session. To make agents discover the codemap automatically,
update or create the project's root CLAUDE.md:
- If it already has a
## Repository Mapsection, skip — already set up. - If it exists without that section, append the block below.
- If it doesn't exist, create it with the block below.
## Repository Map
A full codemap is available at `codemap.md` in the project root.
When navigating an unfamiliar area of this repo, check `codemap.md` to orient
quickly:
- Project architecture and entry points
- Directory responsibilities and design patterns
- Data flow and integration points between modules
For deep work on a specific folder, also check that folder's `codemap.md`.Idempotent — repeated codemap runs detect the existing section and skip.
Cleanup
When the user asks to clean the codemap, remove:
- every generated
codemap.mdfile (root and per-folder) - the managed codemap marker blocks from
.gitignoreand.ignore
Ask before removing .slim/codemap.json or the ## Repository Map section
in CLAUDE.md because they may be intentional project metadata.
Codemap Content
fixer lanes write codemap.md content. Use precise technical terminology:
- Responsibility — the directory's role using standard engineering terms (e.g. "Service Layer", "Data Access Object", "Middleware").
- Design — name specific patterns used (e.g. "Observer", "Factory", "Strategy"); detail abstractions and interfaces.
- Flow — trace how data enters and leaves the module; specific function call sequences and state transitions.
- Integration — dependencies and consumer modules; technical names for hooks, events, or API endpoints.
Example folder codemap:
# src/auth/
## Responsibility
Authenticates incoming requests and issues session tokens.
## Design
Strategy pattern over pluggable auth providers:
- `providers/password.ts`, `providers/oauth.ts` implement a shared
`AuthProvider` interface.
- `session.ts` is a thin façade over the token store.
## Flow
1. Request hits `middleware.ts` → resolves provider by request shape.
2. Provider validates credentials, returns a `Principal`.
3. `session.ts` mints a signed token, attaches it to the response.
4. Downstream handlers read `req.principal`, set by the middleware.
## Integration
- Consumed by: every route under `src/routes/` via `middleware.ts`.
- Depends on: `src/config` for token secrets, `src/db` for user lookup.Example root atlas:
# Repository Atlas: example-api
## Project Responsibility
A REST API service handling user accounts and billing.
## System Entry Points
- `src/index.ts`: process entry point, wires middleware and routes.
- `package.json`: dependency manifest and build scripts.
- `config/default.json`: runtime configuration defaults.
## Directory Map (Aggregated)
| Directory | Responsibility Summary | Detailed Map |
|-----------|------------------------|--------------|
| `src/auth/` | Authenticates requests, issues session tokens. | [View Map](src/auth/codemap.md) |
| `src/billing/` | Subscription and invoice logic, payment provider integration. | [View Map](src/billing/codemap.md) |
| `src/db/` | Data access layer and migrations. | [View Map](src/db/codemap.md) |Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

