2025-12-09 17:51:05 +00:00
---
2025-12-13 13:25:49 +00:00
summary: "Current agent integration: Pi as the sole coding agent with config examples"
2025-12-09 17:51:05 +00:00
read_when:
- Changing agent invocation or defaults
---
2025-12-13 13:25:49 +00:00
<!-- {% raw %} -->
2025-12-03 15:45:32 +00:00
# Agent Integration 🤖
2025-12-13 13:25:49 +00:00
CLAWDIS ships with a single coding-agent path: **Pi** (RPC mode). Legacy Claude/Codex/Gemini/Opencode integrations have been removed.
2025-12-03 15:45:32 +00:00
2025-12-13 13:25:49 +00:00
## Default behavior
2025-12-03 15:45:32 +00:00
2025-12-13 13:25:49 +00:00
If you don’ t configure `inbound.reply` , CLAWDIS uses the bundled Pi binary in RPC mode:
- command: `pi --mode rpc {{BodyStripped}}`
- per-sender sessions (stored under `~/.clawdis/sessions/*.jsonl` )
- `/new` starts a fresh session
2025-12-03 15:45:32 +00:00
2025-12-13 13:25:49 +00:00
This is usually enough for a personal assistant setup; add `inbound.allowFrom` to restrict who can trigger it.
2025-12-05 22:33:09 +01:00
2025-12-14 03:14:51 +00:00
If you keep an `AGENTS.md` (and optional “memory” files) for the agent, set `inbound.workspace` (preferred) or `inbound.reply.cwd` so Pi runs with the right context.
2025-12-14 02:59:31 +00:00
2025-12-13 13:25:49 +00:00
## Custom agent command (still Pi)
2025-12-03 15:45:32 +00:00
2025-12-13 13:25:49 +00:00
To override the agent command, configure `inbound.reply.mode: "command"` :
2025-12-03 15:45:32 +00:00
2025-12-13 13:25:49 +00:00
```json5
2025-12-03 15:45:32 +00:00
{
2025-12-13 13:25:49 +00:00
inbound: {
reply: {
mode: "command",
command: ["pi", "--mode", "rpc", "{{BodyStripped}}"],
timeoutSeconds: 1800,
agent: { kind: "pi", format: "json" }
}
2025-12-03 15:45:32 +00:00
}
}
```
2025-12-13 13:25:49 +00:00
Notes:
- CLAWDIS forces `--mode rpc` for Pi invocations (even if you pass `--mode json/text` ).
- If your `command` array omits `{{Body}}` /`{{BodyStripped}}` , CLAWDIS still synthesizes the prompt body for RPC mode.
2025-12-03 15:45:32 +00:00
2025-12-13 13:25:49 +00:00
## Sessions
2025-12-03 15:45:32 +00:00
2025-12-13 13:25:49 +00:00
Session behavior lives under `inbound.reply.session` :
2025-12-03 15:45:32 +00:00
2025-12-13 13:25:49 +00:00
```json5
2025-12-03 15:45:32 +00:00
{
2025-12-13 13:25:49 +00:00
inbound: {
reply: {
session: {
scope: "per-sender",
resetTriggers: ["/new", "/reset"],
idleMinutes: 10080,
sendSystemOnce: true,
sessionIntro: "You are Clawd. Be a good lobster."
}
}
2025-12-03 15:45:32 +00:00
}
}
```
2025-12-13 13:25:49 +00:00
Defaults when `session` is enabled:
- Session files are written to `~/.clawdis/sessions/{{SessionId}}.jsonl` .
- Resume adds `--continue` automatically (Pi needs it to load prior messages).
2025-12-03 15:45:32 +00:00
## Heartbeats
2025-12-13 13:25:49 +00:00
If you enable `inbound.reply.heartbeatMinutes` , CLAWDIS periodically runs a heartbeat prompt (default: `HEARTBEAT /think:high` ).
2025-12-03 15:45:32 +00:00
2025-12-13 13:25:49 +00:00
- If the agent replies with `HEARTBEAT_OK` (exact token), CLAWDIS suppresses outbound delivery for that heartbeat.
- If you want a different command for heartbeats, set `inbound.reply.heartbeatCommand` .
2025-12-03 15:45:32 +00:00
2025-12-13 13:25:49 +00:00
```json5
2025-12-03 15:45:32 +00:00
{
2025-12-13 13:25:49 +00:00
inbound: {
reply: {
heartbeatMinutes: 30,
heartbeatCommand: ["pi", "--mode", "rpc", "HEARTBEAT /think:high"]
2025-12-03 15:45:32 +00:00
}
}
}
```
2025-12-13 13:25:49 +00:00
## Tool streaming (RPC)
2025-12-03 15:45:32 +00:00
2025-12-13 13:25:49 +00:00
RPC mode emits structured tool lifecycle events (start/result) and assistant output. These are:
- logged to `/tmp/clawdis/…`
- streamed over the Gateway WS to clients like WebChat and the macOS app
2025-12-03 15:45:32 +00:00
2025-12-13 15:15:09 +00:00
## Browser helpers
If you enable the clawd-managed browser (default on), the agent can use:
- `clawdis browser status` / `tabs` / `open <url>` / `screenshot [targetId]`
2025-12-13 18:48:55 +00:00
- `clawdis browser snapshot --format ai` (returns an AI snapshot with `[ref=…]` ids)
- `clawdis browser click <ref>` (click by ref from an AI snapshot)
2025-12-13 15:15:09 +00:00
This uses a dedicated Chrome/Chromium profile (lobster-orange by default) so it doesn’ t interfere with your daily browser.
2025-12-13 17:37:00 +00:00
## Debugging `clawdis-mac` errors
When the agent runs `clawdis-mac` (often over SSH), the CLI prints compact, human-readable errors by default.
- To get the full `NSError` dump (domain/code/userInfo), rerun with `CLAWDIS_MAC_VERBOSE_ERRORS=1` in the environment.
2025-12-03 15:45:32 +00:00
---
2025-12-13 13:25:49 +00:00
*Next: [Group Chats ](./group-messages.md )* 🦞
<!-- {% endraw %} -->