The Architecture
Beyond Primitive RAG. True Codebase Intelligence.
Backbencher doesn't just read files. It models your entire project as a highly structured, queryable AST graph database to achieve mathematical precision in code generation.
1. Deterministic AST Indexing
Background parser ingests source code across 26 languages into a local SQLite graph database.
2. JIT Context Extraction
Queries the Brain DB to surgically extract isolated symbol snippets instead of raw file reading.
3. AST-Level Surgery
Uses byte-bounds from the database to perfectly replace, insert, or delete nodes.
4. Architectural Validation
Proactively scans for orphaned code, complexity violations, and API contract drift.
Deterministic AST Indexing
- Tree-sitter AST Parsing
- Caller/Callee Relationship Graph
- Real-time File Watcher (Chokidar)
- Sub-10ms Query Latency
32 Languages Supported
bb parses code across your entire stack into a unified queryable structure. From TypeScript frontends to Rust backends, understand your whole codebase.
Unified Semantic Graph
All languages compile down into a single queryable SQLite relation map.
13 Surgical Precision Tools
Every tool designed for exact AST manipulation. No regex, no guessing, no breaking your code.
bb_search
Find anything in milliseconds with semantic understanding
bb_search --query="login" --scope="functions"bb_select
Extract exact symbols, not entire files. JIT context extraction.
bb_select --symbolName="AuthService.login"bb_update
Surgical code replacement with AST precision
bb_update --symbolName="login" --newContent="..."bb_insert
Smart code insertion before/after/inside symbols
bb_insert --target="UserService" --position="after"bb_delete
Safe deletion with cascading protection
bb_delete --symbolName="deprecatedFunc"bb_refactor
Cross-file atomic renaming with dependency updates
bb_refactor --symbolName="oldName" --newName="newName"bb_relationships
Understand dependencies: callers, callees, impact analysis
bb_relationships --target="login" --analysisType="callers"bb_patterns
Detect anti-patterns: God classes, circular deps, complexity
bb_patterns --analysisType="violations"bb_ask
Architectural Q&A with codebase context
bb_ask --query="How does authentication work?"bb_security
Cross-language vulnerability scanning
bb_security --autoPatch=truebb_migrate
Cross-language migration with dependency ordering
bb_migrate --symbolNames="[auth,users]" --targetLanguage="go"bb_refresh
Incremental brain index rebuild
bb_refresh --reason="new files"bb_visualize
Interactive architecture visualization
bb_visualize --output="architecture.html"