Expose per-session cost to hooks / TUI (or add the a cost session section in the TUI)
まだ誰も着手していません。
評価
調査の方向性
まず PreToolUse、PostToolUse、Stop、SessionStart の hook payload を追跡し、次にセッションのトランスクリプト JSONL と、issue で言及されている既存の /internal/usage/summary パスを調査します。ターンごとの使用量とモデルのデータを hooks 経由で公開できるか、トランスクリプトに永続化できるか、またはセッションに対して返せるかを判断します。完了とは、TUI に表示するために現在のセッションのコストを取得する、サポートされた方法が 1 つあることを意味します。
索引モデルが issue の本文から書いたものです。
説明
Feature Description
Today hooks (PreToolUse/PostToolUse/Stop/SessionStart) receive a stdin payload with tool_input/tool_response, but it does not include the
LLM usage (input/output/cache tokens) or the model per turn. Also, the session transcript JSONL
(~/.commandcode/projects//.jsonl) persists only the message content, not the usage.
I know CommandCode already computes usage internally (it powers the "updated" indicator in the TUI) and exposes /internal/usage/summary at
the account level, but there's no way to see the accumulated cost of the current session from outside.
Request: include usage (input_tokens, output_tokens, cache_read_input_tokens, cache_creation_input_tokens) and model per turn in the hook
payload, and/or persist that usage in the transcript JSONL. That would let a Stop/SessionStart hook display the session cost in the TUI via
systemMessage without patching the dist. As an alternative, an endpoint like /internal/usage/summary?sessionId= would return per-session
cost directly. Or add a cost session section in the TUI.
Would this be something you'd consider for upcoming hook events?
Use Case
No response
Additional Context
As a developer who runs long, multi-turn coding sessions with Command Code, I want to see the running cost of the current session directly
in the TUI so I can make informed decisions without leaving the terminal — for example, stopping or switching models when a session is
getting expensive, comparing cost across models (non-open vs. open models) on the same task, or tracking spend per project/client for billing.
Today the only cost visibility is the account-level /internal/usage/summary (after the fact, mixed across all sessions) or the internal
"updated" indicator, neither of which tells me what the session I'm actively in is costing. If per-turn usage and model were exposed to
hooks (or persisted in the transcript), I could write a small Stop/SessionStart hook that prints the live session cost as a systemMessage in
the feed — no dist patching, fully under my control.
How important is this to you?
Ver important.
- 主要言語
- 言語のデータがありません
- スター
- 4k
- フォーク
- 350
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CommandCodeAI/command-code のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
CommandCodeAI/command-code#855 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
CommandCodeAI/command-code#841 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
CommandCodeAI/command-code#655 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
CommandCodeAI/command-code#608 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
CommandCodeAI/command-code#893 ·
CommandCodeAI/command-code の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
JuliusBrussee/caveman#1102 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
use-agent-os/agent-os#3263 ·
-
[Bug]: context-limit error parsing has no pattern for llama.cpp's "context size (N tokens)" phrasing オープンarea/compression area/local-models area/sessions comp/agent duplicate P2 sweeper:risk-session-state type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NousResearch/hermes-agent#117793 · コメント 1 件 ·
-
possible bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
Mintplex-Labs/anything-llm#6415 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100