← All procedures

claude.follow

Follow the output file of a turn and stream its events until the turn ends

CLI
Package
@procedures/claude-cli · README
Path
["claude","follow"]
CLI
mark claude follow --outputFile <string>
As data
{"$proc":["claude","follow"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/claude-cli/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["claude","follow"], { outputFile: "<outputFile>" });
console.log(JSON.stringify(result));

From the command line

$ mark claude follow --outputFile <string>

As data, in a program

{
  "$proc": ["claude", "follow"],
  "input": { "outputFile": "<outputFile>" }
}

Input

FieldTypeRequiredDefaultDescription
outputFilestringyesThe output file of the turn
offsetintegernoThe byte offset to start from (default: 0)
pidintegernoThe process id of the turn. Without it, only the result stops the follow.
pollMsintegernoThe time between two reads, in milliseconds (default: 250)

Output

FieldTypeRequiredDefaultDescription
offsetnumberyesThe byte offset after the line of the event
eventobjectyes
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "outputFile": {
        "type": "string",
        "minLength": 1,
        "description": "The output file of the turn"
      },
      "offset": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991,
        "description": "The byte offset to start from (default: 0)"
      },
      "pid": {
        "description": "The process id of the turn. Without it, only the result stops the follow.",
        "type": "integer",
        "minimum": 2,
        "maximum": 9007199254740991
      },
      "pollMs": {
        "description": "The time between two reads, in milliseconds (default: 250)",
        "type": "integer",
        "minimum": 10,
        "maximum": 60000
      }
    },
    "required": [
      "outputFile"
    ]
  },
  "output": {
    "type": "object",
    "properties": {
      "offset": {
        "type": "number",
        "description": "The byte offset after the line of the event"
      },
      "event": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "meta, text, text-delta, thinking, tool-use, tool-result, result, log or error"
          }
        },
        "required": [
          "type"
        ],
        "additionalProperties": {}
      }
    },
    "required": [
      "offset",
      "event"
    ],
    "additionalProperties": false
  }
}