project-brain logoproject-brain
developer infrastructure tooling

Semantic
intelligence
for real codebases.

AST-aware analysis, semantic Git diffing, and AI-friendly export — all running locally with zero telemetry.

project-brain — quick start
✓ Created .brain/
✓ Created brain.yaml
brain project analyze .
Scanning repository...
✓ AST parsed — stored in .brain/data.json
brain diff show
HEAD~1 → HEAD | 2 files changed
Zero Telemetry
Local-first
MIT License
Python 3.10+
100% Offline

Capabilities

Everything you need.
Nothing you don't.

AST Analysis

Deep semantic understanding of your codebase using precise Abstract Syntax Trees. Parses Python, TypeScript, JavaScript, and more.

Semantic Diffing

Understand what actually changed logically, ignoring whitespace and formatting noise. See intent, not lines.

Export Engine

Pack your entire repository into LLM-optimized formats instantly. Markdown, JSON, or custom schemas — ready for any model.

Explain Engine

Generate intelligent, context-aware explanations for complex legacy modules. Powered by local semantic graphs.

Diagnostics

Catch structural anomalies and architectural decay before they hit production. Circular deps, layer violations, and more.

Local-first Workflows

Zero telemetry. All intelligence and processing runs securely on your local machine. No cloud, no data leaks.


Architecture

How it works.
From raw code to semantic intelligence.

01
RepositorySource Code
02
AST AnalysisParse & Tokenize
03
Semantic GraphBuild Relationships
04
Git IntelligenceSemantic Diffing
05
Dev WorkflowsCLI Output

Diagnostics

Catch problems early.
Before they reach production.

brain project doctor validates your entire environment — from Git availability to API key presence — and reports a clear status.

  • brain project doctor

    Checks project init, Git, config, and provider setup

  • brain project summary

    Total files, functions, classes, architecture hints

  • brain diff review

    Semantic diff explanations with optional LLM — HTML reports

  • brain diff explain <file>

    Explain a specific file or function: src/api.py:create_user

brain project doctor
✓ Project initialized (.brain/ exists)
✓ Repository analyzed (.brain/data.json)
✓ Git available (2.45.0)
✓ Config valid (brain.yaml)
~ Provider: none (offline mode)
Status: READY

Motivation

Why project-brain exists.
Fixing modern development workflows.

Git diffs are noisy

Traditional diffs show line changes, not semantic meaning. A small refactor can generate large diffs while hiding the actual behavioral impact.

Codebases become difficult to understand

Large repositories contain deeply nested modules, duplicated logic, and hidden dependencies. Understanding them manually is slow and error-prone.

AI tools require structured context

Most AI systems perform poorly when fed raw repositories. project-brain creates AI-friendly context and function-level intelligence to maximize output quality.

Local-first tooling matters

Many developers do not want automatic code uploads or vendor lock-in. project-brain works fully offline with no cloud dependency — your code stays yours.


CLI

Designed for your terminal.
Fast, intuitive, and pipeable.

A clean, composable CLI — both brain and project-brain aliases work.

brain project initInitialize project-brain in a repository
brain project init
✓ project-brain installed
brain project init
✓ Created .brain/
✓ Created .brain/cache/
✓ Created .brain/data.json
✓ Created brain.yaml
brain project analyzeRecursive scan — AST parsing, metadata extraction
brain project analyze
🔍 Analyzing: .
📋 File Paths:
src/api.py
src/utils.py
✅ Analysis complete → .brain/data.json
brain diff showInspect Git changes at function level (HEAD~1 → HEAD)
brain diff show
Files Changed: 2
Modified: src/api.py
Added: src/utils.py
Functions Modified:
• create_user
Functions Added:
• validate_user
brain export full_codePack entire repo into AI-friendly context
brain export full_code
Scanning repository...
Respecting ignore rules and file size limits...
✓ Exported → .brain/exports/full_code.txt
brain export code_changes HEAD~3 HEAD
✓ Exported → .brain/exports/code_changes.txt

30-second quick start

$pip install project-brain-cli
$brain project init
$brain project analyze .
$brain diff show
$brain export full_code

Requires Python 3.10+ and Git.View full documentation on GitHub →