Skip to content

Feature Request: Log cost of session to disk (ideally in a structured way) #2622

Closed as not planned

Description

@janeklb

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?

Activity

  1. lipsumar commented on Jul 8, 2025

    @lipsumar

    This would also be super useful to get costs for cancelled non-interactive sessions (where the last "result" message is not received)

  2. startswithaj commented on Oct 31, 2025

    @startswithaj

    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.

  3. github-actions commented on Dec 10, 2025

    @github-actions

    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.

  4. janeklb commented on Dec 10, 2025

    @janeklb
    Author

    Bump

  5. github-actions commented on Jan 11, 2026

    @github-actions

    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.

  6. github-actions commented on Jan 19, 2026

    @github-actions

    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.

  7. locked as resolved and limited conversation to collaborators on Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions