Show both session-total and segment metrics when resuming/continuing a session
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?
When exiting a Claude Code session, the CLI shows useful metrics:
Total cost: $12.34
Total duration (API): 25m 10s
Total duration (wall): 2h 15m 30s
Total code changes: 500 lines added, 80 lines removed
Usage by model:
claude-opus-4-6: 8.0k input, 50.0k output, 15.0m cache read, 500.0k cache write ($12.20)
claude-haiku-4-5: 100.0k input, 700 output, 0 cache read, 0 cache write ($0.14)
When you resume or continue that session (--resume or --continue), do some more work, and then exit again, the metrics shown are cumulative from the beginning of the session - not from the point you resumed.
This makes it impossible to know how much the current segment of work cost. If I resumed a $12.34 session and the exit summary shows $15.50, I have to mentally subtract to figure out that the resumed segment cost $3.16.
What Should Happen?
When exiting a resumed/continued session, show both:
- Segment metrics - cost, duration, and usage for the current resume segment only
- Session total metrics - cumulative totals across all segments (what is shown today)
For example:
This segment:
Cost: $3.16
Duration (API): 8m 12s
Duration (wall): 25m 3s
Code changes: 120 lines added, 15 lines removed
Session total:
Cost: $15.50
Duration (API): 33m 22s
Duration (wall): 2h 40m 33s
Code changes: 620 lines added, 95 lines removed
This would give users clear visibility into both the incremental cost of each work segment and the cumulative session cost.
Steps to Reproduce
- Start a Claude Code session and do some work
- Exit - note the metrics shown
- Resume the session:
claude --resume <session-id> - Do some more work
- Exit again - the metrics shown are cumulative, with no way to see what the resumed segment alone cost
Claude Code Version
2.1.71
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗