Community plugin · re-indexed every 3 hours

The Claude Code plugin for every official Claude doc page.

Always live, never redistributed. A 3 MB map of the whole Claude documentation set, installed in seconds. Your Claude reads the real, current page straight from Anthropic before it answers, instead of guessing from training data.

claude code · two commands
/plugin marketplace add costiash/claude-code-docs
/plugin install claude-docs@claude-code-docs

No Python. No MCP server. No API keys. The client is pure bash + curl + jq.

839pages indexed
100%fetched ok
todaylast re-index
~3 MBclone size

How it works

The architecture nobody else uses.

Most docs tools either mirror the docs into a repo (stale between syncs, ~100 MB clones, redistributes content that isn't theirs) or run an MCP server (another process, network round-trips, answers that flood your context). This does neither.

01 · every 3 hours

GitHub Actions builds the map

CI reads Anthropic's two llms.txt files and two sitemaps, then commits a page manifest and a prose-free search index. Metadata only.

runs on: github.com
02 · each session

Your machine syncs the map

A SessionStart hook hard-syncs the ~3 MB metadata repo and re-fetches only the pages that changed, in the background.

lives in: ~/.claude-code-docs/
03 · on demand

Claude reads the real page

Search hits the index in shell. Claude fetches only the pages it needs, .md straight from Anthropic's servers, into a local cache.

fetched from: platform.claude.com · code.claude.com
The compliance point is not a footnote. This repository contains zero documentation prose, not at the tip and not anywhere in its history. What you install is a map. The territory always comes fresh from Anthropic.
Comparison of documentation approaches
Web searchDocs mirrorsMCP docs serversThis plugin
FreshnessSearch-engine lagStale between syncsUsually currentLive page, every read
Claude docs coverageHit-or-missOften partialGeneric librariesEvery page, both sites
Runtime dependenciesNonegit + diskMCP server + configbash, curl, jq
Context cost per answerWhole pages of noiseFull file readsLarge tool payloadsIndex hit → one targeted page
Redistributes Anthropic's docsNoYes, wholesaleVariesNever. You fetch from the source.
Clone size—~100 MB—~3 MB

Watch it work

From question to working hook, grounded the whole way.

A replay of a typical task, with illustrative timings. The user asks for a hook. The plugin finds the two official pages, Claude reasons from what they actually say, then writes, registers, and tests the hook. Every fact in the reasoning comes from the pages shown on the right.

claude code · session replay
you
claude-docsdocumentation question detected → content-search.sh hooks block protected files
index2 hits in 4.1 ms · Automate actions with hooks · Hooks reference
read~/.claude-code-docs/cache/claude-code__hooks-guide.md · cached, synced 3h ago
read~/.claude-code-docs/cache/claude-code__hooks.md · cached, synced 3h ago
reasoning · grounded

The guide has a recipe for exactly this: a PreToolUse hook with matcher Edit|Write that runs a script. hooks-guide → Block edits to protected files

The script must exit 2 to block. The reference is explicit that exit 1 is only a non-blocking error, and stderr becomes Claude's feedback. hooks → Exit code 2

The user wants this shared with the team, so it goes in .claude/settings.json, the project-scoped file that can be committed. hooks-guide → Configure hook location

Path via "$CLAUDE_PROJECT_DIR" so it resolves on every teammate's machine, and the script must be executable. hooks-guide → Register the hook

PreToolUse hooks fire before any permission-mode check, in every mode including bypassPermissions, so a blocking hook is policy users can't switch off. Worth telling the user. hooks-guide → Hooks and permission modes

write.claude/hooks/protect-files.sh
#!/bin/bash INPUT=$(cat) FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty') FILE_PATH="${FILE_PATH//\\//}" # normalise Windows separators, as the guide does PROTECTED_PATTERNS=(".env" "package-lock.json" ".git/") for pattern in "${PROTECTED_PATTERNS[@]}"; do if [[ "$FILE_PATH" == *"$pattern"* ]]; then echo "Blocked: $FILE_PATH matches protected pattern '$pattern'" >&2 exit 2 # exit 2 = block; stderr becomes Claude's feedback fi done exit 0
bashchmod +x .claude/hooks/protect-files.sh
edit.claude/settings.json
+ "hooks": { + "PreToolUse": [{ + "matcher": "Edit|Write", + "hooks": [{ + "type": "command", + "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/protect-files.sh" + }] + }] + }
testEdit .env · add a comment, as the guide's test step suggests
PreToolUseprotect-files.sh → stderr: Blocked: .env matches protected pattern '.env' · exit 2
blockedEdit never ran. Hook works.
Done. The hook lives in .claude/settings.json so it ships with the repo. It blocks edits to .env, package-lock.json, and anything under .git/. PreToolUse hooks run in every permission mode, so this is policy, not a suggestion. Add more patterns in .claude/hooks/protect-files.sh.

Grounding trace

  • Index searched in shellsearch_index.json · no LLM tokens spent
  • Automate actions with hookscode.claude.com/docs/en/hooks-guide · live copy
  • Hooks referencecode.claude.com/docs/en/hooks · live copy

Facts pulled from the pages

  • PreToolUse + matcher Edit|Write
  • Exit 2 blocks. Exit 1 does not.
  • Project scope → .claude/settings.json
  • $CLAUDE_PROJECT_DIR path + chmod +x
  • Runs in every permission mode

Context cost

0pages read
0web searches
0guesses

Without the plugin

Claude answers from training data. The likely slip here is exit 1, the conventional failure code. The reference states that exit 1 is treated as a non-blocking error and the edit proceeds. The hook would look right and silently do nothing.

What you get

Answers that cite the docs, not vibes.

On your first session after install, Claude clones the metadata, warms the page cache in the background, and activates the skills. That's the whole setup.

the one you'll forget is on

Auto-discovery

Ask anything about Claude Code, the API, SDKs, or prompting. Claude reads the relevant docs before answering. No prefix, no command. Your answers are just correct.

/docs skill

Explicit lookups when you want them: /docs hooks, /docs extended thinking, /docs Agent SDK sessions. Plain-English questions work too.

unique

Interactive courses

/docs --course hooks turns any topic into a self-contained animated HTML course: protocol diagrams, quizzes, line-by-line code translations. One file, opens in your browser.

Changelog reports

/docs --report 7d gives a visual HTML report of every added, changed, and removed page, grouped by category, each with a one-click "Create Course" button.

Token-efficient by design

Search runs in shell against a prose-free index. Claude's context only ever pays for the specific pages it reads, never for the search itself.

Session-start auto-updates

Metadata syncs and changed pages re-fetch in the background every session. No cron jobs, no manual pulls. /docs -t checks freshness; /docs sync forces it.

Coverage

Both sites. Every page.

Discovery is the union of two llms.txt files and two sitemaps, keyed by canonical URL. The numbers below come from the live manifest served next to this page.

Claude API387 pages
Claude Code CLI177 pages
Claude Documentation157 pages
Agents & Tools42 pages
Claude Agent SDK32 pages
Release Notes21 pages
About Claude14 pages
Testing & Evaluation7 pages
Getting Started1 page
Resources1 page
platform.claude.com/llms.txtplatform.claude.com/sitemap.xmlcode.claude.com/docs/llms.txtcode.claude.com/docs/sitemap.xml

Usage

Or just ask.

With the plugin installed you don't need /docs at all. Claude recognizes a documentation question and reads the relevant docs before answering. The command is there when you want control.

› /docs hooks              # Claude Code hooks
› /docs mcp                # MCP server configuration
› /docs agent sdk python   # Agent SDK Python guide
› /docs what's new         # added / changed / removed pages

Reading code.claude.com/docs/en/hooks …
✓ Answer grounded in 1 page, with source link.
› /docs what are the best practices for Agent SDK in Python?
› /docs explain the differences between hooks and MCP
› /docs how do I configure extended thinking for the API?
› /docs show me all Agent SDK pages

Claude finds the right docs, reads them, and synthesizes
a clear answer with source links.
› /docs --course hooks           # interactive HTML course
› /docs --course tool use        # deep dive into the Tool Use API
› /docs --course prompt caching  # master caching, visually

› /docs --report                 # last 7 days of doc changes
› /docs --report 24h             # last 24 hours
› /docs --report 30d             # last 30 days

✓ Saved to ~/.claude-code-docs/courses/
› /docs -t                 # check freshness, read-only
› /docs sync               # fetch changed pages now

Manifest:  up to date  (re-indexed upstream every 3 hours)
Cache:     839 / 839  pages fetched ok
Stale:     0

Teams

Roll it out to everyone.

Commit this to your project's .claude/settings.json. When a teammate trusts the folder, Claude Code prompts them to install the marketplace and plugin. No manual setup.

{
  "extraKnownMarketplaces": {
    "claude-code-docs": {
      "source": {
        "source": "github",
        "repo": "costiash/claude-code-docs"
      }
    }
  },
  "enabledPlugins": {
    "claude-docs@claude-code-docs": true
  }
}

Safety

Fail-closed at every layer.

A bad upstream day can delay an update. It cannot corrupt your docs. These guards exist because a broken sitemap once tried to delete most of the documentation in a single sync.

Discovery floorToo few pages found means a broken source, never "these pages are gone". The run aborts before anything is written.
Removal ceilingA manifest transition that drops too large a share of live pages is refused instead of committed.
Carry-forwardA page that fails to fetch stays in the manifest marked stale. A transient error never drops a page.
Independent CI re-checkEvery rule is re-run as a jq check before commit, pinned to the Python constants by tests. Bypassing one layer is not enough.
Hardened clientDomain allowlist, HTTPS-only with no redirects, atomic writes, sha256 integrity checks, path-traversal protection. 230+ automated tests on Linux and macOS.

Two commands. Correct answers.

Install takes seconds. Uninstall is one command too: /plugin uninstall claude-docs@claude-code-docs.