You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Log cost of session to disk (ideally in a structured way) #2622
I would like to generate a cost report showing me how much I spend per project/directory per day.
Would be great to have something logged in JSON, ideally structured (eg. some field called total_cost_usd), in the context of a timestamp (eg. end of session if logging the total cost accrued throughout a session) as well as the project.
One simple way to do this would be to add a jsonl line to the .jsonl files in ~/.claude/projects/ after exiting claude, with the some session cost metadata?
Reacted by Alvaro Sevilla, Emmanuel Pire, Tino, Sean McKenna, Mat, Jake Mc, Janek Lasocki-Biczysko and Raman Hafiyatulin
Both of the above have been closed as a duplicate of this issue. This issue requests it logged to disk. The other two tickets request the existing behaviour be reinstated.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.
Activity
lipsumar commentedon Jul 8, 2025
This would also be super useful to get costs for cancelled non-interactive sessions (where the last "result" message is not received)
startswithaj commentedon Oct 31, 2025
When exiting CC would log the cost for that session. Its now been removed as a feature.
#9293
#9463
Both of the above have been closed as a duplicate of this issue. This issue requests it logged to disk. The other two tickets request the existing behaviour be reinstated.
github-actions commentedon Dec 10, 2025
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
janeklb commentedon Dec 10, 2025
Bump
github-actions commentedon Jan 11, 2026
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
github-actions commentedon Jan 19, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.