Sessions, Inspect, Logs, Replay, Metrics, Compact
Inspect what happened during a run.
Every fh run and every dev-server invocation persists a session under .fabricharness/sessions/ (or your configured store). The CLI ships several commands for reading those sessions.
fh sessions
fabric-harness sessionsLists persisted sessions. Output includes session id, agent name, last update time, and entry counts.
fh inspect
fabric-harness inspect <session-id>Shows the full structured session: prompts, assistant messages, tool calls, tool results, shell commands, task starts/ends, approvals, compactions, checkpoints, and artifacts.
fh logs
fabric-harness logs <session-id> [--events]Prints a readable timeline. Use --events to include the lower-level event stream (text_delta, tool_start, tool_end, etc.).
fh metrics
fabric-harness metrics <session-id> [--json]Aggregate token, tool, shell, and artifact metrics for the session.
fh replay
fabric-harness replay <session-id>Read-only view of the session's active path (post-compaction) and the model context that would be sent on the next turn. Useful for debugging compactions and prompt drift.
fh compact
fabric-harness compact <session-id> [--keep <n>] [--summary <text>]Append a compaction entry to a persisted session. --keep <n> keeps the last n entries verbatim, --summary <text> provides an explicit summary instead of running the model.
Example session lifecycle
fh run ask --question "What is Temporal?"
# Session id: ask-1f4f...
fh inspect ask-1f4f...
fh logs ask-1f4f...
fh metrics ask-1f4f...
fh replay ask-1f4f...
fh compact ask-1f4f... --keep 2 --summary "User asked about Temporal."