Skip to main content

SessionCost

See where every token of your AI coding chat went, and what to fix to send fewer.

PyPI License: MIT Works with

Every turn of a chat on one path; tap a turn to see the calls inside it

Every message you send makes the agent send the whole chat again. SessionCost shows each turn on one path, the calls inside it, and the fixes that would have sent less, measured from your own chat.

▶ 1-minute video tour · pictures use a made-up demo chat

Install

Open a terminal, paste one line, press Enter. No Python or Git needed.

Windows (PowerShell) irm https://raw.githubusercontent.com/kish21/sessioncost/main/install.ps1 | iex
Mac / Linux curl -fsSL https://raw.githubusercontent.com/kish21/sessioncost/main/install.sh | sh

Restart your agent and type /sessioncost in any chat. The report opens in your browser.

/sessioncost in a Claude Code chat

What you get

How much was sent, and how much the fixes would cut

9.9M tokens sent, 5.4M with the fixes, and the three biggest fixes

What to fix: each fix with its saving and the rule to paste to your agent. Tick "I did this" and it stops repeating.

Recommended rules and fix cards

Deeper fixes: one button checks 30 more patterns, from a catalog built on 200+ real agent sessions.

After the deeper fixes: 9.9M tokens sent, 2.8M with all 16 fixes

Private

  • Reads your agent's log on your computer. No AI model is called.
  • Nothing is sent unless you press Send the summary to the fix engine, and then only numbers and yes/no marks, never your chat, code or file names. The report shows the exact summary first.
  • Don't want the button? sessioncost --engine-url off.

More

Which agents, and how exact
Agent Tokens
Claude Code exact, from its log
Codex exact, from its log
Antigravity exact, from its log
Cursor estimated from text size; exact with your usage export (--cursor-usage file.csv)
Use it from a terminal
sessioncost                 # the newest chat of this folder's project
sessioncost list            # recent chats
sessioncost 3f2a9c1e        # one chat, by the start of its id
sessioncost setup           # add /sessioncost to your agents again
sessioncost clean           # delete old reports, keep the latest

Options: --no-open, --json, --subscription (money as API-equivalent on Pro/Max plans), --design classic, --engine-url off.

Update, or fix a problem
  • Update: paste the install line again, then restart your agent.
  • /sessioncost does nothing: restart the agent after installing.
  • Windows says scripts are disabled: run powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/kish21/sessioncost/main/install.ps1 | iex".
  • Prefer pip: pip install sessioncost, then python -m sessioncost setup.
  • Claude Code plugin (needs Git and Python): /plugin marketplace add kish21/sessioncost, then /plugin install sessioncost@sessioncost.
  • The deeper fixes take a while: the engine sleeps when idle; the first check can take up to a minute.
How the money is counted

Each kind of token is priced on its own: new input, written to the cache, re-read from the cache (about a tenth of the price), and output. Prices are the public API's, dated in the report; override them in ~/.sessioncost/prices.json. On a subscription, --subscription labels the money as API-equivalent.

MIT license · made by kish21

Metadata

Release files for sessioncost 0.5.4

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

Source distribution (sdist)

Source distribution for sessioncost 0.5.4
File Size Uploaded Provenance
sessioncost-0.5.4.tar.gz 136.4 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 282.6 kB

Release files / sessioncost-0.5.4.tar.gz

Download URL sessioncost-0.5.4.tar.gz
Size 136.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b6a3c898341119c6f31930c8a5d4a4867ce48559cd1d520c8ab487d3d9a5672f
BLAKE2b-256 checksum
How to use checksums
e893e40cd1efca56332cc4e53ff08d9ed688830137bab185f0ab4f71ec648d5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.16 {"installer":{"name":"uv","version":"0.12.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / sessioncost-0.5.4-py3-none-any.whl

Download URL sessioncost-0.5.4-py3-none-any.whl
Size 146.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98ba08b1bead5b14aac50e0a4947bcee85761e60a81b860a77d60d472470110f
BLAKE2b-256 checksum
How to use checksums
8291679811408589972c430211c14e5a70ffd3b3960db81a88f06962ba834761
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.16 {"installer":{"name":"uv","version":"0.12.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for sessioncost 0.5.4

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.

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