Documentation Index
Fetch the complete documentation index at: https://docs.getcore.me/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Coding capability lets CORE spawn coding agents — Claude Code or Codex CLI — on your gateway. Start a coding session from WhatsApp, watch it stream in the webapp’s terminal tab, resume it days later, and keep working. Sessions are owned by the agent itself: their transcripts live wherever the agent writes them (~/.claude for Claude Code, ~/.codex/sessions/... for Codex). The gateway tracks running PTYs and re-spawns from disk on resume.
Supported Agents
| Agent name | Binary | Notes |
|---|---|---|
claude-code | claude | Anthropic’s CLI coding agent. ANTHROPIC_API_KEY skips OAuth. |
codex-cli | codex | OpenAI’s CLI coding agent. OPENAI_API_KEY skips OAuth. |
AGENT_TEMPLATES in the CLI) — adding a new agent means adding a template entry and start/resume args.
The gateway auto-detects agent binaries on PATH even if they aren’t yet configured, so the webapp’s Configure + Log in dialog can show a one-click setup. Configured agents appear in manifest.agents; detected-but-unconfigured ones in manifest.availableAgents.
Setup
ANTHROPIC_API_KEY / OPENAI_API_KEY to skip the OAuth log-in step.
Gateway Tools
These are the tools exposed to LLM callers via the manifest. They map directly to per-tool routes (POST /api/coding/<name>).
coding_ask
Send a prompt to a coding agent. Omit sessionId to start a new session; include it to continue an existing one.
worktree is true the gateway handles git worktree add itself — do not describe worktree setup in the prompt. Use coding_read_session afterwards to read what the agent did.
coding_read_session
Read structured conversation turns (user / assistant) from a session.
status of "initializing", "running", "completed", or "failed" so callers can distinguish “agent still booting” from “agent exited without writing”.
coding_close_session / coding_close_all
Stop a running session (or every running session) and clean up worktrees.
coding_list_sessions
List sessions sorted by most recent. Reads from each agent’s on-disk transcripts, not just sessions this gateway started.
coding_search_sessions
Search past sessions by title or first-message content.
coding_list_agents
List configured agents and which one is the default. No params.
Webapp-Only Primitives
The webapp also calls two non-LLM routes to drive the live terminal pane:POST /api/coding/spawn— allocate or resume a PTY without sending a prompt. Used by the Open terminal / Reconnect affordances. Returns{ sessionId, pid, status: "new" | "reconnect" | "resumed" }.WS /api/coding/coding_xterm_session?session_id=…— attach to a session’s PTY. Auto-resumes the agent if the PTY is gone but the on-disk transcript still exists.
packages/gateway-protocol/README.md for the full route table.
Folder Scope
coding_ask and /api/coding/spawn validate dir against registered folders. The path must resolve into a folder that includes the coding scope:
Worktrees
Settingworktree: true on coding_ask makes the gateway:
- Resolve
dirto its git repo. - Create
git worktree add ../<branch> <baseBranch>for the new branch. - Run the agent inside that worktree so changes never touch your working tree.
- Clean up the worktree on
coding_close_session.
Session Lifecycle
Start
coding_ask with no sessionId allocates a UUID and spawns the agent in dir. For Codex, the agent picks its own UUID — the gateway re-keys to match so future lookups find the right transcript.Running
The PTY is alive; output streams to the xterm WS and the agent’s transcript file.
coding_read_session returns turns with status: "running".Resume
A new
coding_ask (or webapp reconnect) with the same sessionId either re-attaches to the live PTY or re-spawns the agent with --resume <sessionId>.Use Cases
Remote bug fixing: “Fix the payment processing error incheckout.ts.” CORE spawns coding_ask against your api folder. You watch it from the webapp terminal pane.
Async code reviews: “Review the changes in the auth PR and suggest improvements.” CORE starts a session, calls coding_read_session after a sleep tool call, and summarises.
Automated refactoring: “Migrate all API routes from Express to Hono.” Run with worktree: true so the agent works on its own branch.
Night shifts: Set a reminder: “At 2am, run the database migration script and report any errors.” A scheduled action calls exec_command and coding_ask together.