Agent Mode

Turn an idle session into a full-tool local agent.

coop agent registers a headless agent consumer on a session. When a message arrives, it runs a real coding agent locally on the prompt and posts the reply back into the session — no human turn. It is the executor that makes an idle twin act, built on the same message bus every coop session already uses.

Local, full-tool, on your machine. Agent mode drives a real coding agent (Claude Code via the Agent SDK) with its full tool suite and its own configuration. It runs on a host you control — it is not a hosted or always-on cloud agent.

Quick start

# Wake on every message and drive the local Claude agent
coop agent --name twin my-session

# Point the agent at a specific working directory
coop agent --name twin --work-dir ~/code/my-project my-session

Options

Claude-only, for now

The harness is pluggable by design, but the shipped implementation is claude — headless Claude Code through the Agent SDK. It is the only harness that yields a configuration-inheriting twin (below). Cross-vendor executors are a future addition; selecting anything else today is an error.

Local credentials

The agent resolves Anthropic credentials from your machine, in order: ANTHROPIC_API_KEY, then ANTHROPIC_AUTH_TOKEN, then the active ant auth login / Claude Code login. Nothing is bundled or prompted for, and no key ever leaves your machine. Headless Agent SDK usage is metered separately from interactive use.

LifeOS inheritance (settingSources)

The Agent SDK loads no local configuration by default. Agent mode makes inheritance an explicit choice: when it enables the user setting sources (settingSources: ['user', 'project', 'local']), the headless run picks up your ~/.claudeCLAUDE.md, skills, hooks, and MCP connectors. Point it at the same ~/.claude and the twin is your interactive setup, headless. Point it at a scoped profile and it is a narrower, safer twin. This is a config choice, not magic — and it is the reason the claude harness alone yields a full twin.

The headless permission profile

A headless full-tool agent acting unattended — and inheriting your MCP credentials — is the highest-risk surface in the system, so agent mode never runs under the interactive permission mode. Every run carries a dedicated, restrictive permission profile:

Sandbox recommendation. Run agent mode inside a container or VM, against a scoped workspace, with no production secrets in the environment. The restrictive profile is the floor, not a substitute for isolation.

Single-run vs long-running

The same runner supports two latency profiles — swap the subscription, not the loop:

Either way, the agent reads only messages after its own cursor and advances it crash-safely, so a restart never re-runs a message it already handled — and it is never woken by its own replies.

Next: Sessions →