session-trace
/session-trace
Odczytuje przebieg wcześniejszej sesji z Arize Phoenix: buduje czytelny zapis, czasy kroków, zużycie tokenów i koszty.
- Autor
- nicsuzor ↗
- Repozytorium
- academicops ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 27.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 6
- Skrypty
- 3
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 27.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
- 3 skrypty w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.
Skrypty: scripts/phoenix_token_cost.py, scripts/phoenix_trace.py, scripts/phoenix_transcript.py
Co robi i kiedy
Odczytuje przebieg wcześniejszej sesji z Arize Phoenix: buduje czytelny zapis, czasy kroków, zużycie tokenów i koszty.
Wyzwalacze z opisu
Oryginalny opis (EN)
Read what a past session actually did from the Arize Phoenix span store -- assemble a readable markdown transcript with step durations, token usage and cost, answer "how did this decision get made", or query spans for tool calls, errors, latencies, token spend and subagent dispatches. Use when asked how or why an agent decided something, what a session or worker really ran, where time or tokens went, or to resolve values a local transcript truncated. Not for live tails, or for launching and driving a run.
Jak działa
- Transcript: how did this decision get made
- Other exports
- Ad-hoc queries
- Constraints
Podgląd SKILL.md
---
name: session-trace
description: Read what a past session actually did from the Arize Phoenix span store -- assemble a readable markdown transcript with step durations, token usage and cost, answer "how did this decision get made", or query spans for tool calls, errors, latencies, token spend and subagent dispatches. Use when asked how or why an agent decided something, what a session or worker really ran, where time or tokens went, or to resolve values a local transcript truncated. Not for live tails, or for launching and driving a run.
---
# Session Trace
Phoenix keeps every span whole: untruncated tool inputs and outputs, model output, token
counts and millisecond latencies. Read it rather than a session's own account of itself.
## Transcript: how did this decision get made
```bash
uv run python "${CLAUDE_SKILL_DIR}/scripts/phoenix_transcript.py" <session-id | slug | trace-id> --out <dir>/<slug>.transcript.md
```
- Configuration is flags or environment: `--base-url` or `$PHOENIX_MCP_URL` (the Phoenix
HTTP root), and `--project` or `$PHOENIX_MCP_PROJECT`. With neither flag nor variable set,
the script supplies no default value and halts. Spans already fetched another way render with
`--from-file spans.json`.
- One paged fetch on `session.id`; a thousand-span session takes seconds.
- It writes two files and prints the summary (totals, per-turn table, cost by model,
slowest steps, errors):
- `<slug>.transcript.md` -- the full record: one `## Turn N` per turn, one `### N.M`
per model or tool call with its duration, tokens and cost, payloads folded in
`<details>`, nothing truncated.
- `<slug>.outline.md` -- prompts, model calls with their text, and replies; each tool
call is one bullet under the model call that made it, labelled with the call's own
action summary (agy `toolAction`, Claude Code `description`), with a line beneath
naming what it acted on: the calls and literal arguments inside a code-mode block,
else the command, path or query.
Read the summary, then the outline for the turns that bear on the question. Open a step's
payload by its anchor (`grep -n 'id="t5-3"' <slug>.transcript.md`) rather than reading the
whole transcript, because that is where the cost goes. Answer with the turn and step
anchors where the decision was made, and hand back the transcript path.
To find the session: a full id, a slug, or a trace id all resolve. Given only a task or a
time, find the session with Recipe A or F in [references/sql-recipes.md](references/sql-recipes.md).
## Other exports
- `uv run python scripts/phoenix_trace.py <session-id>` -- the span forest as JSON (`full`, with
`roots` and `orphans`) and a controller view. Check `meta.session_error_count`,
`orphans`, `meta.trace_contamination` (traces shared with other sessions), and rank
`subagents[]` by `collapsed_span_count` for the expensive branches.
- `uv run python scripts/phoenix_token_cost.py --since <time>` -- spend ranked across sessions, or
`--by task`. Prices are list prices per million tokens; the dollar column is
comparable spend, not an invoice. Gemini spans may carry no token counts.
## Ad-hoc queries
The span store is also reachable through the `services` MCP proxy:
`portal_codemode_execute` calling `codemode.phoenix_execute` with an async Python block
that runs `await call_tool("executeSql", {"sql": ...})` (several per block is fine). Read
[references/span-store.md](references/span-store.md) before writing a query, then take
the recipe from [references/sql-recipes.md](references/sql-recipes.md).
## Constraints
- Filter on `session.id`, never `trace_id`: one trace can hold several sessions.
- Subagents share the dispatching session's `session.id`; a spawned worker session
carries no attribute naming its parent (Recipe F correlates them).
- Phoenix tool spans prove execution rather than logical entailment or sufficiency; auditing and QA must inspect durable primary deliverables rather than ephemeral container paths, evaluating whether observed evidence logically entails the claimed outcomes.
Pliki w paczce (6)
- SKILL.md 4 KB
- references/span-store.md 3 KB
- references/sql-recipes.md 9 KB
- scripts/phoenix_token_cost.py 31 KB
- scripts/phoenix_trace.py 46 KB
- scripts/phoenix_transcript.py 46 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · nicsuzor/academicops | 100 | MIT |
| nicsuzor/academicops | 100 | MIT |
Identyczna treść występuje jeszcze w 5 innych folderach na GitHubie. Tu pokazujemy jedną, najlepiej ocenioną kopię.
Migawka bazy z 13.11.2026 · wersja paczki 6ad80c71e0e7 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 95session-report
Analizuje zakończoną sesję Claude Code z pliku JSON: wydajność, koszty, jakość i zużycie tokenów. - 95tma1
Odpytuje dane obserwowalności TMA1: koszty agentów, zużycie tokenów, ślady, zdarzenia, błędy i porównania modeli. - 95tma1
Odpytuje dane obserwacyjne TMA1 z Claude Code, Codex i innych źródeł OpenTelemetry: koszty, zużycie tokenów, ślady i błędy. - 100arize-traces
Pobiera i debuguje dane śladów z platformy obserwowalności Arize: lista śladów, wyszukiwanie po ID, spany w śladzie, analiza opóźnień, tokenów i kosztów oraz eksport. - 95tmn-trace
Pokazuje dokładnie, co agent zrobił: polecenia, edycje, testy i zużycie tokenów, a opcjonalnie wysyła telemetrię do Langfuse, Phoenix lub kolektora OpenTelemetry. - 100token-audit
Audytuje lokalne zużycie tokenów i koszty Claude Code według modelu, projektu i sesji oraz buduje panel HTML.