Skip to content

Comprehensive Claude Code documentation tool, full-text search, and validation. Solves the "information about new feature releases" problem. Built on ericbuess/claude-code-docs.

License

Notifications You must be signed in to change notification settings

costiash/claude-code-docs

 
 

Repository files navigation

Claude Code Documentation Tool

Last Update Tests Coverage Python Platform Mentioned in Awesome Claude Code

⭐ This is an enhanced fork of ericbuess/claude-code-docs

Built on Eric Buess's excellent foundation, this fork adds Python-powered search, validation, and auto-regeneration features while maintaining graceful degradation - everything works with or without Python.

For the original, simpler implementation: ericbuess/claude-code-docs


Fast, searchable access to Claude Code documentation - locally, always up-to-date.

Stop hunting through scattered docs. This tool provides instant access to 270 actively maintained Claude documentation paths covering API references, guides, examples, and changelogs.

Key Features

  • 🤖 AI-Powered Search - Ask questions naturally, Claude understands intent and routes intelligently
  • 📚 Complete Coverage - 270 active documentation paths, 268 files (~99% coverage)
  • 🔍 Semantic Understanding - No primitive keyword matching, leverages Claude's language understanding
  • Auto-Validated - Continuous validation detects broken links automatically
  • 🔄 Always Fresh - Auto-updates every 3 hours from official sources
  • 🎯 Graceful Degradation - Works with or without Python
  • 🧪 Well-Tested - 600 tests (99.7% pass rate), 78% coverage

What's Included

Documentation Files (268 total):

  • Core Documentation (79 paths, 29%) - Guides, tutorials, best practices
  • API Reference (78 paths, 29%) - Complete API docs, Admin API, Agent SDK
  • Prompt Library (65 paths, 24%) - Ready-to-use prompt templates
  • Claude Code (44 paths, 16%) - CLI-specific docs, hooks, skills, MCP
  • Release Notes (2 paths) - Version history
  • Resources (1 path) - Additional resources
  • Uncategorized (1 path) - Home page

Python Features (optional, requires Python 3.9+):

  • Full-text search across all content
  • Fuzzy path matching
  • HTTP validation
  • Auto-regeneration of manifests

Installation

Quick Install (2 minutes)

One command:

curl -fsSL https://raw.githubusercontent.com/costiash/claude-code-docs/main/install.sh | bash

What it does:

  1. Clones repository to ~/.claude-code-docs
  2. Installs 268 documentation files
  3. Sets up /docs command in Claude Code
  4. Enables auto-updates

Python features activate automatically if Python 3.9+ is installed.

Installation Methods

Method 1: Direct Install (interactive)

curl -fsSL https://raw.githubusercontent.com/costiash/claude-code-docs/main/install.sh | bash

Works on: Local terminals, iTerm2, Terminal.app, SSH with -t flag

Method 2: Auto-Install (CI/CD-friendly)

CLAUDE_DOCS_AUTO_INSTALL=yes curl -fsSL https://raw.githubusercontent.com/costiash/claude-code-docs/main/install.sh | bash

Works on: All environments including GitHub Actions, Docker, cron jobs, SSH without -t

Method 3: Download First (most reliable)

curl -fsSL https://raw.githubusercontent.com/costiash/claude-code-docs/main/install.sh -o install.sh
bash install.sh

Works on: All interactive shells

Requirements

  • Required: macOS 12+ or Linux (Ubuntu, Debian, Fedora, etc.)
  • Required: git, jq, curl (usually pre-installed)
  • Optional: Python 3.9+ (enables search/validation features)

Usage

Basic Commands

Quick access (no freshness check):

/docs hooks        # Read hooks documentation instantly
/docs mcp          # Read MCP documentation
/docs memory       # Read memory features

With freshness check:

/docs -t           # Check sync status with GitHub
/docs -t hooks     # Check sync, then read hooks docs

Special commands:

/docs what's new   # Show recent documentation changes with diffs
/docs changelog    # Read official Claude Code release notes
/docs uninstall    # Get uninstall command

AI-Powered Natural Language Queries

The /docs command is AI-powered - it leverages Claude's semantic understanding instead of primitive keyword matching. Ask questions naturally and Claude will intelligently route to the appropriate search functions.

How it works:

  1. Claude analyzes your request semantically
  2. Determines if you want direct documentation, content search, or path discovery
  3. Routes to appropriate helper functions automatically
  4. Presents results naturally with context

Examples:

# Complex semantic queries
/docs what are the best practices and recommended workflows using Claude Agent SDK in Python according to the official documentation?
→ Claude extracts: "best practices workflows Agent SDK Python"
→ Executes content search automatically
→ Returns relevant documentation with natural explanations

# Questions about features
/docs what environment variables exist and how do I use them?
→ Claude searches documentation content
→ Provides answer with documentation links

# Comparative questions
/docs explain the differences between hooks and MCP
→ Claude searches for both topics
→ Compares and explains naturally

# Discovery queries
/docs show me everything about memory features
→ Claude finds memory-related documentation
→ Lists and summarizes available docs

# Topic-specific searches
/docs find all mentions of authentication
→ Claude performs content search
→ Returns matching documentation sections

# Combined workflows
/docs -t what's new with extended thinking and how does it work?
→ Claude checks for updates
→ Searches for extended thinking documentation
→ Combines recent changes with explanation

Behind the scenes: When Python 3.9+ is available, the AI routes to:

  • --search-content for semantic information searches
  • --search for path discovery
  • Direct lookups for specific topics

Without Python 3.9+: The AI gracefully explains limitations and suggests available alternatives.

Advanced Commands (Direct Access)

For power users who want direct access to helper functions:

# Fuzzy search across 270 paths (requires Python 3.9+)
~/.claude-code-docs/claude-docs-helper.sh --search "keyword"

# Full-text content search (requires Python 3.9+)
~/.claude-code-docs/claude-docs-helper.sh --search-content "term"

# Validate all paths - check for 404s (requires Python 3.9+)
~/.claude-code-docs/claude-docs-helper.sh --validate

# Show installation status and available features
~/.claude-code-docs/claude-docs-helper.sh --status

# Show all commands
~/.claude-code-docs/claude-docs-helper.sh --help

Note: Most users should use the AI-powered /docs command instead of calling these directly. The AI provides better results through semantic understanding and intelligent routing.

Architecture

Single Installation - Always installs complete repository:

  • 268 documentation files (.md format)
  • 7 Python scripts for enhanced features
  • 270 active paths tracked in manifest
  • Full test suite (600 tests)

Graceful Degradation - Features adapt to environment:

  • Without Python: Basic documentation reading via /docs command
  • With Python 3.9+: Full-text search, fuzzy matching, validation, auto-regeneration

No separate "modes" - Everything is installed once, features activate when Python is available.

How Updates Work

Documentation stays current through:

  1. Automated Updates - GitHub Actions fetches new docs every 3 hours
  2. Pre-Command Check - /docs checks for GitHub updates automatically
  3. Auto-Regeneration - Manifests regenerate from sitemaps on each fetch
  4. Visual Feedback - See "🔄 Updating documentation..." when updates occur

Manual update:

cd ~/.claude-code-docs && git pull

Force reinstall:

curl -fsSL https://raw.githubusercontent.com/costiash/claude-code-docs/main/install.sh | bash

Troubleshooting

Command Not Found

Problem: /docs returns "command not found"

Solution:

  1. Check: ls ~/.claude/commands/docs.md
  2. Restart Claude Code
  3. Re-run installer if needed

Installation Errors

"Installation cancelled" when using curl | bash:

The installer needs to read your response, but stdin is consumed by the pipe in some environments.

Solutions:

  1. Auto-install: CLAUDE_DOCS_AUTO_INSTALL=yes curl ... | bash
  2. Download first: curl ... -o install.sh && bash install.sh
  3. SSH with -t: ssh -t user@server 'curl ... | bash'

"Running in non-interactive mode":

This appears in CI/CD, Docker, cron, or SSH without -t. Use CLAUDE_DOCS_AUTO_INSTALL=yes.

Other issues:

  • "git/jq/curl not found": Install the missing tool
  • "Failed to clone": Check internet connection
  • "Failed to update settings.json": Check file permissions

Documentation Not Updating

Problem: Documentation seems outdated

Solution:

  1. /docs -t to force check and update
  2. Manual: cd ~/.claude-code-docs && git pull
  3. Check GitHub Actions
  4. Reinstall as last resort

Which Version?

Check your installation:

~/.claude-code-docs/claude-docs-helper.sh --version

Or:

cat ~/.claude-code-docs/README.md | head -1

Platform Support

  • macOS: Fully supported (tested on macOS 12+)
  • Linux: Fully supported (Ubuntu, Debian, Fedora, etc.)
  • Windows: Not yet supported - contributions welcome!

Uninstalling

Complete removal:

/docs uninstall

Or manually:

~/.claude-code-docs/uninstall.sh

See UNINSTALL.md for manual removal instructions.

Security

Defense-in-Depth Approach:

  • Input sanitization (alphanumeric + safe chars only)
  • Path traversal protection (prevents ../ attacks)
  • Shell injection prevention (heredocs, env vars)
  • Comprehensive security testing (13 test cases)

Operational Security:

  • All operations limited to documentation directory
  • No external data transmission
  • HTTPS-only GitHub clones
  • You can fork and install from your own repository

Validation:

  • 598/600 tests passing (99.7% pass rate)
  • 78% code coverage
  • Automated security testing in CI/CD

Contributing

Contributions are welcome! See CONTRIBUTING.md for:

  • Architecture overview
  • Development setup
  • Testing requirements
  • PR guidelines
  • Security standards

Quick start for contributors:

# Fork the repository
git clone https://github.com/YOUR_USERNAME/claude-code-docs.git
cd claude-code-docs

# Setup Python environment (optional, for enhanced features)
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

# Run tests
pytest tests/ -v  # Should see: 598 passed, 2 skipped

# Test coverage
pytest --cov=scripts --cov-report=term  # Should see: ~78%

Acknowledgments

The original ericbuess/claude-code-docs provides a simpler, shell-only implementation. This fork extends it with optional Python features for users who need advanced search and validation.

License

Documentation content belongs to Anthropic. Tool code is open source - contributions welcome!

About

Comprehensive Claude Code documentation tool, full-text search, and validation. Solves the "information about new feature releases" problem. Built on ericbuess/claude-code-docs.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 88.4%
  • Shell 11.6%