Claude Code with intelligent code graphs for large codebases
Claude Code Graph enhances Claude Code with live structural analysis of your codebase. It builds and maintains graphs of your code's architecture, dependencies, and relationships - giving Claude deep contextual understanding of even the largest projects.
🚀 Quick Start
Prerequisites
Make sure you have Claude Code installed first:
npm install -g @anthropic-ai/claude-code
Installation
-
Install Claude Code Graph globally:
npm install -g claude-code-graph
-
Navigate to your project and start coding:
cd your-project/ ccg start
That's it! The first run will automatically:
- Initialize graph structures
- Build code analysis graphs
- Start the live update daemon
- Launch Claude Code with graph intelligence
🎯 What It Does
Claude Code Graph provides Claude with:
- Dependency Analysis: Understand how files and modules relate to each other
- Call Graph Mapping: Track function calls and inheritance chains across languages
- AST Structure: Deep understanding of code syntax and semantics
- Architecture Overview: High-level view of your codebase organization
- Live Updates: Graphs stay current as you code
Supported Languages
- JavaScript/TypeScript: Module dependencies via madge
- Python: Call graphs via pyan3, import analysis
- C/C++: Include dependencies, symbol analysis
- Universal: AST parsing with tree-sitter for all languages
📋 Commands
| Command | Description |
|---|---|
ccg start |
Launch Claude Code with graph intelligence (auto-setup) |
ccg doctor |
Check system health and dependencies |
ccg status |
Show current graph and daemon status |
ccg build |
Manually rebuild all graphs |
ccg daemon start/stop |
Manage live graph update daemon |
ccg init |
Initialize graphs in new project (manual setup) |
🔧 Advanced Setup
Manual Workflow (if needed)
# 1. Initialize in your project ccg init # 2. Check dependencies ccg doctor # 3. Build graphs ccg build # 4. Start daemon for live updates ccg daemon start # 5. Launch Claude Code ccg start
Dependencies
Required:
- Node.js 18+
- Python 3.8+
- madge (for JS/TS analysis)
Optional (improves analysis):
- tree-sitter-cli:
npm install -g tree-sitter-cli - pyan3:
pip install pyan3 - Python packages:
pip install watchdog networkx psutil aiofiles
Check with: ccg doctor
📊 Performance
Claude Code Graph is optimized for large codebases:
- Smart Filtering: Skips
node_modules, build directories, etc. - File Limits: Processes up to 500 files for tree-sitter, 200 for C++, 50 for Python
- Incremental Updates: Only processes changed files via daemon
- Caching: Intelligent caching for faster subsequent runs
For projects with 1000+ files, initial graph building takes 2-5 minutes instead of 30+ minutes.
📁 Project Structure
your-project/
├── .graph/ # Graph data (auto-created)
│ ├── js.json # JavaScript/TypeScript modules
│ ├── py.dot # Python call graph
│ ├── cpp.json # C++ dependencies
│ ├── ts.json # Tree-sitter AST
│ ├── metrics.json # Graph statistics
│ └── daemon.lock # Daemon status
├── .gitignore # Updated to exclude .graph/
└── your code...
🛠️ Development
# Clone the repo git clone https://github.com/aibozo/claude-code.graph.git cd claude-code-graph # Install dependencies npm install # Build tools npm run build # Install globally for testing npm install -g . # Run tests npm test
🤝 Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and test thoroughly
- Submit a pull request
📝 License
MIT License - see LICENSE.md for details.
🐛 Issues & Support
- Report bugs: GitHub Issues
- For Claude Code issues: Use
/bugcommand or Claude Code Issues
🔗 Links
Made with ❤️ for better AI-assisted coding