The connector hooks into Cline’s event system and captures structured data from each task. This page documents what events are captured and how they map to Infinium traces.

Hook Events

The connector listens for these Cline hook events:

EventWhen It FiresWhat’s Captured
TaskStartA new task beginsTask description, model (provider + slug), workspace root, Cline version
TaskResumeA previous task is resumedSame as TaskStart
UserPromptSubmitUser sends a follow-up prompt in the taskPrompt text
PreToolUseBefore a tool executesTool name, parameters
PostToolUseAfter a tool completesTool result, success flag, durationMs
PreCompactCline is about to compact the conversationConversation length, estimated tokens
TaskCompleteTask finished successfullyFinal task text — triggers trace send
TaskCancelTask was cancelledTriggers trace send

Nested JSON Payload

Unlike most other Claude-family tools, Cline sends nested JSON. Each hook event carries a sub-object keyed by the hook name:

{
  "hookName": "PostToolUse",
  "taskId": "cline-t-abc123",
  "timestamp": "2026-04-18T10:00:05Z",
  "clineVersion": "3.36",
  "workspaceRoots": ["/home/user/project"],
  "userId": "u-1",
  "model": {"provider": "anthropic", "slug": "claude-sonnet-4"},
  "postToolUse": {
    "tool": "execute_command",
    "parameters": {"command": "npm test"},
    "result": "All 42 tests passed",
    "success": true,
    "durationMs": 3200
  }
}

The connector normalizes hookNamehook_event_name and taskIdsession_id internally so downstream logic matches the other connectors.

Stdout Response

Cline requires every hook invocation to write a JSON response on stdout. The connector always writes:

{"cancel": false, "contextModification": null, "errorMessage": null}

If this response is missing or malformed, Cline will hang. The connector guarantees a response is always written, even on error.

How Events Become Traces

A full task lifecycle looks like this:

Task:
  TaskStart         → "Fix the login validation bug"
  UserPromptSubmit  → "Verify with: npm test"
  PreToolUse        → execute_command("npm test")
  PostToolUse       → {result: "passed", success: true, durationMs: 3200}
  TaskComplete      → "Fix the login validation bug"

                    Trace sent to Infinium

The trace is sent on TaskComplete (or TaskCancel). One trace per task.

Trace Structure

Each trace sent to Infinium contains:

Top-Level Fields

FieldSourceExample
nameTask text (truncated to 30 chars)"Fix the login bug"
descriptionTask text (full)"Fix the login validation bug"
durationTask timing15.2 (seconds)
input_summaryFirst prompt / task text"Fix the login validation bug"
output_summaryLast assistant response (if present)"Fixed and tests pass"

Execution Steps

Each trace includes an ordered list of steps:

Step TypeActionFields
User promptuser_promptdescription, input_preview, output_preview
Tool calltool_usedescription (e.g. "Tool: execute_command"), input_preview, output_preview, duration_ms
Tool failuretool_use with errorerror.error_type = "ToolError", error.message, error.recoverable = true

Environment Context

Every trace includes environment metadata:

TagValue
modelCombined provider/slug (e.g. anthropic/claude-sonnet-4)
model_providerJust the provider (anthropic, openai, etc.)
session_idCline task identifier
working_directoryWorkspace root
cline_versionCline extension version
framework"cline"

LLM Usage

On flush, the connector reads Cline’s ui_messages.json (in VS Code’s global storage for the saoudrizwan.claude-dev extension) and attaches cumulative token usage to the trace:

FieldSource
prompt_tokensSum of tokensIn across api_req_started entries
completion_tokensSum of tokensOut
api_calls_countNumber of api_req_started entries
providerFrom model.provider
modelFrom model.slug
cache_reads, cache_writesSurfaced in custom_tags (no dedicated SDK field)
total_costSurfaced in custom_tags

Tool Names

The connector understands Cline’s common tool set and normalizes their display:

execute_command, shell, read_file, readFile, write_to_file, writeFile, replace_in_file, editFile, search_files, grep, list_files, browser_action.

Error Tracking

PostToolUse events with success: false are captured as structured errors:

FieldDescription
error_type"ToolError"
messageCline’s result text (truncated)
recoverabletrue

Data Truncation

To keep payloads manageable, the connector truncates:

  • Prompt text: First 200 characters (configurable via CONNECTOR_MAX_INPUT_PREVIEW)
  • Tool output preview: First 300 characters (configurable via CONNECTOR_MAX_OUTPUT_PREVIEW)
  • Payload size: Progressive truncation if the total payload exceeds ~950KB

Full data is never sent — only summaries that give Maestro enough context to evaluate quality.