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
CLI: record per-turn token usage and model in chat-messages.json #1779
tokenmaxxing.sh, a public leaderboard for AI coding agent usage, counts usage through ccusage, which reads the session files coding agents leave on disk. Our users asked us to support Freebuff (851-labs/tokenmaxxing#185), but Freebuff usage can't be counted today: its chat files carry no token counts and no model name.
Tested with Freebuff 0.2.38 (CLI, signed in, two short prompts on the default DeepSeek V4.1 Flash Fast). Chats land in ~/.config/manicode/projects/<project>/chats/<id>/, the same layout as the Codebuff CLI, but every assistant message in chat-messages.json looks like this:
run-state.json only has the current contextTokenCount and creditsUsed: 0, and log.jsonl names the model by an opaque id. Older builds kept the run state, usage included, in the message metadata; that has since moved out of chat-messages.json.
What would you like to happen?
Record per-turn usage on each assistant message in chat-messages.json, for example:
metadata.usage: input, output, cache read and cache write tokens
metadata.model: the provider model id, e.g. deepseek/deepseek-v4-flash
ccusage's codebuff reader already reads these fields. Adding them by hand to one message of the test chat made that turn show up with the right tokens and cost, so nothing else would be needed on the reading side.
Activity