Export Trace
Retrieve one explicit hosted trace without scanning the capture catalog. Resolve
its request IDs through the customer trace lookup endpoint, then reuse the
bounded request capture exporter.
Safety Gates
- Treat a bare
trace_id as authorization for a redacted local summary export,
not for raw prompts or completions.
- Use
--include-payload --yes only when the developer explicitly asks for the
full, raw, or complete trace/captures. Announce that the files may contain
prompts, completions, and tool payloads before running it.
- Keep outputs under
.understudy/; never print, paste, commit, or upload trace
bodies.
- Never ask for API keys in chat. Use existing Understudy credentials and report
only auth presence or errors.
- Never replace the trace lookup with project-wide capture pagination. If the
lookup endpoint is unavailable, stop and report the backend dependency.
Resolve CLI
Prefer the installed understudy binary. In this repository checkout:
npm run build
node dist/bin.js status --json
Use node dist/bin.js in place of understudy below when necessary.
Flow
Resolve the project from repo config or an explicit --project /
--project-id. Resolve --workload only when the developer supplied or
requested that narrower scope.
For redacted metadata, run:
understudy traces export <trace-id> \
--project <project> \
--out .understudy/traces/<trace-id>
For an explicitly requested full trace, run:
understudy traces export <trace-id> \
--project <project> \
--out .understudy/traces/<trace-id> \
--include-payload --yes
For several explicit IDs, put one per line in a private local file and use
--trace-ids-file <path>. Do not use or recreate an unbounded --all
operation.
Inspect only metadata artifacts:
trace.json — trace_id, ordered request_ids, and export counts;
failed-request-ids.txt — request captures to retry;
failed-trace-ids.txt — trace lookups or trace exports to retry;
*.summary.json or *.payload.json — private per-request files.
Do not print payload file contents. Rerun the same command to resume; completed
request files are skipped.
When the developer asks to inspect the conversation locally, build the
private viewer:
understudy traces build-viewer \
--source .understudy/traces/<trace-id> \
--trace-id <trace-id> \
--output .understudy/trace-viewer/<trace-id>
When the developer wants an eval, cost profile, or benchmark from the local
files, hand off to ../ingest-traces/SKILL.md.
Failure Handling
404 for one trace: report that the trace is absent from the authorized
project/workload or that the platform trace lookup has not deployed. Do not
scan capture history as a fallback.
401/403: stop and route auth/project readiness to
../use-understudy-gateway/SKILL.md.
- A non-empty
failed-request-ids.txt: report a partial export and rerun the
same command; do not claim the trace is complete.
- A response with no request IDs or a mismatched
trace_id: fail closed and
report the contract violation.
Output Standard
End with the trace ID, project/workload scope, redacted or full mode, request
count, complete/partial status, private output directory, and one next action:
open the local viewer, retry failures, or route to ingest-traces.
1---2name: export-trace3description: Use when a developer provides a hosted Understudy trace_id or asks "get this trace", "download this trace", "show every request in this trace", or "export these trace IDs". Resolves trace membership through the customer trace lookup API, exports linked captures privately, and hands local files to the trace viewer or ingest-traces.4---56# Export Trace78Retrieve one explicit hosted trace without scanning the capture catalog. Resolve9its request IDs through the customer trace lookup endpoint, then reuse the10bounded request capture exporter.1112## Safety Gates1314- Treat a bare `trace_id` as authorization for a redacted local summary export,15 not for raw prompts or completions.16- Use `--include-payload --yes` only when the developer explicitly asks for the17 full, raw, or complete trace/captures. Announce that the files may contain18 prompts, completions, and tool payloads before running it.19- Keep outputs under `.understudy/`; never print, paste, commit, or upload trace20 bodies.21- Never ask for API keys in chat. Use existing Understudy credentials and report22 only auth presence or errors.23- Never replace the trace lookup with project-wide capture pagination. If the24 lookup endpoint is unavailable, stop and report the backend dependency.2526## Resolve CLI2728Prefer the installed `understudy` binary. In this repository checkout:2930```sh31npm run build32node dist/bin.js status --json33```3435Use `node dist/bin.js` in place of `understudy` below when necessary.3637## Flow38391. Resolve the project from repo config or an explicit `--project` /40 `--project-id`. Resolve `--workload` only when the developer supplied or41 requested that narrower scope.422. For redacted metadata, run:4344 ```sh45 understudy traces export <trace-id> \46 --project <project> \47 --out .understudy/traces/<trace-id>48 ```49503. For an explicitly requested full trace, run:5152 ```sh53 understudy traces export <trace-id> \54 --project <project> \55 --out .understudy/traces/<trace-id> \56 --include-payload --yes57 ```5859 For several explicit IDs, put one per line in a private local file and use60 `--trace-ids-file <path>`. Do not use or recreate an unbounded `--all`61 operation.624. Inspect only metadata artifacts:6364 - `trace.json` — `trace_id`, ordered `request_ids`, and export counts;65 - `failed-request-ids.txt` — request captures to retry;66 - `failed-trace-ids.txt` — trace lookups or trace exports to retry;67 - `*.summary.json` or `*.payload.json` — private per-request files.6869 Do not print payload file contents. Rerun the same command to resume; completed70 request files are skipped.715. When the developer asks to inspect the conversation locally, build the72 private viewer:7374 ```sh75 understudy traces build-viewer \76 --source .understudy/traces/<trace-id> \77 --trace-id <trace-id> \78 --output .understudy/trace-viewer/<trace-id>79 ```80816. When the developer wants an eval, cost profile, or benchmark from the local82 files, hand off to [`../ingest-traces/SKILL.md`](../ingest-traces/SKILL.md).8384## Failure Handling8586- `404` for one trace: report that the trace is absent from the authorized87 project/workload or that the platform trace lookup has not deployed. Do not88 scan capture history as a fallback.89- `401`/`403`: stop and route auth/project readiness to90 [`../use-understudy-gateway/SKILL.md`](../use-understudy-gateway/SKILL.md).91- A non-empty `failed-request-ids.txt`: report a partial export and rerun the92 same command; do not claim the trace is complete.93- A response with no request IDs or a mismatched `trace_id`: fail closed and94 report the contract violation.9596## Output Standard9798End with the trace ID, project/workload scope, redacted or full mode, request99count, complete/partial status, private output directory, and one next action:100open the local viewer, retry failures, or route to `ingest-traces`.