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.
/plugin marketplace add costiash/claude-code-docs/plugin install claude-docs@claude-code-docsNo Python. No MCP server. No API keys. The client is pure bash + curl + jq.
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.
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.
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.
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.
| Web search | Docs mirrors | MCP docs servers | This plugin | |
|---|---|---|---|---|
| Freshness | Search-engine lag | Stale between syncs | Usually current | Live page, every read |
| Claude docs coverage | Hit-or-miss | Often partial | Generic libraries | Every page, both sites |
| Runtime dependencies | None | git + disk | MCP server + config | bash, curl, jq |
| Context cost per answer | Whole pages of noise | Full file reads | Large tool payloads | Index hit → one targeted page |
| Redistributes Anthropic's docs | No | Yes, wholesale | Varies | Never. 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.
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
.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_DIRpath +chmod +x- Runs in every permission mode
Context cost
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.
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.
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.
Try it
Search the real index. Right here.
This is the same search index the plugin ships, loaded into your browser and searched with plain JavaScript. Every result links to the official page.
- Start typing. The index loads on first keystroke.
What you're looking at
The plugin commits two files. A manifest maps every page to its official URL, category, and content hash. A search index holds each page's title, headings, and a lossy bag of stemmed terms with counts.
- Lossy on purpose. You cannot rebuild a page from the index. That is what makes it safe to commit.
- Same data, different engine. Inside Claude Code the search runs in shell with
jq. Here it runs in your browser. The hits come from identical files. - Every result is a real link. Click one and you land on Anthropic's page, not a copy.
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.
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.
jq check before commit, pinned to the Python constants by tests. Bypassing one layer is not enough.Two commands. Correct answers.
Install takes seconds. Uninstall is one command too: /plugin uninstall claude-docs@claude-code-docs.