axor-benchmarks
Benchmark governed (axor) vs raw Claude on your codebase.
Measures real token savings, latency, and federation across 4 benchmark suites on any Python project.
Safety note: the raw baseline is intentionally ungoverned. It can write files and run shell commands while benchmarking. Use
--no-rawoutside disposable workspaces or trusted repositories.
Installation
pip install axor-benchmarks
Quick Start
cd ~/my-project
axor-bench
Runs quick suite (1 small task, ~30s). Use --suite full for complete benchmark.
Authentication
Priority order (highest to lowest):
--api-key sk-ant-...flagANTHROPIC_API_KEYenv var~/.axor/config.toml(set viaaxor claude → /auth)
# Use env var
ANTHROPIC_API_KEY=sk-ant-... axor-bench
# Use flag (not saved)
axor-bench --api-key sk-ant-...
# Use saved key from axor-cli
axor claude # → /auth → saves to ~/.axor/config.toml
axor-bench # reads automatically
Suites
| Suite | Tasks | What it measures |
|---|---|---|
quick |
1 task | Fast sanity check (~30s) |
small |
3 tasks | Single-turn focused tasks |
large |
2 tasks | Multi-tool, multi-step tasks |
conversation |
1 × 10 turns | Context growth over long sessions |
federation |
1 task | Child agent spawning + isolation |
full |
all | Complete benchmark (~5-10 min) |
axor-bench --suite small # fast
axor-bench --suite full # complete
axor-bench --suite conversation # test context compression
axor-bench --suite federation # test child agents
Options
axor-bench [options]
--api-key KEY Anthropic API key
--repo PATH Repo to benchmark (default: current dir)
--file PATH Specific file to use as context
--suite SUITE quick | small | large | conversation | federation | full
--model MODEL Model ID for both runners (default: claude-sonnet-4-5)
--no-raw Skip raw Claude baseline (governed only)
--delay SECONDS Pause between tasks to avoid rate limits (default: 0)
--output FORMAT table (default) | json
Results (claude-sonnet-4-5, full suite)
Benchmark ran against axor-cli/axor_cli/auth.py (~340 LOC) from the axor monorepo.
| Task | Suite | Raw tokens | Governed | Savings | Policy |
|---|---|---|---|---|---|
| write_test | small | 8,693 | 10,855 | -24.9% | focused_generative |
| explain_function | small | 3,022 | 2,901 | +4.0% | focused_readonly |
| find_bugs | small | 3,265 | 3,251 | +0.4% | focused_generative |
| refactor_module | large | 97,370 | 66,005 | +32.2% | moderate_mutative |
| add_error_handling | large | 19,663 | 19,391 | +1.4% | focused_generative |
| iterative_review | conversation (10 turns) | 117,465 | 70,298 | +40.2% | focused_generative |
| parallel_analysis | federation | — | 17,698 | — | preset:federated |
| TOTAL | 249,478 | 172,701 | +30.8% |
Key insights:
- 30.8% total token reduction (249K → 173K tokens)
- 40.2% savings on multi-turn conversation — context compression effect grows with session length
- 32.2% savings on large refactoring — caching and dedup reduce repeated file reads
- Small single-turn tasks show near-zero or negative savings — governance overhead > compression benefit on short tasks
- Federation task (17.7K tokens) ran with
federatedpolicy preset
Small tasks (write_test, explain, find_bugs) show minimal savings because the context is not yet large enough for compression to outweigh governance overhead. Savings become significant at 10K+ tokens (large/conversation tasks).
What is measured
Raw Claude — direct Anthropic API call with no governance:
- Full conversation history passed every turn
- No context compression
- No policy selection
- No tool governance
Governed (axor) — same task via GovernedSession:
- Dynamic policy based on task (focused_readonly, moderate_mutative, etc.)
- Context shaped and compressed per turn
- Waste elimination (dedup, error collapse, prose summarization)
- Session-scoped cache (no re-reading same file twice)
Token savings = (raw - governed) / raw × 100%
Positive = governed uses fewer tokens (expected for most tasks). Negative = governed uses more (possible for very simple tasks where overhead > savings).
Requirements
- Python 3.11+
axor-core>= 0.5.0axor-claude>= 0.2.0anthropic >= 0.40.0
Ecosystem
| Package | Role |
|---|---|
axor-core |
Governance kernel — what this package benchmarks |
axor-claude |
Claude adapter — used for both raw and governed runs |
axor-cli |
Governed terminal runtime |
axor-langchain |
LangChain governance middleware |
axor-classifier-simple |
ML task signal derivation (optional) |
axor-memory-sqlite |
Cross-session memory (SQLite) |
axor-telemetry |
Privacy-preserving governance feedback |
License
MIT
Metadata
Release files for axor-benchmarks 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| axor_benchmarks-0.3.0.tar.gz | 19.4 kB | With provenance | Details for axor_benchmarks-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| axor_benchmarks-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for axor_benchmarks-0.3.0-py3-none-any.whl |
Total release size: 38.6 kB
Release files / axor_benchmarks-0.3.0.tar.gz
| Download URL | axor_benchmarks-0.3.0.tar.gz |
|---|---|
| Size | 19.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c34f8a2a808e1121fa3871290f64e0d561ebb95f23862c1046aa9f7edb958af7
|
|
BLAKE2b-256 checksum How to use checksums |
3b35375899d2a37371d449621f466e6c395e653547dcda9dc6e5071a975cb01a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 25, 2026.
Transparency logRelease files / axor_benchmarks-0.3.0-py3-none-any.whl
| Download URL | axor_benchmarks-0.3.0-py3-none-any.whl |
|---|---|
| Size | 19.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1c273360bf9ecc052597911b8040f1f664d358efb99711414e4c19bd20141414
|
|
BLAKE2b-256 checksum How to use checksums |
3f9e0db29bd44099488956260445ee4e1754b0977d3761c532b4e954912fcdf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 25, 2026.
Transparency logSecurity for axor-benchmarks 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for axor_benchmarks-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 25, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.