Skip to main content

Token Minimization Harness

A small, modular CLI that reads one harness.toml and generates concise instructions for Claude Code, Google Antigravity, Codex, and Cursor. Target-specific generation lives behind adapters, so additional agent formats can be added without coupling their file formats to the CLI.

Requirements

Python 3.10 or later.

Install and use

pipx install .
# or with uvx / pip:
uvx --from . token-harness --help
python -m pip install -e .

Run commands:

token-harness init
token-harness doctor
token-harness index
token-harness lookup <symbol> --source
token-harness filter -- python -m unittest discover -s tests -v
token-harness bench --trials 5
token-harness bench --suite path/to/swe_bench_lite.jsonl --trials 5
token-harness mcp
token-harness proxy --port 8787 --redact-secrets

Or run without installing:

python -m token_harness init
python -m token_harness doctor
python -m token_harness bench --trials 5

Both commands accept an optional project directory. init creates harness.toml and files for its selected targets. It will not replace modified target files unless --force is provided; it never replaces an existing manifest. doctor checks manifest validity, generated files, instruction line budgets, target-specific frontmatter, and whether target commands are on PATH. Missing agent commands are warnings, not failures.

Manifest

schema_version = 1
profile = "balanced" # minimal, balanced, aggressive
targets = ["claude-code", "antigravity", "codex", "cursor"]
cache_safe = true
instruction_line_limit = 50

[integrations]
output_filter = "rtk"
context_proxy = "headroom"
symbol_indexer = "user-configured"

Integration values document the user's preferred external tools; the harness does not install, bundle, or invoke them. cache_safe keeps generated guidance from asking an agent to rewrite prior conversation history; it does not configure or guarantee provider-side prompt caching. Profile names tune generated guidance, not vendor-specific reasoning controls.

Generated files include CLAUDE.md, GEMINI.md and an on-demand Antigravity skill/rule, AGENTS.md, and scoped Cursor rules. AGENTS.md is also used by Codex. Specialized review guidance is opt-in in Cursor, and Antigravity's skill is available on demand rather than placed in always-on instructions.

Benchmarks

Reproducible 5-trial A/B results from benchmarks/report.md (balanced profile, cache_safe=True):

  • Overall token reduction: 58.83% (11802.0 -> 4859.0 est. tokens)
  • Mean KV-cache hit ratio: 0.88 | Preservation rate: 100.0%
Task Baseline Tokens Harness Tokens Reduction Turns
symbol_lookup 765 619 19.08% 2 -> 1
cli_output_filter 968.0 142.0 85.33% 1.0 -> 1.0
payload_compression 2431.0 200.0 91.77% 1.0 -> 1.0
instruction_budget 7638.0 3898.0 48.97% 6.0 -> 6.0

Development

python -m unittest discover -s tests -v

Metadata

Release files for save-token-harness 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for save-token-harness 0.1.0
File Size Uploaded Provenance Actions
save_token_harness-0.1.0.tar.gz 35.9 kB Without provenance Details for save_token_harness-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for save-token-harness 0.1.0
File Interpreter ABI Platform Actions
save_token_harness-0.1.0-py3-none-any.whl Python 3 none any Details for save_token_harness-0.1.0-py3-none-any.whl

Total release size: 75.4 kB

Release files / save_token_harness-0.1.0.tar.gz

Download URL save_token_harness-0.1.0.tar.gz
Size 35.9 kB
Tags Source
SHA-256 checksum
How to use checksums
245cfcd1fbc20379750f9c427a41289deb1c0053a061e0562af01e0fba306d03
BLAKE2b-256 checksum
How to use checksums
ddd9cc3b7668867cdabcde95185fcd9e49f8c50de6678611389ebc5933389f40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.7

Release files / save_token_harness-0.1.0-py3-none-any.whl

Download URL save_token_harness-0.1.0-py3-none-any.whl
Size 39.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af83a73fa818eea8512928c9cfa3be8bec47f1281676fd70210696f51456dbac
BLAKE2b-256 checksum
How to use checksums
c43645b37e1f7896090a34289abd3bdf6cdf97cfc79a1eeeaa69ed84b1273355
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.7

Security for save-token-harness 0.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page