How Adapters Work
When a heartbeat fires, Paperclip:- Looks up the agent’s
adapterTypeandadapterConfig - Calls the adapter’s
execute()function with the execution context - The adapter spawns or calls the agent runtime
- The adapter captures stdout, parses usage/cost data, and returns a structured result
Built-in Adapters
Credential ownership for sandbox targets
Local CLI adapters can run on the Paperclip host, SSH targets, or managed sandbox targets. The adapter decides which credential home is authoritative before the CLI starts:
Worked examples:
- Codex sandbox with host ChatGPT login: the host
~/.codex/auth.jsonis symlinked into the managed home, then uploaded as the sandboxCODEX_HOME. Codex reads that uploaded file and does not use anyauth.jsonalready present inside the sandbox image. - Claude sandbox with image login: Paperclip materializes a remote
CLAUDE_CONFIG_DIR, then fills missing.credentials.json/credentials.jsonfrom the sandbox image’s own$HOME/.claude. The snapshot’s Claude login is the credential source for the run.
Hermes local vs gateway
Usehermes_local when Paperclip should start the local hermes CLI on the
same host for each heartbeat. Use hermes_gateway when Hermes is already
running as an HTTP/SSE API server and Paperclip should call that server instead
of spawning a process. Both type keys are stable built-ins.
The unified Hermes package owns both built-in adapters. The older
@paperclipai/adapter-hermes-gateway package remains only as a deprecated
compatibility shim that re-exports the gateway entrypoints for one release.
New plugin overrides should target @paperclipai/hermes-paperclip-adapter and
set the desired type key (hermes_local or hermes_gateway).
External (plugin) adapters
These adapters ship as standalone npm packages and are installed via the plugin system:External Adapters
You can build and distribute adapters as standalone packages — no changes to Paperclip’s source code required. External adapters are loaded at startup via the plugin system.Adapter Architecture
Each adapter is a package with modules consumed by three registries:Choosing an Adapter
- Need a coding agent? Use
claude_local,codex_local,opencode_local,hermes_local, or installdroid_localas an external plugin - Need the richest live run feedback? Use
claude_local,codex_local, orgemini_localwithadapterConfig.engineset toacpwhen the execution environment satisfies the ACP prerequisites — see Feedback granularity - Need Hermes on another host or already running as a service? Use
hermes_gateway - Need to run a script or command? Use
process - Need to call a custom external service? Use
http - Need something custom? Create your own adapter or build an external adapter plugin
Feedback Granularity
Adapter choice determines how much structured, live detail a run’s transcript can show while the agent is still working. Every adapter’s stdout is streamed to the run log and rendered live in the UI — including runs on sandbox execution targets, whose logs are tailed and delivered incrementally — but the granularity of what you see depends on the event stream the adapter emits. Rough tiers, richest first:- Native ACP engine (
claude_local,codex_local, orgemini_localwithengine: "acp") — full structured event stream. ACP emits a JSONL event per meaningful runtime moment:acpx.session(agent, mode, session identity),acpx.status(progress text plus context-window usage),acpx.text_delta(assistant/thinking token deltas),acpx.tool_call(tool title, call id, and status updates as the call progresses),acpx.result(stop reason summary), andacpx.error(code, message, retryability). The transcript renders these as live-updating message, thinking, tool, and status blocks, and repeatedacpx.tool_callstatus updates fold into a single tool card instead of stacking duplicates. - CLI wrappers (
claude_local,codex_local,cursor,opencode_local, …). These parse each CLI’s own streaming JSON output. You get assistant text, tool calls/results, and a final usage/cost summary, but granularity is limited to what the CLI prints — some emit tool progress, others only call/finish pairs. - Generic adapters (
process,http). Plain stdout/stderr lines with no structured transcript — you see raw output only.
claude_local, codex_local, or gemini_local when the selected execution environment supports it. Rich ACP status events (including context usage) and incremental tool-call updates give the closest thing to watching the agent work locally.