A comprehensive command-line tool for analyzing and managing Claude Code memory files (CLAUDE.md).
- π Smart File Discovery: Automatically finds CLAUDE.md files in user, project, and subdirectory locations
- π Multiple Output Formats: Text, JSON, Tree view, and raw output
- π Import Resolution: Tracks and validates import chains between memory files
- π₯ Diagnostics: Detects issues like circular imports, missing files, and large contexts
- π Context Search: Search within memory files with regex support
- π¦ Export Capabilities: Export contexts to various formats (Markdown, JSON, HTML, PDF)
- π§ Claude Code Integration: Direct integration with Claude Code for automated fixes
cargo install ccatgit clone https://github.com/nwiizo/ccat.git
cd ccat
cargo install --path .Download the latest binary from the releases page.
# Show memory files in current directory
ccat
# Show memory files with tree view
ccat show -f tree
# Include subdirectories
ccat show -s
# Show only specific types
ccat show -t project,user
# Run diagnostics
ccat diagnose
# Search for patterns
ccat search "TODO"
# Initialize new CLAUDE.md
ccat init# Show with metadata
ccat show --show-metadata
# Export to JSON
ccat export -f json -o context.json
# Watch for changes
ccat watch --notify
# Validate with strict rules
ccat validate --strictccat show [OPTIONS] [PATH]
Options:
-f, --format <FORMAT> Output format [text|json|tree|raw]
-t, --type <TYPE> Filter by type (project, user, local, subdir)
-c, --content-only Show content only
-n, --no-imports Don't expand imports
-s, --include-subdirs Include subdirectories
-d, --max-depth <N> Maximum directory depth
--show-metadata Show file metadataccat diagnose [OPTIONS] [PATH]
Options:
--fix Auto-fix issues
--strict Use strict rules
--rules <RULES> Custom rule files
--ignore <PATTERN> Ignore patternsccat search [OPTIONS] <QUERY>
Options:
-r, --regex Use regex search
-i, --ignore-case Case insensitive
-w, --word Word boundaries
-A, --after <N> Show N lines after match
-B, --before <N> Show N lines before match- Project Memory (
./CLAUDE.md): Project-specific context - User Memory (
~/.claude/CLAUDE.md): Global user settings - Local Memory (
./CLAUDE.local.md): Deprecated local overrides - Subdirectory Memory: CLAUDE.md files in subdirectories
The tool can detect:
- β Circular imports
- β Missing import files
β οΈ Large files (>1MB)β οΈ Deep import chainsβ οΈ Duplicate imports- π Security issues (API keys, passwords)
# Fix issues with Claude
ccat diagnose --fix-with-claude | claude -p "Fix these issues"
# Generate optimized CLAUDE.md
ccat init --analyze-project | claude -p "Generate CLAUDE.md"
# Analyze team patterns
ccat analyze-team --dir=/repos | claude -p "Standardize configs"Configuration file at ~/.config/ccat/config.toml:
[display]
format = "tree"
color = "auto"
show_metadata = false
[diagnostics]
strict = false
auto_fix = false
rules = ["default"]
[performance]
parallel = true
cache_size = "100MB"# Run tests
cargo test
# Run benchmarks
cargo bench
# Lint
cargo clippy
# Format
cargo fmt- Parallel file scanning with rayon
- LRU caching for parsed files
- Incremental import resolution
- Optimized for large codebases
MIT