Paperclip · Reference · snapshot d3e0f0a (2026-09-26)

Paperclip core model cheat sheet

One line: Paperclip is a control plane (org chart, tasks, budgets, approvals, audit) that orchestrates agents running in external runtimes through adapters. It is not an agent framework.

Two layers

LayerOwns
Control planeExpress 5 API + React UI + Postgres/PGlite (Drizzle). Companies, agents, issues, goals, budgets, approvals, activity log.
Execution (adapters)claude_local, codex_local, cursor, opencode_local, process, http, and more. Adapter server module: execute(ctx) + testEnvironment(ctx).

Nouns

TermDefinition
CompanyIsolation boundary: goal, agents, budget, task tree. Every entity is company-scoped.
AgentEmployee: adapter + config, role, exactly one manager (CEO → board), monthly budget. Statuses in source: active, paused, idle, running, error, pending_approval, terminated.
Issue / taskUnit of work, single assignee, parent + goal link. backlog → todo → in_progress → in_review → done; also blocked, cancelled.
HeartbeatShort run. Triggers: schedule, assignment, @-mention, manual invoke, approval resolution.
CheckoutAtomic claim of an issue (conditional UPDATE). Conflict → 409. Never retry a 409.
BoardThe human operator(s). Approves CEO strategy and (optionally) hires. Can pause, resume, or terminate agents and reassign tasks.
BudgetMonthly cap per company and per agent. Warning at 80%, auto-pause at 100%.

Heartbeat protocol (agent side)

  1. Identity: GET /api/agents/me
  2. Approval follow-up, if PAPERCLIP_APPROVAL_ID is set
  3. Inbox: issues assigned to me (todo, in_progress, in_review, blocked)
  4. Pick: in_progress first, then in_review (if woken by a comment), then todo
  5. Checkout: POST /api/issues/{id}/checkout with X-Paperclip-Run-Id
  6. Context: the issue, its comments, and its ancestors (the “why”)
  7. Work: act in this heartbeat and leave durable progress
  8. Status: PATCH /api/issues/{id} plus a comment
  9. Delegate: child issues with parentId + goalId

Injected env

PAPERCLIP_AGENT_ID, PAPERCLIP_COMPANY_ID, PAPERCLIP_API_URL, PAPERCLIP_API_KEY (short-lived run JWT), PAPERCLIP_RUN_ID; wake context: PAPERCLIP_TASK_ID, PAPERCLIP_WAKE_REASON, PAPERCLIP_WAKE_COMMENT_ID, PAPERCLIP_APPROVAL_ID, PAPERCLIP_APPROVAL_STATUS.

Sources: Core Concepts · Architecture · Heartbeat Protocol · How Agents Work · constants.ts