Skip to content
Skills Library
Data & analytics · Analysis

session-trace

/session-trace

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.

Repository
academicops ↗
Licence
MIT
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
6
Scripts
3
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 3 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/phoenix_token_cost.py, scripts/phoenix_trace.py, scripts/phoenix_transcript.py

What it does and when to use it

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.

Triggers from the description

how did this decision get made
Original author 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.

How it works

  1. Transcript: how did this decision get made
  2. Other exports
  3. Ad-hoc queries
  4. Constraints
Original SKILL.md headings · 61 lines, 494 words
SKILL.md preview
---
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.
Files in this package (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

Versions

RepositoryScoreLicence
This page · nicsuzor/academicops100MIT
nicsuzor/academicops100MIT

Identical content appears in 5 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version 6ad80c71e0e7 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95session-report
    Use when the user asks to "analyze a session", "session report", "review session performance", "how did that session go", "token usage report", "cost report", or wants to understand the performance, cost, and quality of a completed Claude Code session. Accepts a session JSON file path as input.
  • 95tma1
    Query TMA1 observability data (Claude Code, Codex, GitHub Copilot CLI, OpenClaw, any OTel SDK). Use when the user asks: how much did I spend, token usage, what has my agent been doing, agent cost, show me traces, show me events, check for errors, model comparison, tool usage.
  • 95tma1
    Query TMA1 observability data (Claude Code, Codex, GitHub Copilot CLI, any OTel SDK). Use when the user asks: how much did I spend, token usage, what has my agent been doing, agent cost, show me traces, show me events, check for errors, model comparison, tool usage.
  • 100arize-traces
    Retrieve and debug trace data from the Arize ML observability platform. Use when users want to list recent traces, look up a specific trace by trace ID, get all spans within a trace, analyze trace performance (latency, tokens, cost), or export trace data. Triggers on "list…
  • 95tmn-trace
    (tmn) See exactly what an agent did - every command, edit, test run, subagent and token count - without spending model tokens, and optionally send Claude Code's own telemetry to Langfuse, Phoenix or an OpenTelemetry Collector. Use when asked what an agent ran, to audit or replay…
  • 100token-audit
    Audit the user's local Claude Code token usage and cost (by model, project, session, cache, effort, week over week) and build a self-contained HTML dashboard. Use when asked to audit token usage or spend, find where tokens go, or refresh the usage dashboard.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.