[BUG] Claude code - Incorrect cost reporting in non interactive mode with `resume`
Resolved 💬 5 comments Opened Dec 26, 2025 by fivetran-heveshlakhwani Closed Feb 28, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
- Running
/costinside an interactive Claude Code session shows correct accumulated cost/usage. - Running the equivalent in non-interactive mode with resume (e.g.,
claude -p /cost --output-format json --resume <session-id>) returns $0.0000 and near-zero/empty usage, even though the session has prior usage.
Example observed output:
Total cost: $0.0000\nTotal duration (API): 0s\nTotal duration (wall): 3s\nTotal code changes: 0 lines added, 0 lines removed\nUsage: 0 input, 0 output, 0 cache read, 0 cache write
What Should Happen?
claude -p /cost --resume <session-id> should report the same accumulated totals as /cost does inside the interactive session for that session id (non-zero cost and model usage where applicable).
Error Messages/Logs
Steps to Reproduce
- Start a session with a fixed session id:
claude --session-id 00000000-0000-0000-0000-000000000000
- Prompt to do something
- In the interactive session, run:
/cost
Confirm it reports non-zero cost/usage
- Exit the session
- Run the non-interactive resumed command:
claude -p /cost --output-format json --verbose --resume 00000000-0000-0000-0000-000000000000
- Observe that it reports
$0.0000(and/or empty usage).
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.0.75
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
<img width="1728" height="1117" alt="Image" src="https://github.com/user-attachments/assets/6e6abda6-c0ad-4d93-a526-44befe94f815" />
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗