This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Blarify converts source code repositories into graph structures for LLM analysis. It supports Python, JavaScript, TypeScript, Ruby, Go, and C# through Tree-sitter and LSP integration.
- Index File:
@docs/index.mdis the file where you can go to know where to look for context in the docs - Installation: See
docs/installation.md - Getting Started: See
docs/quickstart.md - API Reference: See
docs/api-reference.md
poetry install # Install dependencies
poetry add <package> # Add dependencypoetry run ruff check # Lint (120 char line length)
poetry run codespell # Spell check
poetry run isort . # Format importspoetry build # Build package
pip install -e . # Install for developmentmain.py: Four execution modes (full, diff, update, diff_with_previous)prebuilt/graph_builder.py: Simplified API for users
- ProjectGraphCreator: Core graph building
- LspQueryHelper: Language Server Protocol integration
- Database Managers: Neo4j and FalkorDB support via abstract interface
- Language Definitions: Extensible support in
code_hierarchy/languages/
Creates nodes (File, Class, Function) and relationships (Imports, Calls, Inherits) with file paths, line numbers, and diff identifiers.
NEO4J_URI=bolt://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=password
ROOT_PATH=/path/to/projectextensions_to_skip: e.g., [".json", ".xml"]names_to_skip: e.g., ["pycache"].blarignore: Custom ignore patterns
Uses vendored multilspy library. Update with:
poetry run vendoring syncNo test suite currently exists.
Always check existing documentation files (docs/*.md) before answering questions or starting implementation. Always start in the docs/index.md
Before coding, create a clear written plan with:
- Specific tasks broken down into small, manageable steps
- Clear objectives for each step
- Dependencies between tasks identified
Follow TDD approach:
- Write one test for the next small piece of functionality
- Run the test (it should fail)
- Write minimal code to make the test pass
- Refactor if needed
- Move to next test/functionality
This ensures code quality and prevents over-engineering.
- Always run tests before submitting a task as completed
- always follow pyright rules and run the pyright command after making changes on the code
- always follow ruff rules and run the ruff command after making changes on the code
- befoire macking any commit run pyright and ruff on the changed files
- do not make test more 'flexible' to make them pass
- Do not add printing or logging in the tests, unless you are debugging something in particular. Whith the assertions messages we should conclude enough