Local mirror of Claude Code documentation files from https://docs.anthropic.com/en/docs/claude-code/, updated every 3 hours.
- Faster than web fetching - Read from local files instantly
- Works offline - No internet required after cloning
- Always up-to-date - Auto-updates every 3 hours via GitHub Actions
This tool requires the following to be installed:
- git - For cloning and updating the repository
- jq - For JSON processing in the auto-update hook
- curl - For downloading the installation script
- Claude Code - Obviously :)
Platform Support: Currently macOS only. Linux support contributions welcome!
Run this single command from wherever you want to store the docs:
curl -fsSL https://raw.githubusercontent.com/shaneholloman/claude-code-docs/main/install.sh | bashThis will:
- Clone the repository (or use existing if found)
- Create the
/user:docsslash command - Set up automatic git pull when reading docs
Note: The command is /user:docs (not /docs). If you have a different docs command from another installation, both will coexist.
The /user:docs command provides instant access to documentation with optional freshness checking.
/user:docs hooks # Instantly read hooks documentation
/user:docs mcp # Instantly read MCP documentation
/user:docs memory # Instantly read memory documentationYou'll see: Reading from local docs (run /user:docs -t to check freshness)
/user:docs -t # Show when docs were last updated
/user:docs -t hooks # Check freshness, then read hooks docs
/user:docs -t mcp # Check freshness, then read MCP docsThe -t flag shows:
- When GitHub last updated the docs
- When your local copy last synced
- Triggers a sync if it's been 3+ hours
# Natural language queries work great
/user:docs what environment variables exist and how do I use them?
/user:docs explain the differences between hooks and MCP
# Check for recent changes
/user:docs -t what's new in the latest documentation?
# Search across all docs
/user:docs find all mentions of authentication
/user:docs how do I customize Claude Code's behavior?- Default mode: Zero overhead - reads docs instantly
- With -t flag: Checks timestamps and syncs if needed (only every 3 hours)
- Error handling: If docs are missing, you'll see instructions to reinstall
The docs automatically stay up-to-date:
- GitHub Actions updates the repository every 3 hours
- The hook compares GitHub's timestamp with your local sync time
- If GitHub has newer content, it automatically syncs before reading
- You'll see "🔄 Updating docs to latest version..." when this happens
- No manual updates needed!
Performance:
/user:docsreads instantly and the hook ensures content is always current/user:docs -tshows you exact timestamps of GitHub updates vs local sync
If /user:docs returns "command not found":
- Check if the command file exists:
ls ~/.claude/commands/docs.md - Restart Claude Code to reload commands
- Re-run the installation script
If documentation seems outdated:
- Run
/user:docs -tto check sync status and force an update - Manually update:
cd /path/to/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
If docs aren't auto-updating:
- Check your Claude settings:
cat ~/.claude/settings.json | jq .hooks - Look for error messages when using
/user:docs - Re-run the installer to reset the hook
To completely remove the docs integration:
-
Remove the command file:
rm ~/.claude/commands/docs.md -
Remove the auto-update hook:
- Run
/hooksin Claude Code - Find "PreToolUse - Matcher: Read"
- Select the hook and remove it
- Run
-
Delete the repository:
rm -rf /path/to/claude-code-docs
- The installer modifies
~/.claude/settings.jsonto add an auto-update hook - The hook only runs
git pullwhen reading documentation files - 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
Documentation content belongs to Anthropic.