/docmap:docmapfrom docmap
Navigate markdown, PDF, plain-text, and YAML documentation structure without reading full files. Use before opening any large .md file, to locate specific constructs (code blocks, callouts, tables), to jump to a line number's context, or to see what changed in docs since a git ref.
Ships in docmap. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
docmap is a local CLI that turns a markdown file into a typed AST and surfaces every construct as a jump target. Use it as your first read of any documentation you haven't seen before.
Reach for docmap when any of these is true:
Read a markdown file larger than ~200 linesDo not invoke docmap for:
docmap .
docmap docs/
Returns a project-wide inventory header (total callouts, code blocks, tables, tasks, etc.) plus a one-line digest per file. Use this to decide which file to drill into.
docmap README.md
Returns a dense tree where each section carries an inline annotation of its notable contents. Every construct has a :line jump target.
docmap file.md --type <kind>
Valid kinds: code, callout, table, math, footnote, deflist, linkref, html, task, wiki, embed, mention, issue, sha, emoji.
Sub-filters:
docmap file.md --type code --lang python
docmap file.md --type callout --kind warning
Output lists every matching construct grouped by containing section, with exact line ranges.
docmap file.md --at 154
Returns the section breadcrumb and node type at line 154. Use this when you have a line number from anywhere (grep, diff, error, LSP) and need to know what it actually is.
docmap file.md --since HEAD~5
docmap file.md --since main
docmap . --since HEAD
Shows only the constructs that sit on lines modified since the given git ref. Uses git diff --unified=0 from the file's repository root (your cwd does not have to be the repo). Directory arguments print only docs that changed. New files count as fully changed.
docmap file.md --search "python"
docmap . --search "warning"
Searches section titles and content plus the typed AST: code block languages, callout variants, table headers, math TeX, footnote IDs, link labels, HTML content. Much broader than a plain grep.
Each matching section is followed by the lines that matched, ranked best first (title match, then whole-word, then hit count):
docs/HOOKS.md > Codemap Hooks > Why This Matters (93)
:436 2. **Sees** the blast radius after making changes
:436 is the jump target: read that line range directly instead of expanding the whole section. Phrases that wrap across a line break still match. --compact gives one file > section line per hit; --json carries line, count and hits.
docmap file.md --section "Installation" # Just that subtree
docmap file.md --expand "Installation" # Raw source of that section (file:L-L)
docmap file.md --expand "Appendix > Setup" # Breadcrumb picks between same-named sections
docmap . --brief # Session-start counts + recent docs (skips stale)
docmap . --brief --stale # Brief plus stale claim count
docmap . --stale # Flag stale path/binary/date/env claims
docmap . --stale --remote --json # Also check URLs/config (network)
docmap . --mentions src/foo.go # Sections that mention a changed path
docmap . --mentions --since HEAD # Mentions of all git-changed paths (incl. .go)
docmap . --refs
Shows which docs link to which other docs — useful for understanding doc graph topology.
docmap file.md --json
docmap . --json | jq '.documents[] | select(.summary.code_blocks > 10)'
Full typed AST including per-section notables, top-level summary counts, and every node with its kind + line range. Pipe into jq or another tool.
The header box shows the file's full inventory:
╭──── file.md ────╮
│ Sections: 30 │ ~2.3k tokens │
│ 5 callouts · 4 tables · 8 code blocks · 2 math │
│ 6 tasks (3 done) · 4 wiki · 6 embeds │
╰──────────────────────────────────────────────────╯
Every section line in the tree has the shape:
├── <title> (<tokens>) · <annotation>
Where <annotation> packs every notable construct in that section:
go :142-149, python :154-156, bash :161-162 — code blocks by language and line rangenote :219, tip :222, warning :228 — callouts by variant and line4 tables :108 Name, :116 Left, :123 Field — tables with first-header identification^1 :276, ^bignote :277 — footnote definitions by ID6 tasks (3 done) — aggregate task list counts4 wiki · 6 embeds — Obsidian aggregate countsThe :NNN format is a 1-indexed source line. Same convention as grep, ripgrep, vim, and compiler errors. :154-156 means "lines 154 through 156."
Workflow: skim before read
docmap unfamiliar.md # Get the structure
docmap unfamiliar.md --at 247 # What's at the section I care about?
# Now do a targeted Read on just lines 240-280
Workflow: find every instance of a construct
docmap huge-doc.md --type code --lang go # Every Go snippet
docmap huge-doc.md --type callout --kind warning # Every warning
Workflow: understand changes
git checkout feature-branch
docmap docs/api.md --since main # What did this PR change?
Workflow: project-wide discovery
docmap . # Header shows aggregate totals
# "there are 41 code blocks and 18 callouts in this repo"
# Decide which file is worth opening based on the per-file digest
Workflow: structured consumption
docmap file.md --json | jq '.documents[0].nodes[] | select(.kind == "code_block")'
Full CommonMark + GitHub Flavored Markdown + Obsidian extensions. Block constructs: frontmatter (YAML/TOML/JSON), ATX + Setext headings, paragraphs, blockquotes, GFM callouts (5 kinds), ordered/unordered/task lists, tables with alignment, fenced + indented code blocks, math blocks, footnote definitions, definition lists, HTML blocks, thematic breaks, link reference definitions. Inline constructs: links, autolinks (angle-bracket + GFM bare + email), images, emphasis/strong/strikethrough, inline code, inline math, footnote refs, wiki links ([[…]]), wiki embeds (![[…]]), mentions (@user), issue refs (#123, user/repo#123, GH-123), commit SHAs, emoji shortcodes, HTML entities.
codemap . # code structure (filesystem + symbols)
docmap . # doc structure (sections + notables)
Together, they give an agent full spatial awareness of a repository without reading any source file first.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub jordancoin/docmap --plugin docmap