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 HOL Guard

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.

Tokens: exact, from the agent's own log. Money: an estimate at list prices; your bill may differ (plan, contract rates, batch, cloud provider). Cursor and Copilot Chat keep no token counts, so for them tokens are estimated from the size of the text.

📖 Help and guides · ▶ Take the report tour · 1-minute video · pictures use a made-up demo chat

Install

One line adds /sessioncost to every agent on your computer: Claude Code, Codex, Cursor, Antigravity and GitHub Copilot. It needs neither Python nor Git. Open a terminal, paste the line for your computer, and press Enter:

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

It ends with /sessioncost added for each agent it found. Then restart your agent.

Prefer PyPI (python -m pip install -U sessioncost, then python -m sessioncost setup), npm (npx sessioncost, then npx sessioncost setup) or your agent's plugin list (Claude Code: claude plugin install sessioncost --marketplace kish21/sessioncost --scope user; --scope user = every folder, not one)? Every way, step by step: Install SessionCost.

Use it

Open any chat and type /sessioncost (or ask: "run sessioncost"). The report opens in your browser.

/sessioncost in a Claude Code chat

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.

Recommended rules and fix cards

New to the report? Your first report walks through it in five minutes, and every section of the report has a ? that opens its help page.

Commands

You need two. Type them in a chat, in any agent (Claude Code, Codex, Cursor, Antigravity, Copilot):

In a chat What it does
/sessioncost Builds the report of this chat, gives you its link and names the top fix. Say "fix it" and your agent fixes the waste, after your yes
/liveguard off The guard is on from install, for every chat, in every agent: it checks each step before it runs, blocks the dangerous ones and asks before the risky ones. It is a safety net for an agent's mistakes, not a wall against a determined attacker. /liveguard off turns it off, /liveguard turns it back on

Everything else is optional. When the guard asks about a step that is normal for your project, its message gives you the exact line to send so it stops asking; you do not need to remember it.

Optional, in a chat What it does
/sessioncost fix Lists this project's token waste with the change for each, and applies it on your yes (with a backup; /sessioncost fix --undo puts it back)
/sessioncost fix auto off On from install: after each answer, your agent lists new waste at your next message and asks before fixing. off stops it, on starts it again
/sessioncost update Updates SessionCost, then restart your agent
/sessioncost version Shows which SessionCost version this agent uses
/sessioncost clean Deletes old reports, keeps the latest

Terminal commands, report options and the guard's settings: Commands.

Private

  • Reads your agent's log on your computer. No AI model is called.
  • Nothing is sent anywhere: the report is one file on your computer.

More: Privacy and security.

More

MIT license · made by kish21

Metadata

Release files for sessioncost 1.2.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 sessioncost 1.2.0
File Size Uploaded Provenance Actions
sessioncost-1.2.0.tar.gz 339.2 kB Without provenance Details for sessioncost-1.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 721.6 kB

Release files / sessioncost-1.2.0.tar.gz

Download URL sessioncost-1.2.0.tar.gz
Size 339.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b964be3fc03e3a844c3f630aba6e5d83e543c66901680d69ddf599e9bcfa83c6
BLAKE2b-256 checksum
How to use checksums
7c86f0dbf9d376a7d3575ab971fcaa8ec494556304300adfa4156a1d19de1051
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-1.2.0-py3-none-any.whl

Download URL sessioncost-1.2.0-py3-none-any.whl
Size 382.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
356cf692a699384505acca488ccd8ef0b94e0800f10674a5d43671d4d5d7b64a
BLAKE2b-256 checksum
How to use checksums
08efbdf63511dc661e0117430006614102d7cd83c996030c1bdfe415ca42f265
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 1.2.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

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