Expose per-session cost to hooks / TUI (or add the a cost session section in the TUI)
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Beginne damit, die Hook-Payloads für PreToolUse, PostToolUse, Stop und SessionStart nachzuverfolgen, und untersuche anschließend das JSONL des Sitzungstranskripts sowie den im Issue erwähnten bestehenden Pfad /internal/usage/summary. Ermittle, ob Nutzungs- und Modelldaten pro Turn über Hooks offengelegt, in Transkripten persistiert oder für eine Sitzung zurückgegeben werden können; abgeschlossen bedeutet, dass es eine unterstützte Möglichkeit gibt, die Kosten der aktuellen Sitzung für die TUI-Anzeige zu erhalten.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Keine Sprachdaten
- Sterne
- 4k
- Forks
- 350
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus CommandCodeAI/command-code
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
CommandCodeAI/command-code#855 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
CommandCodeAI/command-code#841 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
CommandCodeAI/command-code#655 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
CommandCodeAI/command-code#608 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 70/100
CommandCodeAI/command-code#893 ·
Alle Issues in CommandCodeAI/command-code
Ähnliche Issues
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
JuliusBrussee/caveman#1102 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 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 Offenarea/compression area/local-models area/sessions comp/agent duplicate P2 sweeper:risk-session-state type/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
NousResearch/hermes-agent#117793 · 1 Kommentar ·
-
possible bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Mintplex-Labs/anything-llm#6415 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100