local profiler for ai agentsopen source·apache-2.0

Four agents running. Zero visibility.

One line around your agent. A panel opens on localhost with the whole call tree and a price on every node. Run it again next week and you see what changed. Nothing leaves your machine.

See the panel →
works with
Claude Agent SDKClaude CodeCrewAILangGraph
free forever, local·no signup·your prompts never leave
scroll
researchCOSTone subagent burned 142k tokens on its own contextWebFetchRETRYthe same tool called 5 times with the same argumentmainDRIFTthis agent solved it in 4 turns last month, 11 todayverifyTOKENSsubagents carry their own context, and their own billruntimeLOCALfree and local by default, and the cloud never sees a promptmainCOSTthe SDK tells you the cost once, then it is goneresearchRETRYa subagent that hit its turn limit and returned nothingresearchCOSTone subagent burned 142k tokens on its own contextWebFetchRETRYthe same tool called 5 times with the same argumentmainDRIFTthis agent solved it in 4 turns last month, 11 todayverifyTOKENSsubagents carry their own context, and their own billruntimeLOCALfree and local by default, and the cloud never sees a promptmainCOSTthe SDK tells you the cost once, then it is goneresearchRETRYa subagent that hit its turn limit and returned nothing
02 · the library

A profiler, not a platform.

One pip install. It runs on your machine and keeps the numbers the SDK throws away.

01

One line

Wrap the stream your agent already returns. Nothing else in your code moves.

async for msg in watch(stream):
zero config
02

Local first

SQLite on your disk, panel on localhost. The cloud is opt-in and never sees a prompt.

~/.spanix/runs.dboffline
your data stays yours
03

Cost per node

The SDK prices every turn and discards it. spanix keeps it and rolls it up the tree.

$0.14research $0.42$0.09
subagents included
04

Drift over time

Four turns last month, eleven today. Nothing broke. It just got slower and more expensive.

4 turns11 turns
nothing else shows this
03 · the process
01 / 04

One line

Wrap the stream. The SDK already knows the cost. It just throws it away.

02 / 04

The session opens

The main agent, its tools, and the subagents it spawned. Each one with its own context.

03 / 04

The bleed

A subagent burning 142k tokens and a tool called five times over.

04 / 04

The drift

Same task, four turns last month. Eleven today. Nobody was watching.

main$0.14orchestrator · 11 turns22.6s
Read+0.4ktool0.2s
WebFetch+38ktool · called 5×5.4s
research$0.42Task · subagent14.2s
verify$0.09Task · subagent3.1s
Grep+1.1ktool0.3s
result$0.65run total22.6s
↺ 5×
inspector · scraper
turns11
tools called8
subagents2
own tokens46k
retry log · WebFetch
10.9s+6.2k
21.1s+7.4k
31.0s+7.1k
41.2s+8.0k
51.2s+9.3k
38k tokens pushed into main's context
drift · turns per run
6 weeks agonow
turns4 → 11
cost / run$0.21 → $0.65
same taskunchanged
timeline · run #48222.6s
main
Read
WebFetch
research
Grep
verify
result
run cost$0.00
tokens0k
turns2
$ pip install spanixpython 3.11+
research_agent.py
1from claude_agent_sdk import query
2from spanix import watch, last_run
3
4stream = query(prompt=p, options=opts)
5
6async for msg in watch(stream, run="nightly"):
7handle(msg)
8
9print(last_run().summary())
$spanix serve0.1127.0.0.1:7788live
the stream6 in · 0 kept
SystemMessageinit · model claude-opus-4 · cwd ~/agents
AssistantMessageToolUseBlock · WebFetch
UserMessageToolResultBlock · 6.2k tokens
AssistantMessageToolUseBlock · Task(research)
AssistantMessageTextBlock
ResultMessageusage 206k · $0.65 · 11 turns
said once. kept by nobody.
04 · pricing

Where the free part stops.

Every profiling feature is free and runs on your machine. The cloud only sells what localhost cannot do, like waking you up at 3am.

localFreeforever · Apache-2.0
  • one line around the stream you already have
  • call graph with cost on every node
  • timeline, retries and stuck tools
  • drift between one run and the next
  • SQLite on your disk, no network needed
No account, no telemetry, no limits.
cloudin development$19per dev · monthGo to checkout
  • everything in Local, unchanged
  • alert when a run's cost jumps
  • keeps watching after you close the terminal
  • every machine and CI job in one place
  • budget ceiling, webhook when it breaks
Metrics only. Your prompts never leave.