agent-strace

v0.131.0
io.github.Siddhant-K-code/agent-trace Checked 5 hours ago Published 20 hours ago

Query recorded AI agent sessions: events, summaries, diffs, health, skills, PR reviewability.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_sessions

List captured agent sessions with metadata: session ID, start time, tool call count, LLM requests, errors, total tokens, and estimated cost.

ParameterTypeDescription
agentstringFilter by agent name (substring match).
limitintegerMaximum number of sessions to return (default: 20).

get_session

Return the full event stream for a session as structured JSON. Includes every tool call, LLM request, file read/write, and error.

ParameterTypeDescription
session_id *stringSession ID or unique prefix.
event_typesarrayFilter to these event types only. Valid values: tool_call, tool_result, llm_request, llm_response, file_read, file_write, error, user_prompt, assistant_response. Empty list returns all events.

search_events

Search events across one or all sessions. Filter by tool name, file path substring, exit code, or error.

ParameterTypeDescription
exit_codeintegerFilter tool_result events by exit code.
file_pathstringFilter file_read/file_write events by path substring.
has_errorbooleanIf true, return only error events.
limitintegerMaximum events to return (default: 50).
session_idstringSession ID or prefix. Omit to search all sessions.
tool_namestringFilter tool_call events by tool name (case-insensitive substring).

get_session_summary

Return a plain-English summary of what the agent did in a session: phases, files touched, commands run, retries, and wasted time.

ParameterTypeDescription
session_id *stringSession ID or unique prefix.

diff_sessions

Compare two sessions and return a structured diff: which tools were added/removed, file overlap, cost delta, error delta, and token delta.

ParameterTypeDescription
session_a *stringFirst session ID or prefix (the 'before' session).
session_b *stringSecond session ID or prefix (the 'after' session).

health

Report evidence health for a session: which agent/provider recorded it, whether it was finalized, redaction state, known capture blind spots, and structural problems such as orphaned tool results. Same data as 'agent-strace health --format json'.

ParameterTypeDescription
session_idstringSession ID or unique prefix. Omit for the latest session.

skills

Report agent skill (SKILL.md) adoption: which skills are available, which were loaded, follow-up signals after a load, and which never loaded. Without session_id, aggregates sessions since 'since'. Same data as 'agent-strace skills --format json', except command_match reports counts only. Prompt text, SKILL.md bodies, and command signatures taken from them are never returned.

ParameterTypeDescription
min_sessionsintegerMinimum sessions before a skill is reported as never loaded (default: 5).
session_idstringSession ID or prefix for a single-session report. Omit to aggregate.
sincestringAggregate window, e.g. 7d, 24h, or 2026-01-01 (default: 30d).
skills_dirsarrayExtra skill directories to scan.
workspacestringRepository path used to discover repo skills when a session has no recorded cwd. Defaults to the server's working directory.

review

Run the pull-request reviewability check: rationale, scope, validation, stewardship, and evidence health for the sessions linked to a branch, each with a status, confidence, and source, plus the threshold result. Same versioned JSON as 'agent-strace review --format json'. Read-only: it never posts a PR comment or writes a file. Prompt text and command strings are never returned.

ParameterTypeDescription
agent_trace_recordsstringPath to Agent Trace (agent-trace.dev) records to read line attribution from: one JSON record, a JSON array, or JSON Lines. Relative paths resolve against the server's working directory. Reported, not…
branchstringBranch to link sessions by. Defaults to the CI source branch or the git branch of the server's working directory.
commitsstringGit revision range to read Entire-Checkpoint, Agent-Logs-Url, Claude-Session, Assisted-by and Generated-by trailers, agent co-authors, Copilot cloud agent authors, and git-ai notes (refs/notes/ai) fro…
configstringConfig file with a review block. Defaults to .agent-strace.yaml in the server's working directory if present.
disclosurestringCompare the AI assistance the PR declares with the agent evidence: report adds it, check also fails on evidence, not declared or an agent Signed-off-by (default: off, or the config file).
fail_onstringComma-separated statuses that fail: missing, partial, inconclusive, or none (default: missing, or the config file).
findingsstringComma-separated findings the threshold applies to: rationale, scope, validation, stewardship, evidence (default: all).
formatstringjson (default) or markdown, same as the CLI formats.
min_confidencestringLowest confidence that can fail the check (default: medium).
otel_logsstringPath to a Claude Code OpenTelemetry logs export (OTLP JSON or JSON Lines) to read safety_event from. Relative paths resolve against the server's working directory. Reported, not graded.
pr_bodystringPath to the PR description to match disclosure patterns in. Defaults to the pull request event or GitLab CI_MERGE_REQUEST_DESCRIPTION.
session_idsarraySession IDs or prefixes to review (explicit link). Empty links sessions by branch, then head commit time, then latest.