Skip to main content

A codebase brain for AI coding assistants — pre-indexed navigation, blast radius, dead code detection

Project description

nervx

A codebase brain for AI coding assistants. Pre-indexed navigation, blast radius analysis, dead code detection, and architectural pattern recognition — all from a single pip install.

Install

pip install nervx

Quick Start

# Build the brain for your project
nervx build .

# Ask questions in natural language
nervx nav "how does authentication work"

# Check blast radius before refactoring
nervx blast-radius "src/auth.py::validate_token"

# Find dead code
nervx find --dead

# Find untested critical code
nervx find --no-tests --importance-gt 20

# Open interactive visualization
nervx viz .

Benchmarks

Tested on FastAPI — 3 identical questions asked with and without nervx:

Metric Without nervx With nervx Reduction
Tool calls 93 56 -40%
Output tokens 15,694 8,196 -48%
Grep searches 63 22 -65%
API calls 115 73 -37%
Peak context 70,503 57,141 -19%

nervx replaces dozens of blind grep/read cycles with pre-indexed lookups. Fewer tool calls, less token waste, faster answers.

What It Does

nervx parses your codebase with tree-sitter, builds a graph of every function, class, and method, then pre-computes:

  • Edges: who calls what, who imports what, who inherits from what
  • Importance scores: based on caller count, cross-module usage, and connectivity
  • Architectural patterns: factories, singletons, event buses, strategy patterns, repositories
  • Concept paths: end-to-end call chains and domain clusters
  • Git intelligence: hotspots, temporal coupling, churn analysis
  • Contract analysis: callers that disagree on error handling
  • Dead code: unreferenced functions and classes

All stored in a single SQLite database (.nervx/brain.db), queryable in milliseconds.

Commands

Command What it does
nervx build <path> Full build of the brain
nervx update <path> Incremental update (only changed files)
nervx nav "<question>" Natural language navigation with execution flows
nervx blast-radius "<symbol>" Impact analysis for refactoring
nervx find --dead Find unreferenced symbols
nervx find --no-tests Find untested code
nervx flows [keyword] Show execution paths
nervx diff --days 7 Recent structural changes
nervx viz . Interactive D3 visualization
nervx stats Graph statistics

Claude Code Integration

When you run nervx build, it automatically adds instructions to your project's CLAUDE.md that teach Claude Code to use nervx commands. Claude will use nervx nav before exploring code, check blast radius before refactoring, and find dead code before cleanup — saving tokens and tool calls.

Supported Languages

Python, JavaScript/TypeScript, Java, Go, Rust, C/C++, C#, Ruby

Watch Mode (Optional)

pip install nervx[watch]
nervx watch .

Auto-updates the brain when files change.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nervx-0.2.0.tar.gz (114.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nervx-0.2.0-py3-none-any.whl (129.4 kB view details)

Uploaded Python 3

File details

Details for the file nervx-0.2.0.tar.gz.

File metadata

  • Download URL: nervx-0.2.0.tar.gz
  • Upload date:
  • Size: 114.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for nervx-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fd0b9977cb409d60b808e4d3287cf87aff3754719de0984a86ed8325c81bfb62
MD5 f7684b260d5065d15b0fc279ae83d22b
BLAKE2b-256 5d10c2dea1464e82d981de19c24aacddcf27f93d9778b5ab83272b5489bd8297

See more details on using hashes here.

File details

Details for the file nervx-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: nervx-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 129.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for nervx-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b0dd5dbd02a22b06ee7067c6d0cce1e4b0dd2ac65b9a84a1145a3825c136ca9
MD5 f274859a9b5baac5d2a4285f50266cb1
BLAKE2b-256 554f834112c709a52c44980c9b33fae4b350a2545749c1a9b219dc9605df5455

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page