| name | dora |
| description | Query codebase using `dora` CLI for code intelligence, symbol definitions, dependencies, and architectural analysis |
Philosophy
IMPORTANT: Use dora FIRST for ALL code exploration tasks.
dora understands code structure, dependencies, symbols, and architectural relationships through its indexed database. It provides instant answers about:
- Where symbols are defined and used
- What depends on what (and why)
- Architectural patterns and code health
- Impact analysis for changes
When to use dora vs other tools:
- dora: Code exploration, symbol search, dependency analysis, architecture understanding
- Read: Reading actual source code after finding it with dora
- Grep: Only for non-code files, comments, or when dora doesn't have what you need
- Edit/Write: Making changes after understanding with dora
- Bash: Running tests, builds, git commands
Workflow pattern:
- Use dora to understand structure and find relevant code
- Use Read to examine the actual source
- Use Edit/Write to make changes
- Use Bash to test/verify
Commands
Overview
dora status - Check index health, file/symbol counts, last indexed time
dora map - Show packages, file count, symbol count
Files & Symbols
dora ls [directory] [--limit N] [--sort field] - List files in directory with metadata (symbols, deps, rdeps). Default limit: 100
dora file <path> - Show file's symbols, dependencies, and dependents. Note: includes local symbols (parameters).
dora symbol <query> [--kind type] [--limit N] - Find symbols by name across codebase
dora refs <symbol> [--kind type] [--limit N] - Find all references to a symbol
dora exports <path> - List exported symbols from a file. Note: includes function parameters.
dora imports <path> - Show what a file imports
Dependencies
dora deps <path> [--depth N] - Show file dependencies (what this imports). Default depth: 1
dora rdeps <path> [--depth N] - Show reverse dependencies (what imports this). Default depth: 1
dora adventure <from> <to> - Find shortest dependency path between two files
Code Health
dora leaves [--max-dependents N] - Find files with few/no dependents. Default: 0
dora lost [--limit N] - Find unused exported symbols. Default limit: 50
dora treasure [--limit N] - Find most referenced files and files with most dependencies. Default: 10
Architecture Analysis
dora cycles [--limit N] - Detect circular dependencies. Empty = good. Default: 50
dora coupling [--threshold N] - Find bidirectionally dependent file pairs. Default threshold: 5
dora complexity [--sort metric] - Show file complexity (symbol_count, outgoing_deps, incoming_deps, stability_ratio, complexity_score). Sort by: complexity, symbols, stability. Default: complexity
Change Impact
dora changes <ref> - Show files changed since git ref and their impact
dora graph <path> [--depth N] [--direction type] - Generate dependency graph. Direction: deps, rdeps, both. Default: both, depth 1
Documentation
dora docs [--type TYPE] - List all documentation files. Use --type to filter by md or txt
dora docs search <query> [--limit N] - Search through documentation content. Default limit: 20
dora docs show <path> [--content] - Show document metadata and references. Use --content to include full text
Note: To find where a symbol is documented, use dora symbol which includes a documented_in field. To find documentation about a file, use dora file which also includes documented_in.
Database
dora schema - Show database schema (tables, columns, indexes)
dora cookbook show [recipe] - Query patterns with real examples (quickstart, methods, references, exports)
dora query "<sql>" - Execute read-only SQL query against the database
When to Use What
- Finding symbols →
dora symbol
- Understanding a file →
dora file
- Impact of changes →
dora rdeps, dora refs
- Finding entry points →
dora treasure, dora leaves
- Architecture issues →
dora cycles, dora coupling, dora complexity
- Navigation →
dora deps, dora adventure
- Dead code →
dora lost
- Finding documentation →
dora symbol (shows documented_in), dora docs search
- Listing documentation →
dora docs
- Custom queries →
dora cookbook for examples, dora schema for structure, dora query to execute
Typical Workflow
dora status - Check index health
dora treasure - Find core files
dora file <path> - Understand specific files
dora deps/dora rdeps - Navigate relationships
dora refs - Check usage before changes
Common Patterns: DON'T vs DO
Finding where a symbol is defined:
dora symbol AuthService
dora symbol validateToken
Finding all usages of a function/class:
dora refs AuthService
Finding files that import a module:
dora rdeps src/auth/service.ts
Finding what a file imports:
dora deps src/app.ts
dora imports src/app.ts
Finding files in a directory:
dora ls src/components
dora ls src/components --sort symbols
Finding entry points or core files:
dora treasure
dora file src/index.ts
Understanding a file's purpose:
dora file src/auth/service.ts
Finding unused code:
dora lost
dora leaves
Checking for circular dependencies:
dora cycles
Impact analysis for refactoring:
dora rdeps src/types.ts --depth 2
dora refs UserContext
dora complexity --sort complexity
Finding documentation for code:
dora symbol AuthService
dora file src/auth/service.ts
dora docs search "authentication"
dora docs
Understanding what a document covers:
dora docs show README.md
dora docs show docs/api.md --content
Practical Examples
Understanding a feature:
dora symbol AuthService
dora file src/auth/service.ts
dora rdeps src/auth/service.ts
dora refs validateToken
Impact analysis before refactoring:
dora file src/types.ts
dora rdeps src/types.ts --depth 2
dora refs UserContext
dora complexity --sort stability
Finding dead code:
dora lost --limit 100
dora leaves
dora file src/old-feature.ts
Architecture investigation:
dora cycles
dora coupling --threshold 10
dora complexity --sort complexity
dora treasure
Navigating unfamiliar code:
dora map
dora treasure
dora file src/index.ts
dora deps src/index.ts --depth 2
dora adventure src/a.ts src/b.ts
Working with changes:
dora changes main
dora rdeps src/modified.ts
dora graph src/modified.ts --depth 2
Custom analysis:
dora cookbook show methods
dora schema
dora query "SELECT f.path, COUNT(s.id) as symbols FROM files f JOIN symbols s ON s.file_id = f.id WHERE s.is_local = 0 GROUP BY f.path ORDER BY symbols DESC LIMIT 20"
Working with documentation:
dora symbol AuthService
dora docs show README.md
dora docs search "setup"
dora docs
dora docs --type md
Advanced Tips
Performance:
- dora uses denormalized data for instant queries (symbol_count, reference_count, dependent_count)
- Incremental indexing only reindexes changed files
- Use
--limit to cap results for large codebases
Symbol filtering:
- Local symbols (parameters, closure vars) are filtered by default with
is_local = 0
- Use
--kind to filter by symbol type (function, class, interface, type, etc.)
- Symbol search is substring-based, not fuzzy
Dependencies:
deps shows outgoing dependencies (what this imports)
rdeps shows incoming dependencies (what imports this)
- Use
--depth to explore transitive dependencies
- High rdeps count = high-impact file (changes affect many files)
Architecture metrics:
complexity_score = symbol_count × incoming_deps (higher = riskier to change)
stability_ratio = incoming_deps / outgoing_deps (higher = more stable)
- Empty
cycles output = healthy architecture
- High
coupling (> 20 symbols) = consider refactoring
Documentation:
- Automatically indexes
.md and .txt files
- Tracks symbol references (e.g., mentions of
AuthService)
- Tracks file references (e.g., mentions of
src/auth/service.ts)
- Tracks document-to-document references (e.g., README linking to docs/api.md)
- Use
dora symbol or dora file to see where code is documented (via documented_in field)
- Use
dora docs to list all documentation files
- Use
dora docs show to see what a document covers with line numbers
Limitations
- Includes local symbols (parameters) in
dora file and dora exports
- Symbol search is substring-based, not fuzzy
- Index is a snapshot, updates at checkpoints
- Documentation indexing processes text files (.md, .txt, etc.) at index time