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 loginorANTHROPIC_API_KEYset)
Configuration
Set adapterType: claude_local on the agent and provide the config below.
Config fields
| Field | Type | Default | Description |
|---|---|---|---|
cwd | string | — | Absolute working directory for the agent process; created if missing |
instructionsFilePath | string | — | Absolute path to a markdown file injected as system instructions at runtime |
model | string | — | Claude model ID (see Models) |
effort | string | — | Reasoning effort: low, medium, or high; passed as --effort |
chrome | boolean | false | Pass --chrome to Claude |
promptTemplate | string | — | Template for the run prompt; supports {{issue}} and related variables |
maxTurnsPerRun | number | — | Maximum turns allowed per Heartbeat run |
dangerouslySkipPermissions | boolean | true | Pass --dangerously-skip-permissions; required for unattended headless runs |
command | string | claude | Override the Claude Code binary path |
extraArgs | string[] | — | Additional CLI arguments appended to the invocation |
env | object | — | Environment variables injected into the agent process |
workspaceStrategy | object | — | Execution workspace strategy (see Workspace strategy) |
workspaceRuntime | object | — | Reserved for workspace runtime metadata; runtime services are managed from the UI |
timeoutSec | number | 0 | Run timeout in seconds; 0 means no timeout |
graceSec | number | 15 | SIGTERM grace period before SIGKILL |
Models
| Model ID | Label |
|---|---|
claude-opus-4-8 | Claude Opus 4.8 |
claude-opus-4-7 | Claude Opus 4.7 |
claude-opus-4-6 | Claude Opus 4.6 |
claude-sonnet-4-6 | Claude Sonnet 4.6 |
claude-haiku-4-6 | Claude Haiku 4.6 |
claude-sonnet-4-5-20250929 | Claude Sonnet 4.5 |
claude-haiku-4-5-20251001 | Claude 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
dangerouslySkipPermissionsdefaults totruebecause SLAW runs Claude in headless--printmode where interactive permission prompts cannot be answered.- When SLAW provisions a workspace or runtime for a run, it injects
SLAW_WORKSPACE_*andSLAW_RUNTIME_*environment variables for agent-side tooling. - The
cheapmodel profile usesclaude-sonnet-4-6witheffort: lowas a lower-cost lane while preserving the primary model for normal runs.