agentwaste
Your AI coding agent is wasting tokens. Find out where, and how to stop it.
Documentation · Quickstart · How it works · Contributing
Try it in 10 seconds
uvx 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 agentwaste # or: pipx install agentwaste, or: pip install agentwaste
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
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
- On PyPI:
uvx agentwaste,pipx install agentwaste,pip install agentwaste - 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
Metadata
Release files for agentwaste 0.1.1
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 | |
|---|---|---|---|---|
| agentwaste-0.1.1.tar.gz | 30.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentwaste-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 48.4 kB
Release files / agentwaste-0.1.1.tar.gz
| Download URL | agentwaste-0.1.1.tar.gz |
|---|---|
| Size | 30.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d6a082a6763acb81b150a7fddb95504705979ceeb9213fced4baf2cf9b9619f
|
|
BLAKE2b-256 checksum How to use checksums |
0886a7ebcddee9cb92c7cbb7b311c00cd63e4aac002b223e91d88961ff955a62
|
| 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 logRelease files / agentwaste-0.1.1-py3-none-any.whl
| Download URL | agentwaste-0.1.1-py3-none-any.whl |
|---|---|
| Size | 18.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cc3c0e5437667f922ac3d1975fa8d1a8b0bae9d99ac64110567e22b6ee45dd57
|
|
BLAKE2b-256 checksum How to use checksums |
b23cf27ae107b17dd8bfd68b79834e0657b878f4abc64a20f4570e9bc53fe88c
|
| 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 logSecurity for agentwaste 0.1.1
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.
Attestation for agentwaste-0.1.1.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 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.