Every AI coding tool has its strengths. Claude Code is strong for complex multi-step tasks. Cursor is fast for inline edits. Gemini CLI is useful for quick questions. Most developers use more than one but every time you switch, the context is gone. The new tool has no idea what you just did, what you decided, or which files are in a partial state.
On top of that, there is no clear picture of what different AI tools actually cost per session, per project, or per week. You are guessing at efficiency rather than measuring it.
ToolRouter is a local proxy daemon that solves both problems. It maintains shared session state across multiple AI coding tools, generates Handoff Briefs when you switch between them, and tracks real token spend per tool and model all transparently, without changing your API keys or your tools.
How It Works
ToolRouter sits between your AI tools and their APIs as a local proxy on port 7863. Here is what happens at each stage:
Step 1 - All traffic routes through the proxy.
You point each AI tool's API base URL at localhost:7863. From that point, every request your tool makes passes through ToolRouter first. The proxy forwards it transparently to the real API, your API keys are unchanged, your tools behave exactly as before.
Step 2 - The proxy captures what matters as a side effect.
As AI responses come back through the proxy, ToolRouter reads the token counts and extracts decisions and task state from the response text using pattern matching. Statements like "let's use bcrypt" are classified as decisions. Lines like "implemented JWT validation" are classified as completed tasks. "Still need to finish the refresh logic" becomes an in-progress item. Everything is written to the SQLite state store.
Step 3 - The file tracker watches the filesystem independently.
Alongside the proxy, a Watchdog-based file tracker monitors your project directories. It computes file hashes before and after each session to build an accurate list of what changed. It also scans for syntax errors, merge conflict markers, and unresolved TODOs to detect files that are in a partial state.
Step 4 - When you switch tools, a Handoff Brief is generated and injected.
The Handoff Generator reads from the state store and assembles a brief - partial files first since they carry the highest risk, then in-progress tasks, then decisions and completed items. This brief is automatically injected into the first message of your new session. The receiving tool sees exactly where the last tool left off, before it writes a single line.
Step 5 - Spend is tracked on every proxied response.
Token counts from every response are accumulated and costed against current model pricing. No separate setup needed, spend tracking is a byproduct of the same proxy pass.
Installation
pip install -e .
Quick Start
Step 1 - Start the daemon
toolrouter start
This starts the proxy on port 7863 and the dashboard on port 7864.
Step 2 - Point your AI tools at the proxy
Each tool needs its API base URL pointed at the local proxy. This is a one-time configuration per tool:
Claude Code: export ANTHROPIC_API_URL=http://localhost:7863/v1
Cursor: Set OpenAI API base URL to http://localhost:7863/v1 in Settings → AI
Gemini CLI: export OPENAI_API_BASE=http://localhost:7863/v1
Ollama: export OLLAMA_HOST=http://localhost:7863/api
Step 3 - Work normally
Switch tools whenever you like. ToolRouter handles handoffs automatically.
Handoff Brief
When you switch tools on the same project, ToolRouter injects a brief like this into the first message of your new session:
[ToolRouter Handoff — from claude-code, 5 minutes ago]
Files changed this session:
✓ src/auth.py — implemented JWT token validation
✓ src/models.py — added User model
⚠src/api.py — PARTIALLY MODIFIED, do not use as-is
Completed:
✓ Set up authentication middleware
✓ Created database schema
In progress:
→ Implementing refresh token logic
→ Writing API documentation
Decisions made:
- Using bcrypt for password hashing
- JWT tokens expire after 24 hours
- Refresh tokens stored in Redis
âš Do not touch:
- src/api.py (has syntax errors)
The brief is generated from the state store - real file changes tracked by the watchdog, decisions extracted from AI responses, and partial-state detection on modified files. The receiving tool sees this at the start of the session and can immediately continue where the last tool left off.
Spend Tracking
ToolRouter reads token counts from every proxied response and calculates cost using current model pricing. Spend reports run directly from the terminal:
toolrouter spend # Today's report
toolrouter spend --week # This week
toolrouter spend --month # This month
The dashboard at http://localhost:7864 shows daily spend bar charts per tool, session lists with per-session cost, per-tool and per-project breakdowns, which tool is most cost-efficient measured by cost per file changed, and projected monthly costs based on current pace.
Model Pricing (May 2026)
Commands
Architecture
State Store - SQLite with WAL mode for concurrent read/write. Stores sessions, per-session file changes with MD5 hashes, extracted decisions and tasks, and generated handoff briefs. Every table links back to a session ID so the full history is queryable.
File Tracker - Watchdog-based monitoring of project directories. Computes file hashes before and after each session to build an accurate change list. Detects partial states by scanning for syntax errors, merge conflict markers, and unresolved TODOs.
Decision Extractor - Pattern matching over AI responses to classify statements into decisions, completed tasks, in-progress work, and blockers. Phrases like "let's use" and "we'll go with" are decisions. Words like "done", "implemented", and "✓" signal completed tasks. "I've started" and "still need to" mark in-progress work. "Blocked by" and "waiting for" identify blockers.
Handoff Generator - Assembles the brief from state store data, ordering by recency and priority: partial files first as they carry the highest risk, then in-progress tasks, then decisions and completed items.
Configuration
Configuration is stored at ~/.toolrouter/config.json. The key settings are:
injection_enabled - whether to prepend handoff briefs
proxy_port - default 7863
dashboard_port - default 7864
log_level - logging verbosity
Use toolrouter config set <key> <value> to change any setting without editing the file directly.
How I Built This Using NEO
This project was built using NEO. NEO is a fully autonomous AI engineering agent that can write code and build solutions for AI/ML tasks including AI model evals, prompt optimization and end to end AI pipeline development.
The requirement was a local proxy daemon that could sit transparently between AI coding tools and their APIs, maintain shared session state across tool switches, generate structured handoff briefs automatically, and track real token spend per tool and model - all without requiring any changes to the tools themselves or the user's API keys.
NEO built the full implementation: the proxy daemon running on port 7863, the SQLite state store with WAL mode, the Watchdog-based file tracker with MD5 hashing and partial state detection, the pattern-matching decision extractor, the handoff brief generator with priority ordering, the spend tracker reading token counts from proxied responses, the dashboard on port 7864, and the full CLI with all twelve commands.
How You Can Use and Extend This With NEO
Use it to switch between Claude Code, Cursor, and Gemini CLI on the same project without losing context.
Point each tool at the proxy once, and every subsequent tool switch gets an automatic handoff brief. The receiving tool knows which files changed, which tasks are in progress, and which files should not be touched - without you writing a single summary.
Use the spend dashboard to measure which AI tool is most cost-efficient for your workflow.
The dashboard breaks down cost per tool, per project, and per session. The "cost per file changed" metric tells you which tool delivers the most work per dollar - a data-driven way to decide which tool to reach for on different task types.
Use the handoff brief preview before switching.
Run toolrouter handoff before switching tools to see exactly what brief the next tool will receive. This lets you verify the context is accurate before handing off on a complex task where a wrong assumption by the next tool could cause real damage.
Extend it with additional tool integrations.
The proxy currently supports Claude Code, Cursor, Gemini CLI, and Ollama via their respective API base URL environment variables. Any tool that accepts an OpenAI-compatible API base URL can be pointed at the proxy using the same pattern - no changes to ToolRouter needed.
Final Notes
ToolRouter makes multi-tool AI development practical. Context persists across tool switches through automatically generated handoff briefs. Spend is tracked in real time with model-accurate pricing. The proxy is transparent - your tools and API keys are unchanged.
The code is at https://github.com/dakshjain-1616/Tool-Router
You can also build with NEO in your IDE using the VS Code extension or Cursor.
You can use NEO MCP with Claude Code: https://heyneo.com/claude-code



Top comments (0)