Skip to content

Agent Tracer - API Integration Map

This is a reference organizing API endpoint usage per runtime. The automatic adapter currently implemented in the repository is the Claude Code plugin; other runtimes can be attached by calling the same API directly.

Implementation basis:

Related documentation:

Session Lifecycle

APIRoleClaude Code pluginManual runtime
/api/runtime-session-ensureRuntime session upsertSessionStart, UserPromptSubmit, PreToolUseUse if stable runtime session ID is available
/api/task-startExplicit task/session creationRarely usedUse when no session ID-based binding
/api/runtime-session-endRuntime session closureStop, SessionEndUse to separate turn end from task end
/api/session-endTask-level session closureNot called directlyUse to close resumable sessions only
/api/task-completeFull task closureNot called directlyUse at end of entire work item
/api/assistant-responseRecord assistant turn resultStopCall if assistant has final text

Messages/Context

APIRoleClaude Code pluginManual runtime
/api/user-messageRecord user inputUserPromptSubmitRequired
/api/save-contextPlanning lane snapshotSessionStart, PreCompact, PostCompactOptional
/api/planRecord structured planning stepMCP/manual onlyOptional
/api/actionRecord agent action before executionMCP/manual onlyOptional
/api/verifyRecord verification step resultMCP/manual onlyOptional
/api/ruleRecord rule-related eventsMCP/manual onlyOptional
/api/questionRecord question flowMCP/manual onlyOptional
/api/thoughtRecord summarized reasoningMCP/manual onlyOptional

Tool Usage

APIRoleClaude Code pluginManual runtime
/api/tool-usedRecord implementation action`PostToolUse(EditWrite
/api/exploreRecord file/web exploration`PostToolUse(ReadGlob
/api/terminal-commandRecord terminal command executionPostToolUse(Bash)Use if bash-family tools exist
/api/todoRecord todo state changes`PostToolUse(TodoWriteTaskCreate

Agent/Background

APIRoleClaude Code pluginManual runtime
/api/agent-activityRecord delegation/skill/MCP calls`PostToolUse(AgentSkill
/api/async-taskBackground task stateSubagentStart, SubagentStopUse if background execution exists
/api/task-linkLink parent-child tasksWhen child runtime session is acquiredUse if background lineage exists

Minimum Implementation Order for New Runtime

text
1. /api/runtime-session-ensure or /api/task-start
2. /api/user-message
3. /api/tool-used
4. /api/explore
5. /api/assistant-response
6. /api/runtime-session-end or /api/session-end

Then optionally add /api/terminal-command, /api/todo, /api/save-context, /api/agent-activity, /api/async-task, /api/task-link, /api/question, /api/thought as needed.

Local-first documentation for Agent Tracer.