Set Up Claude Code Docs for Offline Use (2026)
The Claude Code Docs project mirrors official Anthropic documentation into a local repository. Set it up once and you have offline documentation that auto-updates when you are online.
Prerequisites
- Git installed (
git --version) - Internet connection for initial setup
- Claude Code installed (to use the docs as context)
Step 1: Clone the Repository
git clone https://github.com/ericbuess/claude-code-docs.git ~/claude-code-docs
This pulls the full mirror of official Claude Code documentation to your local machine. The repository is small (mostly markdown) so the clone completes quickly.
Step 2: Verify the Contents
ls ~/claude-code-docs/
You should see markdown files organized by topic: configuration, hooks, tools, commands, MCP, and more. The structure mirrors the official documentation site.
Step 3: Set Up Auto-Update
The repo includes a hook mechanism for automatic updates. Set up a periodic pull:
cd ~/claude-code-docs
git pull --rebase
For automatic updates, add a cron job or launchd plist:
On macOS (launchd):
cat > ~/Library/LaunchAgents/com.claude-docs.update.plist << 'PLIST'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.claude-docs.update</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/git</string>
<string>-C</string>
<string>/Users/you/claude-code-docs</string>
<string>pull</string>
<string>--rebase</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>9</integer>
</dict>
</dict>
</plist>
PLIST
launchctl load ~/Library/LaunchAgents/com.claude-docs.update.plist
On Linux (cron):
echo "0 9 * * * cd ~/claude-code-docs && git pull --rebase" | crontab -
Step 4: Use With Claude Code
Reference the local docs in your Claude Code sessions. You can either symlink into your project:
ln -s ~/claude-code-docs .claude-docs
Or reference directly when asking Claude questions:
Read the file at ~/claude-code-docs/hooks.md and explain how pre-command hooks work
Step 5: Verify Offline Access
Disconnect from the internet and confirm you can still read the docs:
cat ~/claude-code-docs/README.md
If the file renders, your offline setup is complete.
Step 6: Feed Docs to Claude as Context
One powerful use is having Claude reference its own documentation during sessions. Add the docs directory to your project-level context:
# Add to your CLAUDE.md
echo "Reference ~/claude-code-docs/ for official documentation when answering questions about Claude Code features, hooks, or configuration." >> CLAUDE.md
You can also create a slash command that makes Claude read specific doc sections:
Create .claude/commands/lookup-docs.md:
Read the relevant files in ~/claude-code-docs/ to answer this question about Claude Code:
$ARGUMENTS
Cite the specific documentation section in your answer.
Now /lookup-docs how do hooks work gives you documentation-backed answers without opening a browser.
Step 7: Organize for Quick Access
Create a local index file for faster navigation:
cd ~/claude-code-docs
find . -name "*.md" -type f | sort > INDEX.txt
For frequent topics, create symlinks in your project:
# Symlink the sections you reference most
ln -s ~/claude-code-docs/hooks.md .claude/ref-hooks.md
ln -s ~/claude-code-docs/mcp.md .claude/ref-mcp.md
ln -s ~/claude-code-docs/configuration.md .claude/ref-config.md
When Offline Access Matters
The offline setup pays off in several scenarios beyond obvious ones:
Air-gapped environments: Some enterprise development happens on machines without internet access. The local mirror ensures documentation availability.
Slow connections: Hotel WiFi, mobile tethering, or congested office networks make online docs painfully slow. Local files render instantly.
CI/CD pipelines: If your CI pipeline needs to reference Claude Code documentation for automated checks or validations, a local mirror avoids network dependencies.
Focus sessions: Some developers disconnect intentionally during deep work. Local docs mean they can still reference material without breaking focus.
Troubleshooting
Clone fails: Check your internet connection and GitHub access. Try git clone with HTTPS if SSH is blocked. If behind a corporate proxy, configure git proxy settings.
Auto-update fails silently: Check the launchd or cron logs. Common issue: the git path differs on your system — use which git to find the correct path. On macOS, also check that the plist has the correct home directory path.
Docs seem outdated: Run git -C ~/claude-code-docs log -1 to see when the last update happened. If it is old, run a manual pull. The mirror syncs with Anthropic’s documentation releases, which typically happen with major Claude Code updates.
Disk space concerns: The documentation repo is lightweight — typically under 50MB. It should not impact disk space on any modern system.
Merge conflicts during auto-pull: If you have accidentally modified local files, the rebase will fail. Reset with git -C ~/claude-code-docs checkout . and then pull again.
Next Steps
- Compare this with Claude Howto for different learning approaches
- Explore the Claude Code playbook for workflow patterns
- Set up MCP servers using the configuration docs
See Also
Configure MCP → Build your server config with our MCP Config Generator.
Try it: Paste your error into our Error Diagnostic for an instant fix.