@yashshahbacancy/code-radar
v0.3.10
Published
AI-powered codebase indexer that reduces Claude Code token usage by 10x. One command setup.
Maintainers
Readme
code-radar
AI-powered codebase indexer that reduces Claude Code token usage by up to 10x.
code-radar indexes your codebase into a local SQLite database and exposes it to Claude Code via MCP (Model Context Protocol). Instead of reading whole files just to find a function or trace a route, Claude queries a structured index — fast, cheap, and complete.
Why
Claude Code burns tokens reading files to figure out where things are. On a real project that's hundreds of thousands of tokens just on exploration. coderadar pre-indexes:
- Symbols — functions, classes, methods, constants, types, interfaces (20+ languages)
- Routes — HTTP endpoints across 12 web frameworks
- Models — DB schemas across 10 ORMs
- Call graph — who calls what
- Imports / exports / references — full dependency graph
- Git activity — recent changes, branch diff
Claude then uses MCP tools like find_symbol, get_structure, impact_analysis, list_routes instead of reading files blind.
Install
npm install -g @yashshahbacancy/code-radar
coderadar setupThat's it. The npm package is @yashshahbacancy/code-radar but the CLI command is coderadar. setup registers it as a Claude Code MCP server (user scope, so it works in every project).
Prerequisites
- Node.js 18+
- Claude Code CLI (
claudein your PATH) - Git (optional — needed for
recent_changesandbranch_difftools)
Usage
Once setup is done, just open Claude Code in any project. coderadar runs in the background. You don't need to do anything else.
Optional commands:
coderadar init # pre-index the current project
coderadar init --all # index every git repo under the current directory
coderadar status # show what's indexed for the current project
coderadar search <name> # search for a symbol from the CLI
coderadar stats # how many tool calls / bytes coderadar has served
coderadar short-replies on|off # tell Claude to keep replies short (saves output tokens)
coderadar keepalive on|off # auto-reindex + session brief + /compact nudge
coderadar uninstall # remove the MCP registrationShort replies (optional, on by default)
coderadar setup adds a small <!-- coderadar-short-replies --> block to your ~/.claude/CLAUDE.md that tells Claude to skip preamble, trailing summaries, and unnecessary narration. Turn it off any time with coderadar short-replies off.
Keepalive (optional, on by default)
coderadar setup installs three Claude Code hooks in ~/.claude/settings.json:
- PreCompact — before
/compactfires, runscoderadar reindex(so the code index is fresh) andcoderadar session-brief(saves a short markdown summary of recent user messages, files Claude edited, and impact analyses run). - SessionStart — at the start of every new session (including post-compact), prints the most recent brief into context, so Claude picks up the task instead of starting blind.
- Stop — when the session crosses ~80% of the context window, prints a one-line nudge suggesting
/compact(throttled to one nudge per session).
Toggle with coderadar keepalive on|off|status.
Supported stacks
Languages (symbol extraction): TypeScript, JavaScript, Python, Go, Java, Kotlin, Swift, C#, Ruby, PHP, and more.
Web frameworks (route extraction): Express, Koa, Fastify, NestJS, Spring Boot, ASP.NET (attribute + minimal API), Rails, Laravel, FastAPI, Django, Next.js App Router.
ORMs (model + relation extraction): Objection.js, TypeORM, Sequelize, Prisma, Mongoose, ActiveRecord, Eloquent, Django ORM, SQLAlchemy.
If your stack isn't listed, coderadar still indexes symbols and imports — you just lose the route/model intelligence.
How it works
coderadar initwalks your project, parses every source file with a fast regex-based AST-light parser, and stores symbols/routes/models/etc. in~/.coderadar/<project>.db.- Claude Code launches
coderadar serveas an MCP server. - Claude calls MCP tools (
find_symbol,impact_analysis, etc.) instead of reading files. - Subsequent runs incrementally re-index only changed files (~1-2 seconds).
The index is per-project, lives at ~/.coderadar/, and never leaves your machine.
Platform support
| Platform | Status | |---|---| | macOS (arm64, x64) | ✅ | | Linux (x64, arm64) | ✅ | | Windows (x64) | ✅ |
better-sqlite3 ships prebuilt native binaries for all of the above. On unusual archs you may need a C++ toolchain (node-gyp).
License
MIT
