Metadata-Version: 2.4
Name: nervx
Version: 0.2.0
Summary: A codebase brain for AI coding assistants — pre-indexed navigation, blast radius, dead code detection
Author-email: Aditya Kamat <adityakamat007@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/adityakamat24/nervx
Project-URL: Repository, https://github.com/adityakamat24/nervx
Project-URL: Issues, https://github.com/adityakamat24/nervx/issues
Keywords: cli,code-intelligence,static-analysis,developer-tools,claude
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tree-sitter>=0.21.0
Requires-Dist: tree-sitter-python>=0.21.0
Requires-Dist: tree-sitter-javascript>=0.21.0
Requires-Dist: tree-sitter-typescript>=0.21.0
Requires-Dist: tree-sitter-java>=0.21.0
Requires-Dist: tree-sitter-go>=0.21.0
Requires-Dist: tree-sitter-rust>=0.21.0
Requires-Dist: tree-sitter-c>=0.21.0
Requires-Dist: tree-sitter-cpp>=0.21.0
Requires-Dist: tree-sitter-c-sharp>=0.21.0
Requires-Dist: tree-sitter-ruby>=0.21.0
Provides-Extra: watch
Requires-Dist: watchdog>=3.0.0; extra == "watch"
Dynamic: license-file

# 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

```bash
pip install nervx
```

## Quick Start

```bash
# 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](https://github.com/fastapi/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)

```bash
pip install nervx[watch]
nervx watch .
```

Auto-updates the brain when files change.

## License

MIT
