Skip to main content

Claude Code Adapter

The claude_local adapter runs Claude Code CLI on the host machine as a SLAW agent, resuming the previous session across Heartbeats.

Type key: claude_local

Prerequisites

  • Claude Code installed on the host: npm install -g @anthropic-ai/claude-code
  • Claude Code authenticated (claude login or ANTHROPIC_API_KEY set)

Configuration

Set adapterType: claude_local on the agent and provide the config below.

Config fields

FieldTypeDefaultDescription
cwdstringAbsolute working directory for the agent process; created if missing
instructionsFilePathstringAbsolute path to a markdown file injected as system instructions at runtime
modelstringClaude model ID (see Models)
effortstringReasoning effort: low, medium, or high; passed as --effort
chromebooleanfalsePass --chrome to Claude
promptTemplatestringTemplate for the run prompt; supports {{issue}} and related variables
maxTurnsPerRunnumberMaximum turns allowed per Heartbeat run
dangerouslySkipPermissionsbooleantruePass --dangerously-skip-permissions; required for unattended headless runs
commandstringclaudeOverride the Claude Code binary path
extraArgsstring[]Additional CLI arguments appended to the invocation
envobjectEnvironment variables injected into the agent process
workspaceStrategyobjectExecution workspace strategy (see Workspace strategy)
workspaceRuntimeobjectReserved for workspace runtime metadata; runtime services are managed from the UI
timeoutSecnumber0Run timeout in seconds; 0 means no timeout
graceSecnumber15SIGTERM grace period before SIGKILL

Models

Model IDLabel
claude-opus-4-8Claude Opus 4.8
claude-opus-4-7Claude Opus 4.7
claude-opus-4-6Claude Opus 4.6
claude-sonnet-4-6Claude Sonnet 4.6
claude-haiku-4-6Claude Haiku 4.6
claude-sonnet-4-5-20250929Claude Sonnet 4.5
claude-haiku-4-5-20251001Claude Haiku 4.5

Workspace strategy

Set workspaceStrategy.type: git_worktree to have SLAW create a dedicated git worktree for the agent:

{
"workspaceStrategy": {
"type": "git_worktree",
"baseRef": "main",
"branchTemplate": "slaw/{{issue.identifier}}",
"worktreeParentDir": "/tmp/slaw-worktrees"
}
}

env bindings

The env field accepts plain values or secret references:

{
"env": {
"MY_KEY": { "type": "plain", "value": "my-value" },
"SECRET_TOKEN": { "type": "secret_ref", "secretId": "my-secret-id" }
}
}

Minimal example

{
"adapterType": "claude_local",
"adapterConfig": {
"cwd": "/home/agent/workspace",
"model": "claude-sonnet-4-6",
"dangerouslySkipPermissions": true,
"timeoutSec": 0,
"graceSec": 15
}
}

Session behaviour

SLAW stores the session ID and cwd after each run. On the next Heartbeat, Claude Code resumes the prior session with --resume when the stored cwd matches the current working directory. If the cwd changes (for example when a new workspace is created), a new session starts.

Notes

  • dangerouslySkipPermissions defaults to true because SLAW runs Claude in headless --print mode where interactive permission prompts cannot be answered.
  • When SLAW provisions a workspace or runtime for a run, it injects SLAW_WORKSPACE_* and SLAW_RUNTIME_* environment variables for agent-side tooling.
  • The cheap model profile uses claude-sonnet-4-6 with effort: low as a lower-cost lane while preserving the primary model for normal runs.

Next steps