feature: agentop observe — group sessions and cost by working directory
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with cmd/agentop/tui/sessions_pane.go, session_metadata.go, and sessions_title.go, then read the read-claude-sessions harvest in cmd/agentop/cmd_experimental.go and the Agents pane breakdown. The issue leaves key decisions open about directory source, grouping rules, changed working directories, and API exposure. Done means directory grouping and cost totals are available in the Sessions pane and agentop cost, with corresponding updates to cmd/agentop/README.md.
索引モデルが issue の本文から書いたものです。
説明
Problem
agentop observe now shows the cost of each session, so it is easy to see which tasks cost the most. Answering "where did my tokens go this month?" still means adding up sessions by hand, because nothing groups them by the project they ran in. The working directory is the natural key for that: one repo or checkout is usually one project.
Today the directory only appears by accident. The Claude Code title harvest (~/.cortex/session-metadata.json) falls back to the working directory as a session's title when the transcript has no model-generated one, so some rows show a path in TITLE and others don't. Codex, Bob, OpenCode and Pi sessions show no directory at all.
Proposal
Record each session's working directory and let the viewer group and total by it:
- A
DIR(orPROJECT) column in the Sessions pane, separate fromTITLE. - A way to group or scope by directory, like the Agents pane does by agent: one row per directory with
SESSIONS,LAST SEENandCOST <window>, and↵scopes sessions, usage and the$band to it. - The same breakdown in
agentop cost, so a monthly total per directory can be scripted.
Open questions:
- Where does the directory come from per agent? Claude Code records
cwdin its transcripts (the title harvest already reads them). Codex records it in its session files. For other agents it may need the process's cwd, looked up from the pid the proxy already attributes calls to. - Group by the exact path, or by repository root (so
repo/andrepo/sub/count together)? Worktrees under.claude/worktrees/probably belong with their repo. - A session whose directory changes partway through (
cdin a shell agent): first directory, or last? - Is the path sensitive enough to keep out of the session API by default? It is already in
session-metadata.jsonfor Claude Code.
Context
Requested in #cortex-community by @vinodmut (2026-11-09), who uses the per-session cost to compare models and agents (Codex vs Claude Code) and to account for monthly token use.
Where it lives
cmd/agentop/tui/sessions_pane.go,session_metadata.go,sessions_title.gocmd/agentop/cmd_experimental.go(read-claude-sessionsharvest)- The Agents pane, as the model for a per-directory breakdown
cmd/agentop/README.md: the Sessions pane section and the column table
Assisted-By: Claude (Anthropic AI) [email protected]
- 主要言語
- Go
- スター
- 26
- フォーク
- 46
- 平均マージ
- 13時間 49分
- マージ済み PR(30日)
- 244
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rossoctl/cortex のほかの issue
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
Feat: Keep coding agents working when the Cortex proxy stops対応中かも @huang195 が今日担当しました。 オープン
rossoctl/cortex#1738 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Phase C: Let Praxis core accept CONNECT and decrypt, and remove the Go front door対応中かも @huang195 が 2 日前に担当しました。 オープンlaptop
rossoctl/cortex#1728 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Phase D: Move the Cortex store, pricing, session API and attribution into the binary対応中かも @huang195 が 2 日前に担当しました。 オープンlaptop
rossoctl/cortex#1727 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Phase B: Send absolute-form requests to Praxis and remove the egress listener対応中かも @huang195 が 2 日前に担当しました。 オープンlaptop
rossoctl/cortex#1726 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
rossoctl/cortex の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
php/frankenphp#2829 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
teradata-labs/loom#624 ·
メンテナーはふだん 1 日以内に返信