This fork preserves a fail-closed mirror of the 11 Korean documents used by krnomad/claude-code-knowledge-map. The fixed allowlist lives in
config/documents.yaml; verified output and its SHA-256 manifest live indocs/ko/. Mirroring code remains under the upstream MIT license. Documentation content remains copyright Anthropic.
English | 한국어
Local mirror of Claude Code documentation files from https://code.claude.com/docs/en/, updated every 3 hours.
This fork exists to make Claude Code usable where code.claude.com and other Anthropic documentation hosts are unreachable - corporate proxies, air-gapped networks, and egress-filtered CI environments.
Without it, asking Claude a question about Claude Code fails in a specific way: the built-in claude-code-guide subagent, which Claude delegates those questions to, tries to WebFetch the official docs, gets a network error, and answers from memory or not at all. A local copy of the docs does not fix this on its own, because nothing tells the agent the copy exists.
So this fork mirrors the documentation and wires Claude to it:
- Fetches are redirected. A
PreToolUsehook onWebFetchintercepts everycode.claude.comURL, resolves it to the mirrored file, and denies the fetch while naming that file - so Claude reads it instead of failing. - Subagents are told the mirror exists. A
SubagentStarthook injects the mirror's location, page count and file-naming convention intoclaude-code-guidebefore it runs, so it searches local paths and never reaches for the network.
Both are installed automatically. See Offline and Restricted Networks for the details, and Security Notes for exactly what gets written to your settings.
This is an early beta release. There may be errors or unexpected behavior. If you encounter any issues, please open an issue - your feedback helps improve the tool!
New in this version:
- 📋 Claude Code Changelog: Access the official Claude Code release notes with
/claude-docs changelog - 🍎 Full macOS compatibility: Fixed shell compatibility issues for Mac users
- 🐧 Linux support: Tested on Ubuntu, Debian, and other distributions
- 🔧 Improved installer: Better handling of updates and edge cases
To update:
curl -fsSL https://raw.githubusercontent.com/posimind/claude-code-docs/main/install.sh | bash- Works without access to Anthropic - The docs stay available when
code.claude.comis blocked, and Claude is pointed at them automatically - Faster access - Reads from local files instead of fetching from web
- Automatic updates - Attempts to stay current with the latest documentation
- Track changes - See what changed in docs over time
- Claude Code changelog - Quick access to official release notes and version history
- Better Claude Code integration - Allows Claude to explore documentation more effectively
- ✅ macOS: Fully supported (tested on macOS 12+)
- ✅ Linux: Fully supported (Ubuntu, Debian, Fedora, etc.)
- ⏳ Windows: Not yet supported - contributions welcome!
This tool requires the following to be installed:
- git - For cloning and updating the repository (usually pre-installed)
- jq - For JSON processing in the auto-update hook (pre-installed on macOS; Linux users may need
apt install jqoryum install jq) - curl - For downloading the installation script (usually pre-installed)
- Claude Code - Obviously :)
Run this single command:
curl -fsSL https://raw.githubusercontent.com/posimind/claude-code-docs/main/install.sh | bashThis will:
-
Install to
~/.claude-code-docs(or migrate existing installation) -
Create the
/claude-docsslash command to pass arguments to the tool and tell it where to find the docs (rename it withCLAUDE_DOCS_COMMAND_NAME- see Customize command name) -
Set up three hooks in
~/.claude/settings.json, all calling the same helper script:PreToolUseonRead- pulls the latest docs when Claude reads from~/.claude-code-docsPreToolUseonWebFetch- redirectscode.claude.comfetches to the mirrored fileSubagentStartonclaude-code-guide- tells that subagent where the mirror is
Hooks you added yourself are left untouched. See Offline and Restricted Networks.
Note: Hooks are loaded when a session starts, so restart Claude Code after installing.
Note: The command is /claude-docs (user) - it will show in your command list with "(user)" after it to indicate it's a user-created command.
There are two ways to reach the docs, and since the hooks were added the first one covers most cases.
The hooks work on ordinary questions. Ask about Claude Code in plain language and the mirror is used automatically:
How do I configure a PreToolUse hook?
What's the difference between hooks and MCP?
Can a subagent run in the background?
When Claude hands the question to the claude-code-guide subagent, that agent starts out knowing where the mirror is and reads local files. If anything tries to fetch code.claude.com - the subagent or the main conversation - the fetch is turned into a local read. You don't have to remember a command, and it works on a blocked network.
One caveat: if Claude decides it already knows the answer and never looks anything up, no hook fires, because there is no fetch and no subagent to steer. When you want the documentation consulted for certain, use the command below.
The command is still the way to pull up a specific page verbatim, check how fresh the mirror is, or see what changed:
/claude-docs hooks # Instantly read hooks documentation
/claude-docs mcp # Instantly read MCP documentation
/claude-docs memory # Instantly read memory documentationYou'll see: 📚 Reading from local docs (run /claude-docs -t to check freshness)
/claude-docs -t # Show sync status with GitHub
/claude-docs -t hooks # Check sync status, then read hooks docs
/claude-docs -t mcp # Check sync status, then read MCP docs/claude-docs what's new # Show recent documentation changes with diffs/claude-docs changelog # Read official Claude Code release notes and version historyThe changelog feature fetches the latest release notes directly from the official Claude Code repository, showing you what's new in each version.
/claude-docs uninstall # Get commnd to remove claude-code-docs completely| You want | Do this |
|---|---|
| An answer to a Claude Code question | Just ask - the hooks route it to the mirror |
| A specific page, in full | /claude-docs hooks |
| To be sure the docs were actually consulted | /claude-docs <topic> or /claude-docs <question> |
| To know how current the mirror is | /claude-docs -t |
| Recent documentation changes | /claude-docs what's new |
| Release notes | /claude-docs changelog |
The command also takes natural language, which is useful when you want the lookup forced rather than left to Claude's judgment:
/claude-docs what environment variables exist and how do I use them?
/claude-docs explain the differences between hooks and MCP
/claude-docs find all mentions of authenticationThe default command is /claude-docs. To use a different name, set CLAUDE_DOCS_COMMAND_NAME when running the installer:
curl -fsSL https://raw.githubusercontent.com/posimind/claude-code-docs/main/install.sh -o /tmp/install.sh
CLAUDE_DOCS_COMMAND_NAME=cdocs bash /tmp/install.sh
# Now use /cdocs
/cdocs hooks
/cdocs mcpYou can use any name made of letters, digits, hyphens and underscores: cdocs, claude-code-docs, etc. The name is used for the command file (~/.claude/commands/<name>.md) and inside the help text the helper script prints.
The installer records the chosen name in ~/.claude-code-docs/.command_name, so the uninstaller removes the right command file without you having to set the variable again.
Renaming the command does not affect the hooks - they are keyed to the helper script's path, not to the command name.
The documentation attempts to stay current:
- GitHub Actions runs periodically to fetch new documentation
- When you use
/claude-docs, it checks for updates - Updates are pulled when available
- You may see "🔄 Updating documentation..." when this happens
Note: If automatic updates fail, you can always run the installer again to get the latest version.
Two hooks keep Claude on the mirror when the official docs are unreachable. Both run the installed helper script and are registered by the installer.
A PreToolUse hook on WebFetch intercepts any code.claude.com URL, resolves it against docs_manifest.json, and denies the fetch with the matching local path as the reason Claude sees:
WebFetch https://code.claude.com/docs/en/agent-sdk/python
-> denied: "This page is mirrored locally and code.claude.com is not
reachable from this network. Read
~/.claude-code-docs/docs/agent-sdk__python.md instead."
Nested pages flatten their path with a double underscore (/docs/en/agent-sdk/python becomes agent-sdk__python.md), and anchors, query strings and a trailing .md are all stripped before the lookup. URLs on other hosts pass through untouched. If a page is not mirrored, the hook still denies the fetch, but points at ls and grep over the mirror instead of a specific file.
claude-code-guide is the built-in subagent Claude delegates Claude Code questions to. Left alone it reaches for WebFetch first, which fails on a restricted network.
A SubagentStart hook matched to that agent injects the mirror into its context before it takes its first action, telling it:
- where the mirror lives and how many pages it has
- to answer from local files, because
code.claude.comis not reachable - how to find a page -
Read <topic>.md, orgrep -ril '<keyword>'across the mirror - that nested pages flatten their path with a double underscore
- that
docs_manifest.jsonmaps every file back to its original URL, which it should cite without fetching
The result is that the agent searches local paths from the start rather than discovering the network is blocked and working around it.
To cover another agent, add its name to the SubagentStart matcher in ~/.claude/settings.json - the matcher is a regex, so claude-code-guide|my-docs-agent works.
Hooks load when a session starts, so restart Claude Code after installing. You can run either hook by hand without restarting:
# Should print a deny decision naming the local file
echo '{"tool_input":{"url":"https://code.claude.com/docs/en/hooks"}}' \
| ~/.claude-code-docs/claude-docs-helper.sh webfetch-guard
# Should print the context injected into the subagent
echo '{"agent_type":"claude-code-guide"}' \
| ~/.claude-code-docs/claude-docs-helper.sh subagent-contextBoth hooks are worth keeping even with the network up, since a local read beats a fetch.
Regardless of which version you have installed, simply run:
curl -fsSL https://raw.githubusercontent.com/posimind/claude-code-docs/main/install.sh | bashThe installer will handle migration and updates automatically.
If /claude-docs returns "command not found":
- Check if the command file exists:
ls ~/.claude/commands/claude-docs.md - Restart Claude Code to reload commands
- Re-run the installation script
If a question about Claude Code still results in a failed WebFetch:
- Restart Claude Code - hooks are loaded when a session starts
- Check the hooks are registered:
You should see
jq '.hooks | to_entries[] | .key as $e | .value[] | select((.hooks[0].command // "") | contains("claude-code-docs")) | "\($e) [\(.matcher)]"' ~/.claude/settings.json
PreToolUse [Read],PreToolUse [WebFetch]andSubagentStart [claude-code-guide] - Run the hook by hand to confirm the helper works - see Checking that it works
- If Claude answered without looking anything up, no hook fires by design. Ask again with
/claude-docsto force the lookup
If documentation seems outdated:
- Run
/claude-docs -tto check sync status and force an update - Manually update:
cd ~/.claude-code-docs && git pull - Check if GitHub Actions are running: View Actions
- "git/jq/curl not found": Install the missing tool first
- "Failed to clone repository": Check your internet connection
- "Failed to update settings.json": Check file permissions on
~/.claude/settings.json
To completely remove the docs integration:
/claude-docs uninstallOr run:
~/.claude-code-docs/uninstall.shSee UNINSTALL.md for manual uninstall instructions.
- The installer modifies
~/.claude/settings.jsonto add three hooks, all of which run the same helper script in~/.claude-code-docs:PreToolUseonRead- runsgit pullwhen reading documentation filesPreToolUseonWebFetch- deniescode.claude.comfetches and names the local file instead; other hosts are ignoredSubagentStartonclaude-code-guide- injects the mirror's location into that subagent's context
- Hooks from previous installs are removed on install and on uninstall, matched by
claude-code-docsappearing in the command; hooks you added yourself are left alone - All operations are limited to the documentation directory
- No data is sent externally - everything is local
- Repository Trust: The installer clones from GitHub over HTTPS. For additional security, you can:
- Fork the repository and install from your own fork
- Clone manually and run the installer from the local directory
- Review all code before installation
- Added Claude Code changelog integration (
/claude-docs changelog) - Fixed shell compatibility for macOS users (zsh/bash)
- Improved documentation and error messages
- Added platform compatibility badges
- Fixed automatic update functionality
- Improved handling of local repository changes
- Better error recovery during updates
Contributions are welcome! This is a community project and we'd love your help:
- 🪟 Windows Support: Want to help add Windows compatibility? Fork the repository and submit a PR!
- 🐛 Bug Reports: Found something not working? Open an issue
- 💡 Feature Requests: Have an idea? Start a discussion
- 📝 Documentation: Help improve docs or add examples
You can also use Claude Code itself to help build features - just fork the repo and let Claude assist you!
As this is an early beta, you might encounter some issues:
- Auto-updates may occasionally fail on some network configurations
- Some documentation links might not resolve correctly
If you find any issues not listed here, please report them!
Documentation content belongs to Anthropic. This mirror tool is open source - contributions welcome!
This repository is a fork of ericbuess/claude-code-docs, the original Claude Code documentation mirror. All credit for the mirror, the sync workflow and the /docs helper goes to that project and its contributors.
The fork was created to serve networks where Anthropic's documentation hosts are blocked. What changed here:
- Offline hooks - a
PreToolUsehook onWebFetchthat redirectscode.claude.comfetches to the mirrored file, and aSubagentStarthook that tells theclaude-code-guidesubagent to search the mirror instead of the network. This is the reason the fork exists. - Retargeted to this fork - the installer, uninstaller, helper script and docs now clone and pull from
posimind/claude-code-docs, so an installed copy tracks this repository rather than upstream. - Refreshed documentation URLs - updated for Anthropic's move from
docs.anthropic.com/en/docs/claude-codetocode.claude.com/docs/en, including a sitemap-failure fallback infetch_claude_docs.pythat had been pairing the old base URL with new-style page paths. - Renamed slash command -
/docsbecame/claude-docsto avoid colliding with other tooling, and the name is now configurable throughCLAUDE_DOCS_COMMAND_NAME. - Installer and uninstaller fixes - the uninstaller could never remove
~/.claude-code-docs, because its path pattern did not match a directory whose name starts with a dot; and the installer treated the directory it was launched from as an old installation and deleted it, which destroyed a clean clone of the repo when you ran the installer from inside one.
Upstream continues to be the place for the mirror itself. Issues specific to the offline hooks or to this fork's packaging belong here.