skip to content
$registry / workers

claude-code

v0.2.21

Claude Code as an iii worker — claude::* runs headless turns and claude::terminal::* runs the same CLI in a shell::pty session on its own console page. Both publish raw messages on the claude::raw-event trigger type and AgentEvent frames on claude::agent-event.

worker
iiiverified
97 installs0 in 7d0 today
install
$iii trigger compose::add worker=claude-code

exact versions are immutable; binary and bundle artifacts are digest-pinned.

functions

12

claude::auth::status

function

Check who pays for a Claude terminal session on this host. Reports a Claude subscription, an API key (which overrides the login), or nothing yet; read from `claude auth status` on the host.

request
empty object
response
  • api_key_sourcestring
  • billingstringrequiredenum: subscription, api-key, none, unknown
  • detailstringrequired
  • emailstring
  • labelstringrequired
  • logged_inboolean
  • methodstring
  • organizationstring
  • subscription_typestring

claude::on-config-change

function

Internal: reload claude-code configuration when it changes.

request
empty object
response
valuenull

claude::run

function

Run one Claude Code turn and wait for the result. Accepts `prompt` or a `messages` array plus a raw SDK `options` pass-through; publishes raw Claude Code messages on the claude::raw-event trigger type and AgentEvent frames on claude::agent-event (bind with { session_id }), and returns {session_id, result, usage, total_cost_usd}.

request
  • allowed_toolsstring[]

    Allow rules, e.g. "Bash(git *)"

  • append_system_promptstring

    Append to the default system prompt

  • cwdstring

    Working directory the turn runs in

  • disallowed_toolsstring[]

    Deny rules

  • iii_contextboolean

    Append the iii runtime discovery prompt (engine catalog via the iii CLI)

  • max_turnsintegermax 9007199254740991

    Cap on agentic turns

  • messagesobject[]

    Alternative to prompt: role/content messages; the last user entry becomes the prompt

    • contentany ofrequired
      any of (2)
      variant 1
      valuestring
      variant 2
      itemsobject[]
      • typestringrequired
    • rolestringrequired
  • modelstring

    Model id or alias; empty = Claude Code default

  • optionsobject

    Raw Agent SDK options forwarded verbatim (camelCase), e.g. forkSession, includePartialMessages

  • parent_session_idstring

    The session delegating this run. Written to the child session metadata, which is what nests it under its parent in the console — the same link a harness sub-agent carries.

  • permission_modestringenum: default, acceptEdits, plan, bypassPermissions

    Claude Code permission mode for this turn

  • promptstring

    The user prompt for this turn

  • session_idstring

    iii session id; reuse to resume the same Claude Code conversation

  • system_promptstring

    Replace the Claude Code system prompt

  • timeout_msintegermax 9007199254740991

    Reserved for callers; not forwarded

response
  • busyboolean
  • claude_session_idany of
    any of (2)
    variant 1
    valuestring
    variant 2
    valuenull
  • is_errorboolean
  • num_turnsnumber
  • reasonstring
  • resultstring
  • session_idstringrequired
  • stop_reasonstring
  • total_cost_usdnumber
  • usageany of
    any of (2)
    variant 1
    • cache_read_tokensnumber
    • cache_write_tokensnumber
    • input_tokensnumberrequired
    • output_tokensnumberrequired
    variant 2
    valuenull

claude::sessions::list

function

List every Claude Code session this worker has run.

request
empty object
response
  • sessionsobject[]required
    • claude_session_idany ofrequired
      any of (2)
      variant 1
      valuestring
      variant 2
      valuenull
    • cwdstringrequired
    • modelstringrequired
    • session_idstringrequired
    • statusstringrequiredenum: working, done, error
    • total_cost_usdnumberrequired
    • turnsnumberrequired
    • updated_at_msnumberrequired
    • usageany ofrequired
      any of (2)
      variant 1
      • cache_read_tokensnumber
      • cache_write_tokensnumber
      • input_tokensnumberrequired
      • output_tokensnumberrequired
      variant 2
      valuenull

claude::start

function

Start a Claude Code turn and return immediately; bind claude::agent-event with { session_id } for progress and turn_end.

request
  • allowed_toolsstring[]

    Allow rules, e.g. "Bash(git *)"

  • append_system_promptstring

    Append to the default system prompt

  • cwdstring

    Working directory the turn runs in

  • disallowed_toolsstring[]

    Deny rules

  • iii_contextboolean

    Append the iii runtime discovery prompt (engine catalog via the iii CLI)

  • max_turnsintegermax 9007199254740991

    Cap on agentic turns

  • messagesobject[]

    Alternative to prompt: role/content messages; the last user entry becomes the prompt

    • contentany ofrequired
      any of (2)
      variant 1
      valuestring
      variant 2
      itemsobject[]
      • typestringrequired
    • rolestringrequired
  • modelstring

    Model id or alias; empty = Claude Code default

  • optionsobject

    Raw Agent SDK options forwarded verbatim (camelCase), e.g. forkSession, includePartialMessages

  • parent_session_idstring

    The session delegating this run. Written to the child session metadata, which is what nests it under its parent in the console — the same link a harness sub-agent carries.

  • permission_modestringenum: default, acceptEdits, plan, bypassPermissions

    Claude Code permission mode for this turn

  • promptstring

    The user prompt for this turn

  • session_idstring

    iii session id; reuse to resume the same Claude Code conversation

  • system_promptstring

    Replace the Claude Code system prompt

  • timeout_msintegermax 9007199254740991

    Reserved for callers; not forwarded

response
  • session_idstringrequired
  • startedbooleanrequired

claude::status

function

Check the status of a Claude Code session.

request
  • session_idstringrequired

    iii session id returned by claude::run / claude::start

response
  • livebooleanrequired
  • recordany ofrequired
    any of (2)
    variant 1
    • claude_session_idany ofrequired
      … expand 2 nested
      any of (2)
      variant 1
      valuestring
      variant 2
      valuenull
    • cwdstringrequired
    • modelstringrequired
    • session_idstringrequired
    • statusstringrequiredenum: working, done, error
    • total_cost_usdnumberrequired
    • turnsnumberrequired
    • updated_at_msnumberrequired
    • usageany ofrequired
      … expand 2 nested
      any of (2)
      variant 1
      • cache_read_tokensnumber
      • cache_write_tokensnumber
      • input_tokensnumberrequired
      • output_tokensnumberrequired
      variant 2
      valuenull
    variant 2
    valuenull
  • session_idstringrequired

claude::stop

function

Stop a live Claude Code run for a session.

request
  • session_idstringrequired

    iii session id returned by claude::run / claude::start

response
  • reasonstring
  • session_idstringrequired
  • stoppedbooleanrequired

claude::task

function

Delegate one task to Claude Code and return its session id immediately — the sub-agent shape: it never parks the caller. The outcome is written to state under scope `agent_tasks`, key the child session id, so bind a `state` trigger on that BEFORE calling and be woken by it; progress arrives on claude::agent-event (bind with { session_id }). Pass `parent_session_id` to nest the child under the session that delegated it.

request
  • allowed_toolsstring[]

    Allow rules, e.g. "Bash(git *)"

  • append_system_promptstring

    Append to the default system prompt

  • cwdstring

    Working directory the turn runs in

  • disallowed_toolsstring[]

    Deny rules

  • iii_contextboolean

    Append the iii runtime discovery prompt (engine catalog via the iii CLI)

  • max_turnsintegermax 9007199254740991

    Cap on agentic turns

  • modelstring

    Model id or alias; empty = Claude Code default

  • optionsobject

    Raw Agent SDK options forwarded verbatim (camelCase), e.g. forkSession, includePartialMessages

  • parent_session_idstring

    The session delegating this run. Written to the child session metadata, which is what nests it under its parent in the console — the same link a harness sub-agent carries.

  • permission_modestringenum: default, acceptEdits, plan, bypassPermissions

    Claude Code permission mode for this turn

  • session_idstring

    iii session id; reuse to resume the same Claude Code conversation

  • system_promptstring

    Replace the Claude Code system prompt

  • taskstringrequiredmin 1 chars

    The child's self-contained goal. It cannot see the caller's context, so name every resource it needs.

  • timeout_msintegermax 9007199254740991

    Reserved for callers; not forwarded

response
  • session_idstringrequired
  • startedbooleanrequired

claude::terminal::activity

function

A Claude Code lifecycle event from a terminal session (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop, SessionEnd), posted by the workspace hooks. Translated into AgentEvent frames on the claude::agent-event feed.

request
  • cwdstring
  • hook_event_namestring
  • promptstring
  • session_idstring
  • tool_inputobject
  • tool_namestring
  • tool_responseunknown
  • tool_use_idstring
response
  • eventstringrequired
  • okbooleanrequired

claude::terminal::describe

function

What a Claude terminal session runs: the claude binary, its argv, the workspace directory, and the session environment. The console page passes this straight to shell::pty::open.

request
empty object
response
  • activity_bridgestring

    The `iii` CLI on the terminal host that carries this session's activity to the bus. Empty means nothing will reach the claude::agent-event feed.

  • argsstring[]required
  • cwdstringrequired
  • detailstring

    Anything wrong that does not stop a session from opening.

  • envobjectrequired
  • programstringrequired

claude::ui-content

function

Console UI asset content (console plumbing).

request
  • pathstringrequired
response
  • contentstringrequired
  • content_typestring

run::start_and_wait

function

Alias for claude::run under the shared agent entrypoint: run a turn for {session_id, messages} and return when it ends.

request
  • allowed_toolsstring[]

    Allow rules, e.g. "Bash(git *)"

  • append_system_promptstring

    Append to the default system prompt

  • cwdstring

    Working directory the turn runs in

  • disallowed_toolsstring[]

    Deny rules

  • iii_contextboolean

    Append the iii runtime discovery prompt (engine catalog via the iii CLI)

  • max_turnsintegermax 9007199254740991

    Cap on agentic turns

  • messagesobject[]

    Alternative to prompt: role/content messages; the last user entry becomes the prompt

    • contentany ofrequired
      any of (2)
      variant 1
      valuestring
      variant 2
      itemsobject[]
      • typestringrequired
    • rolestringrequired
  • modelstring

    Model id or alias; empty = Claude Code default

  • optionsobject

    Raw Agent SDK options forwarded verbatim (camelCase), e.g. forkSession, includePartialMessages

  • parent_session_idstring

    The session delegating this run. Written to the child session metadata, which is what nests it under its parent in the console — the same link a harness sub-agent carries.

  • permission_modestringenum: default, acceptEdits, plan, bypassPermissions

    Claude Code permission mode for this turn

  • promptstring

    The user prompt for this turn

  • session_idstring

    iii session id; reuse to resume the same Claude Code conversation

  • system_promptstring

    Replace the Claude Code system prompt

  • timeout_msintegermax 9007199254740991

    Reserved for callers; not forwarded

response
  • busyboolean
  • claude_session_idany of
    any of (2)
    variant 1
    valuestring
    variant 2
    valuenull
  • is_errorboolean
  • num_turnsnumber
  • reasonstring
  • resultstring
  • session_idstringrequired
  • stop_reasonstring
  • total_cost_usdnumber
  • usageany of
    any of (2)
    variant 1
    • cache_read_tokensnumber
    • cache_write_tokensnumber
    • input_tokensnumberrequired
    • output_tokensnumberrequired
    variant 2
    valuenull

triggers

2

claude::agent-event

trigger

Translated AgentEvent frames of one Claude Code session (claude::run, claude::start, claude::task, run::start_and_wait and the console terminal). Config: { session_id, metadata? }. Payload: { session_id, event_id, seq, epoch, source, event }. Ephemeral: not stored or replayed.

invocation
valueunknown
return
valueunknown

claude::raw-event

trigger

Raw Claude Code messages (system/init, assistant, user, result, stream_event) of one session, verbatim. Config: { session_id, metadata? }. Payload: { session_id, event_id, seq, epoch, source, event }. Ephemeral: not stored or replayed.

invocation
valueunknown
return
valueunknown