agent-cost-analyzer
v1.2.0Local, read-only analysis of agentic coding costs, caching and sessions from your own logs.
See where the tokens and money go when an AI agent writes code for you. This package runs the standalone Agent Cost Analyzer app: it reads the session logs that GitHub Copilot Chat, Claude Code and the pi coding agent already write on your machine and shows every session turn by turn. It also has a Learn mode with sample sessions, so it is useful before you have any data. Independent project; not affiliated with or endorsed by GitHub, Microsoft, Anthropic or the pi project. The app starts on http://127.0.0.1:5199 and opens in your browser.
Summary extracted from the README.
agent-cost-analyzer
Last changed: 2026-11-18 · Source: https://github.com/raulkivi/agent-cost-analyzer
See where the tokens and money go when an AI agent writes code for you. This package runs the standalone Agent Cost Analyzer app: it reads the session logs that GitHub Copilot Chat, Claude Code and the pi coding agent already write on your machine and shows every session turn by turn. It also has a Learn mode with sample sessions, so it is useful before you have any data.
Independent project; not affiliated with or endorsed by GitHub, Microsoft, Anthropic or the pi project.
Run it
Needs Node.js 22.18 or newer.
npx agent-cost-analyzer

The app starts on http://127.0.0.1:5199 and opens in your browser. If it is
already running, a second start opens that instance. If another program holds
port 5199, it takes the next free port (up to ten) and prints which.
npx agent-cost-analyzer@latest runs the newest release.
| Option | Does |
|---|---|
--port <n> |
Uses that port only; 0 takes any free port. Fails if the port is busy |
--no-open |
Starts without opening a browser |
--help, -h |
Prints usage |
--version, -v |
Prints the version |
Ctrl+C stops the app. It never listens beyond 127.0.0.1; there is no
--host option.
Ask your AI chat
agent-cost-analyzer mcp runs the same analysis as a read-only MCP server
over stdio, so an MCP client can answer "what drove my spend this week?". The
interactive views for hosts that support MCP Apps are included.

claude mcp add agent-cost-analyzer -- npx -y --prefer-offline agent-cost-analyzer mcp
--prefer-offlinestarts the cached copy at once when the npm registry is unreachable; without it,npxwaits about a minute of retries first.- On Windows, a client that does not resolve
.cmdfiles needscmd /c npx -y --prefer-offline agent-cost-analyzer mcp. - To run fully offline or on a pinned version, run
npm install -g agent-cost-analyzeronce, then registeragent-cost-analyzer mcpas the command. --project-billing-detailsaftermcpalso shares client names and billing codes with the client.
Privacy
- Everything runs on your machine; the app sends no data anywhere and makes
no network call of its own (
npxitself talks to the npm registry). - It only reads your tools' session logs. The one place it writes is its own
settings folder:
~/.config/agent-cost-analyzeron Linux,~/Library/Application Support/agent-cost-analyzeron macOS and%APPDATA%\agent-cost-analyzeron Windows. - The package has no dependencies and no install scripts, and each release carries an npm provenance attestation that links to the source commit.
More
- Setup and data sources
- User Guide
- Security policy and how to verify a release
- Changelog
- Report a problem
MIT licensed. Third-party licenses: THIRD-PARTY-NOTICES.md in this package.