Provide native mechanisms for cost tracking
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 152
- Forks
- 16
- Avg merge
- 14h 48m
- Merged PRs (30d)
- 536
Description
I've had good luck asking Claude Code to examine it's own session logs to be able to estimate the costs for any action.
I'd like to have native support (tools) for the agent to be able to introspect it's own usage. Things that are useful:
- A way to get the number of tokens across multiple categories from the start of the session.
- A way to convert token to $ estimates based on a price sheet.
- A way to create a session "cost checkpoint" that gets stored with the session so that the agent can ask for token counts/costs between two checkpoints. Implicit checkpoint at "start" and "now"
- Cost reporting for sub-agents (including any deep hierarchies).
- All tokens are reported in the context of the model that is used there as the cost for tokens isn't totally equal.
There is context weight for each new tool so if we could make this one tool with options may be more efficient than having a set of tools that work together.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not name files, tests, or entry points, so first map the session, token-usage, pricing, checkpoint, and sub-agent areas of the repository. Done should include native usage and cost reporting across token categories, models, checkpoints, and nested sub-agents, with the design fitting the proposed tool approach.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100