Skip to main content

agentwaste

Your AI coding agent is wasting tokens. Find out where, and how to stop it.

CI Docs Python 3.10+ License: MIT

Documentation · Quickstart · How it works · Contributing

agentwaste report: 41% waste, grade D, with re-caching after idle breaks as the top finding and a fix for each pattern

Try it in 10 seconds

uvx --from git+https://github.com/nikghodki/agentwaste agentwaste

That's it: no install, no account, no config. It reads the Claude Code logs already on your machine and prints a report. No history yet? Add --demo.

Want the agentwaste command permanently? Install it once:

uv tool install git+https://github.com/nikghodki/agentwaste      # or: pipx install git+https://github.com/nikghodki/agentwaste

The examples below use the installed command. Without installing, put uvx --from git+https://github.com/nikghodki/agentwaste in front of them.

Why

Usage trackers tell you how much you used. agentwaste tells you why, and how much of it was avoidable.

On one developer's month of Claude Code use, about a third of all input cost was re-caching the conversation after stepping away for more than five minutes. Nobody noticed, because nothing showed it.

Whether you pay per token or hit subscription limits, that's waste you can fix in minutes once you can see it.

What it finds

Pattern What's happening The fix
⏸️ Idle cache rebuild You step away, the 5-minute prompt cache expires, and the next message re-writes the whole context at 1.25x /compact before a break, or the 1-hour cache
🔁 Uncached context Every turn re-sends the conversation without caching, often because a proxy drops cache markers Fix the proxy so caching survives
📄 Re-read The agent re-reads a file it already read, with no change in between Put the facts in CLAUDE.md
🔍 Duplicate call The same search or fetch runs again with nothing changed Reuse results, search more precisely
📦 Huge result One 10k+ token output, carried in every later message head, filters, ranged reads
💥 Error thrash The same tool fails 3+ times in a row Give the agent the missing context

Every finding comes with its cost, the worst offenders and a specific fix. Exact definitions →

Share your grade

Shareable agentwaste card: grade D, 41% of input tokens wasted, top categories re-caching after idle breaks, huge tool outputs and uncached context
agentwaste --card my-card.html

A one-file card with your grade and top waste categories, ready to screenshot and post. It contains aggregates only: no paths, project names, commands or code. A test enforces that on every change.


More options

agentwaste --days 7               # last week only (default 30; 0 = everything)
agentwaste --usd-per-mtok 3       # dollar estimates at $3 per million input tokens
agentwaste --json > waste.json    # machine-readable, for scripts and dashboards
agentwaste --demo                 # try it on synthetic sessions

Full reference: CLI · JSON output

Private by design

  • Local and read-only. No network requests, nothing uploaded, your logs are never changed.
  • No dependencies. Plain Python 3.10+, so there's nothing hidden to audit.
  • Honest numbers. Costs are in token-equivalents that weight cache writes, cache reads and fresh input the way they're actually billed. Self-hosted models are reported separately, since their cost is GPU time, not tokens.

Roadmap

  • Claude Code support, six detectors, report, JSON, shareable card
  • Codex support
  • pip install agentwaste / uvx agentwaste from PyPI
  • Live warnings while you work ("your cache expires in 1 minute")
  • Before/after comparison: did the fix actually help?

Ideas and votes welcome in issues.

Contributing

Contributions are very welcome, especially new log sources (Codex, Gemini CLI, OpenCode) and new detectors. Start with CONTRIBUTING.md:

git clone https://github.com/nikghodki/agentwaste && cd agentwaste
python3 -m venv .venv && .venv/bin/pip install -e ".[dev]" && .venv/bin/pytest

The original AgentSight SDK lives on in legacy/agentsight.

License

MIT

Metadata

Release files for agentwaste 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 agentwaste 0.1.0
File Size Uploaded Provenance
agentwaste-0.1.0.tar.gz 29.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agentwaste 0.1.0
File Interpreter ABI Platform
agentwaste-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 47.2 kB

Release files / agentwaste-0.1.0.tar.gz

Download URL agentwaste-0.1.0.tar.gz
Size 29.4 kB
Tags Source
SHA-256 checksum
How to use checksums
90317cbd9a6a7b08af621fc5f38dc8df214f02a667ac1af82d5d681f8987c415
BLAKE2b-256 checksum
How to use checksums
55df09946d140c96fbc7c399f00eb600adbe98e1b208fca04ecb052e5a2b617a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 26, 2026.

Transparency log

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

Download URL agentwaste-0.1.0-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ddb2e4558b20c207a916c995ffe85431c59e877e864dd95ceae6f3ed96f2d9d
BLAKE2b-256 checksum
How to use checksums
fe985860df22fcfc3669b74b5308bd1d25a2a86b550eae3f4854bd8c1dc83ccb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 26, 2026.

Transparency log

Security for agentwaste 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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agentwaste-0.1.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 Oct 26, 2026.

Transparency log

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 Full 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