Local semantic code search for Cursor and Claude Code via MCP.
dev-agent indexes your codebase and provides 9 MCP tools to AI assistants. Instead of AI tools grepping through files, they can ask conceptual questions like "where do we handle authentication?"
dev_search— Semantic code search by meaningdev_refs— Find callers/callees of functionsdev_map— Codebase structure with change frequencydev_history— Semantic search over git commitsdev_plan— Assemble context for GitHub issuesdev_explore— Find similar code, trace relationshipsdev_gh— Search GitHub issues/PRs semanticallydev_status/dev_health— Monitoring
We benchmarked dev-agent against baseline Claude Code across 5 task types:
| Metric | Baseline | With dev-agent | Change |
|---|---|---|---|
| Cost | $1.82 | $1.02 | -44% |
| Time | 14.1 min | 11.5 min | -19% |
| Tool calls | 69 | 40 | -42% |
Trade-offs: Faster but sometimes less thorough. Best for implementation tasks and codebase exploration. For deep debugging, baseline Claude may read more files.
Good fit:
- Large or unfamiliar codebases
- Implementation tasks ("add a feature like X")
- Exploring how code works
- Reducing AI API costs
Less useful:
- Small codebases you already know well
- Deep debugging sessions
- When thoroughness matters more than speed
# Install globally
npm install -g dev-agent
# Index your repository
cd /path/to/your/repo
dev index .
# Install MCP integration
dev mcp install --cursor # For Cursor IDE
dev mcp install # For Claude Code
# That's it! AI tools now have access to dev-agent capabilities.When integrated with Cursor or Claude Code, dev-agent provides 9 powerful tools:
Natural language search with rich results including code snippets, imports, and relationships.
Find authentication middleware that handles JWT tokens
Features:
- Code snippets included (not just file paths)
- Import statements for context
- Caller/callee hints
- Progressive disclosure based on token budget
Query what calls what and what is called by what.
Find all callers of the authenticate function
Find what functions validateToken calls
Features:
- Bidirectional queries (callers/callees)
- File paths and line numbers
- Relevance scoring
Get a high-level view of repository structure with change frequency.
Show me the codebase structure with depth 3
Focus on the packages/core directory
Show hot areas with recent changes
Features:
- Directory tree with component counts
- Hot Paths: Most referenced files
- Change Frequency: 🔥 Hot (5+ commits/30d), ✏️ Active (1-4/30d), 📝 Recent (90d)
- Smart Depth: Adaptive expansion based on density
- Signatures: Function/class signatures in exports
Example output:
# Codebase Map
## Hot Paths (most referenced)
1. `packages/core/src/indexer/index.ts` (RepositoryIndexer) - 47 refs
2. `packages/core/src/vector/store.ts` (LanceDBVectorStore) - 32 refs
## Directory Structure
└── packages/ (195 components)
├── 🔥 core/ (45 components) — 12 commits in 30d
│ └── exports: function search(query): Promise<Result[]>, class RepositoryIndexer
├── ✏️ mcp-server/ (28 components) — 3 commits in 30d
│ └── exports: class MCPServer, function createAdapter(config): AdapterSemantic search over git commit history.
Find commits about authentication token fixes
Show history for src/auth/middleware.ts
Features:
- Semantic search: Find commits by meaning, not just text
- File history: Track changes with rename detection
- Issue/PR refs: Extracted from commit messages
- Token-budgeted output
Assemble rich context for implementing GitHub issues.
Assemble context for issue #42
Returns:
- Full issue with comments
- Relevant code snippets from semantic search
- Related commits from git history (new in v0.4)
- Detected codebase patterns (test naming, locations)
- Metadata (tokens, timing)
Note: This tool no longer generates task breakdowns. It provides comprehensive context so the AI assistant can create better plans.
Discover patterns, find similar code, analyze relationships.
Find code similar to src/auth/middleware.ts
Search for error handling patterns
View indexing status, component health, and repository information.
Search issues and PRs with semantic understanding.
Find authentication-related bugs
Search for performance issues in closed PRs
Check MCP server and component health.
- 📦 Works 100% offline
- 🔐 Your code never leaves your machine
- ⚡ Fast local embeddings with all-MiniLM-L6-v2
- 🛡️ Rate limiting (100 req/min burst)
- 🔄 Retry logic with exponential backoff
- 💚 Health monitoring
- 🧹 Memory-safe (circular buffers)
- ✅ 1300+ tests
- 🪙 Progressive disclosure based on budget
- 📊 Token estimation in results
- 🎯 Smart depth for codebase maps
- Node.js v22 LTS or higher
- pnpm v8.15.4 or higher
- GitHub CLI (for GitHub features)
npm install -g dev-agentgit clone https://github.com/lytics/dev-agent.git
cd dev-agent
pnpm install
pnpm build
cd packages/dev-agent
npm link# Index everything (code, git history, GitHub)
dev index .
dev index . --no-github # Skip GitHub indexing
# Semantic search
dev search "how do agents communicate"
dev search "error handling" --threshold 0.3
# Git history search
dev git search "authentication fix" # Semantic search over commits
dev git stats # Show indexed commit count
# GitHub integration
dev gh index # Index issues and PRs (also done by dev index)
dev gh search "authentication bug" # Semantic search
# View statistics
dev stats
# MCP management
dev mcp install --cursor # Install for Cursor
dev mcp install # Install for Claude Code
dev mcp list # List configured serversdev-agent/
├── packages/
│ ├── core/ # Scanner, vector storage, indexer
│ ├── cli/ # Command-line interface
│ ├── subagents/ # Planner, explorer, PR agents
│ ├── mcp-server/ # MCP protocol server + adapters
│ └── integrations/ # Claude Code, VS Code
├── docs/ # Documentation
└── website/ # Documentation website
- TypeScript (strict mode)
- ts-morph / TypeScript Compiler API (AST analysis)
- LanceDB (embedded vector storage)
- @xenova/transformers (local embeddings)
- MCP (Model Context Protocol)
- Turborepo (monorepo builds)
- Vitest (1300+ tests)
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run tests
pnpm test
# Lint and format
pnpm lint
pnpm format
# Type check
pnpm typecheck- v0.4.0 - Intelligent Git History release
- New
dev_historytool for semantic commit search - Enhanced
dev_mapwith change frequency indicators (🔥 hot, ✏️ active) - Enhanced
dev_planwith related commits from git history - New
GitIndexerandLocalGitExtractorin core
- New
- v0.3.0 - Context Quality release
- New
dev_refstool for relationship queries - Enhanced
dev_mapwith hot paths, smart depth, signatures - Refactored
dev_planto context assembly
- New
- v0.2.0 - Richer search results with snippets and imports
- v0.1.0 - Initial release
Contributions welcome! Please follow conventional commit format and include tests.
See CONTRIBUTING.md for guidelines.