Skip to main content

spanix

A local profiler for AI agents. One line, no account, no server.

An agent SDK reports cost, tokens and duration on every message it streams. It reports them exactly once, and the caller's for loop throws them away. spanix stops throwing them away.

from claude_agent_sdk import query
from spanix import watch, last_run

stream = query(prompt=p, options=opts)

async for msg in watch(stream, run="nightly"):
    handle(msg)

print(last_run().summary())
spanix · nightly  22.6s
  cost      $0.6512
  tokens    206,431 (in 184,220 · out 8,911 · cache 13,300)
  turns     11
  messages  38
  tools     Read ×1, WebFetch ×5, Grep ×1

The message is yielded untouched, so the loop around it does not change.

Design

It never breaks your agent. Every recording path is wrapped in its own try, and the message is always yielded. A profiler that takes down production is a profiler nobody installs.

It never imports your agent SDK. Fields are read by name with fallbacks, so pip install spanix pulls in nothing, and supporting a second runtime is just another list of names. There are zero dependencies.

It never keeps content. Prompts, tool arguments and tool results carry API keys and customer data. Only counters and tool names are stored.

Status

0.0.1 is the accounting core: watch(), in-memory Run records and summary(). Nothing is written to disk and nothing is sent anywhere.

Next: SQLite at ~/.spanix/runs.db, the subagent tree with cost rolled up per node, and a panel on localhost.

License

Apache-2.0

Download files

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

Source Distribution

spanix-0.0.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

spanix-0.0.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file spanix-0.0.1.tar.gz.

File metadata

  • Download URL: spanix-0.0.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for spanix-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8d1f3a2fd1d787e5879bb58faea97da2eb426185fc09897f18e54d8de353cfa9
MD5 e127a46ff33a737227e80f1bcafdb834
BLAKE2b-256 64947ff385336486161c493f24123a39e8c290b96a40feb70e2198c56499816a

See more details on using hashes here.

File details

Details for the file spanix-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: spanix-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for spanix-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 896b558937bc6359a5fca69d191e9089e6450e008a0248f8270bdeae035dddf8
MD5 2316c27004d73f87f13a8aee99b1ae32
BLAKE2b-256 aa9e5c1c561a0fe5d9c6e10686a765078bbcde953e89380026feacb0789c5b96

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 Sentry Error logging StatusPage Status page