agentleFS
LetermeFlorentLetermeFlorent/claude-skills/code-map/SKILL.md

code-map

Skill0 starsChanged 17 days agoMITView on GitHub

Use when finding where something is defined or used, what calls what, mapping an unknown project before reading files one by one, looking for dead code or import cycles, remembering what was learned on a project, keeping a second brain or project memory, asking "why is this like that", or when the old graphify tool or a graphify-out folder is mentioned.

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run from inside the project, or pass --root.

    line 27
  2. Very specific:

    Read before any work on a project: find on the topic and explain on each symbol or file you will change.

    line 59
  3. Distinctive:

    Write a note when you learn a fact the code does not show (why it is so, a trap, where a flow lives), after a failed attempt followed by …

    line 63

“Common” is measured: kept by at least 6 in 10 of the 8 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Mapping a project's code

Small local map of any project, 3 files or a monorepo: definitions with line numbers, imports, which files mention which symbol, which docs talk about it, and the notes kept on it from earlier sessions. No model call, no network, no dependency, Python 3 standard library only. Replaces graphify.

<skill> = this folder. Every query refreshes the map first, reading only files whose size or mtime changed, so there is no build step to remember.

python -I "<skill>/scripts/code_map.py" build [--root DIR] [--scope SUBDIR]
python -I "<skill>/scripts/code_map.py" report
python -I "<skill>/scripts/code_map.py" find <words...> [--budget N]
python -I "<skill>/scripts/code_map.py" explain <name or file>
python -I "<skill>/scripts/code_map.py" path <a> <b>
python -I "<skill>/scripts/code_map.py" unused
python -I "<skill>/scripts/code_map.py" note "<fact>" [--about <symbol or file>...]
python -I "<skill>/scripts/code_map.py" note --drop <id>
python -I "<skill>/scripts/code_map.py" notes [--stale]

Run from inside the project, or pass --root. Root = git top level, else the folder given. Flags are in --help.

CommandPrints
buildfiles, symbols, edges, languages, changed files read, time. Forces a refresh.
reportbiggest files, most referenced symbols (hubs), import cycles, folders, dead code. Also writes report.md.
findmatching notes first, then path:line kind name for symbols, files and doc headings matching the words (camelCase and snake_case split), with who references each. Cut at the budget (about 6000 characters).
explainwhere defined, what the file uses, who references it, import neighbours, the docs that mention it, its notes. Accepts a file path.
pathshortest chain of references and imports between two symbols or files.
unusedsymbols no code file mentions: dead code candidates. A mention in a doc does not count.
notesaves one fact, gives its id. --about ties it to symbols or files, which must exist in the map.
notesevery note with its id, stale on those whose files changed since. --stale keeps only those.

When to use it

SituationUse
Starting any work on a projectfind on the topic, explain on what you will touch
Unknown project, about to open files one by onereport, then find
Who calls or uses X, what breaks if X changesexplain X
How A reaches Bpath A B
Cleanup, import cycles, dead codereport, unused
"Why is this like that", what was tried beforefind on the topic, notes
Tiny project, one exact string to locategrep is enough

The map beats grep on callers, cycles, unused code and unknown projects. It does not replace reading: take the lines it gives, then open only those files.

Notes: the project's memory

Notes keep what the code does not show, so the next session does not learn it again.

Read before any work on a project: find on the topic and explain on each symbol or file you will change. Both print the notes and docs tied to it. A note marked stale was written before its file last changed: check it against the code, then rewrite it as a new note or drop it.

Write a note when you learn a fact the code does not show (why it is so, a trap, where a flow lives), after a failed attempt followed by one that worked (what failed and what worked), and after a decision. One note per fact, one or two sentences, --about the symbols or files it concerns so explain finds it. Do not note what reading the code tells at once.

python -I "<skill>/scripts/code_map.py" note "retry loop stays: the API drops 1 call in 50" --about fetch_all

Limits

What the map can and cannot tell.

  1. A reference is a whole identifier token. Two symbols with the same name are not told apart, and names under 3 characters, very common names or names defined in more than 4 files are not linked.
  2. Python is parsed with ast. JS, TS, Go, Rust, Java, Kotlin, C#, C and C++, PHP, Ruby, Swift, Lua, Luau and shell use line patterns. Markdown gives heading nodes, and words in backticks, code blocks and code-looking words (snake_case, camelCase, name() that match a symbol link the doc to it. Any other text file is a file node only.
  3. unused is a candidate list: entry points, tests, dunder names and index files are skipped, but names reached by reflection or from outside the project still show up.
  4. A file edited in this run is read directly: the map is refreshed on the next query, not live.
  5. Files over 1 MB, binaries and .ia/ are left out.

Storage

The map lives in <root>/.ia/code-map/ (map.json, report.md), notes in notes.json next to it. It is never committed. Rebuilds never touch notes.json: delete map.json to force a full rebuild and keep the notes. A note id is never reused after --drop.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.