Skip to main content

crewship inspect

Print the journal entries for a run as a one-line-per-event timeline. Each line shows timestamp, severity chip, entry type, and summary. Costs and tool calls are pulled out into a footer block when present. Sibling design with crewship explain:
  • crewship inspect <run-id> — structured timeline (this command, fast, no LLM)
  • crewship explain <run-id> — LLM-summarised narrative (slower, costs tokens)
Both share fetchRun plus the journal endpoint; explain feeds the entries to an agent, inspect formats them directly.
Requires an authenticated session and a selected workspace (requireAuthAndWorkspace).
inspect takes agent-run IDs, not routine-run IDs. There are two unrelated run namespaces:
  • Agent (chat-turn) runsmsg_… (and legacy r_…), listed by crewship history. These are what inspect, explain, and diff read.
  • Routine (pipeline) runsrun_… / prn_…, listed by crewship routine runs <slug>. For these use crewship routine logs <run-id> (timeline) or crewship routine report <run-id> (summary).
Passing a run_… ID here fails fast with a message naming the right command (exit code 3), rather than a bare 404.

Flags

The global --format flag (table / json / yaml / ndjson / quiet) is honoured. JSON / YAML / --filter paths bypass the table formatter and emit the raw entry list with run_id, agent_id, entries, and — when the run resolved one — the model it actually ran on.

Examples

Default (table view)

Narrow to errors and keeper decisions

--types is forwarded to the server as the entry_type query param on /api/v1/journal, so filtering is applied DB-side before the entries are reversed for chronological display.

Pull a single field via jq

--filter short-circuits to JSON output; the expression is piped through jq.

Raw JSON for piping

Live tail

Re-runs the inspect every 5 seconds. Useful for runs that are still streaming events.

How the run is scoped

The CLI fetches journal entries scoped to the run’s agent and the run’s time window, then filters down to entries whose trace_id matches the run ID. By convention trace_id == run_id for journal entries (see internal/journal/types.go). Older entries that pre-date the trace rollout, or non-run-scoped events that the user explicitly --types-included, have no trace_id and are kept on the assumption the user wants to see them.

Common errors

  • run <id> has no agent_id — the run record is malformed (or you passed something that isn’t a run ID). Run IDs start with r_.
  • no entries in journal window — run may be older than recall horizon — the run is older than the journal retention window (typically 7d). Printed dimmed under the header instead of a hard error.

See also