AgentCost
pre-flight token + cost estimate before your AI coding session burns your wallet
Get Pro →Ever run into this?
AI coding agents (Claude Code, Cursor, Copilot) silently load your entire project context before you type a single prompt — you have zero visibility into spend until the bill arrives. A bloated CLAUDE.md or accidentally-included file can cost dollars per session with no warning. There is no pre-flight check.
The fix
npx agent-cost scans your project, tokenizes every AI context file (CLAUDE.md, AGENTS.md, .cursorrules, git diff), and prints a per-file cost breakdown across Claude, GPT-4o, and Gemini before you start.
What it does
- Tokenizes CLAUDE.md, AGENTS.md, .cursorrules, .clinerules, and .github/copilot-instructions.md with per-file token counts
- Estimates session input cost across Claude Sonnet, GPT-4o, and Gemini Flash using a hardcoded price table updated at each publish
- Flags token bombs — files over 2,000 tokens likely to be auto-pulled into context — in red with a byte-trim suggestion