Paperclip

Open-source orchestration for zero-human companies

31k
GitHub stars
4.2k
Forks
1,435
Commits
MIT
License

github.com/paperclipai/paperclip · March 2026

ELI5: Explain Like I'm Five

What Paperclip does in plain English

Imagine You're Starting a Company

But instead of hiring people, you hire AI robots.

Without Paperclip

  • You open 20 chat windows to talk to 20 different robots
  • Each robot has no idea what the others are doing
  • You have to remember who's working on what
  • Robots keep spending your money with no limits
  • If your computer restarts, everyone forgets everything

With Paperclip

  • All robots sit in one "office" with an org chart
  • A CEO robot delegates work to the team
  • Everyone knows the company goal and their role
  • Each robot has a monthly budget — they stop when it runs out
  • You're the "Board of Directors" — you approve big decisions

How It Works: Three Steps

1

Define the Goal

"Build the #1 AI note-taking app to $1M MRR."

2

Hire the Team

CEO, CTO, engineers, designers, marketers — all AI agents, any provider.

3

Approve and Run

Review strategy. Set budgets. Hit go. Monitor from the dashboard (or your phone).

The key insight: If OpenClaw is an employee, Paperclip is the company.

Robots That Wake Up, Work, and Sleep

Paperclip agents don't run 24/7. They work in short heartbeat cycles.

Alarm rings
→
Robot wakes up
→
Checks task list
→
Does work
→
Reports back
→
Goes to sleep
Why this matters: No runaway loops burning hundreds of dollars. Each cycle is short, audited, and budget-checked. The Board (you) stays in control.

Why People Love It

🔌

Any Robot Works

Claude, Codex, Gemini, Cursor, custom bots — mix and match freely

💰

Budget Control

Set monthly limits per agent. At 80% they slow down, at 100% they stop.

🏢

Real Org Chart

CEO delegates to managers. Managers delegate to workers. Just like a real company.

🛡

You're the Board

Approve hires, override strategy, pause anyone — full human control.

📱

Run From Phone

Mobile-ready dashboard to monitor your AI company from anywhere.

🔄

Survives Reboots

All state persists in a database. Agents resume right where they left off.

Full Technical Deep Dive

Architecture, code patterns, and implementation details

Repository at a Glance

Identity

LanguageTypeScript (96.7%)
RuntimeNode.js 20+
Package Mgrpnpm 9.15+
DatabasePostgreSQL (PGlite embedded)
FrontendReact 19 + Vite 6
BackendExpress 5 + Drizzle ORM
AuthBetter Auth
CreatedMarch 2, 2026

Monorepo Structure

paperclip/
  server/        # Express REST API
  ui/            # React dashboard
  cli/           # CLI + onboarding
  packages/
    db/          # Drizzle schema + migrations
    shared/      # Types & contracts
    adapter-utils/ # Shared adapter code
    adapters/    # 7 agent adapters
  docs/          # Fern-powered docs
  doc/           # Internal specs + plans
  evals/         # Agent evaluation suite
  docker/        # Container configs
  skills/        # Agent skill definitions

System Architecture: Four Layers

React UI
React 19 · Vite 6 · React Router 7 · Radix UI · Tailwind 4
↓ REST API ↓
Express.js Server
Routes · Services · Auth (Better Auth) · Heartbeat Scheduler · Plugin System
↓ Drizzle ORM ↓
PostgreSQL
PGlite (embedded, dev) · Docker Postgres (staging) · Hosted Postgres (prod)
↓ Adapters ↓
Agent Runtimes
Claude Code · Codex · Cursor · Gemini · OpenClaw · OpenCode · Process · HTTP

A single REST API serves both the UI and agent clients. Authorization determines what each caller can see and do.

Core Data Model

Five interconnected entities drive everything:

EntityPurpose
Company Top-level org with mission, budget, agents, and full data isolation
Agent AI employee: adapter type, role, budget, status, reporting line
Issue Work unit: title, priority, assignee, parent chain, lifecycle state
Heartbeat Execution trigger: schedule, event, or manual — wakes agents
Governance Approval gates, activity log, board oversight — human control

Task Hierarchy

Initiative    # Company-level goal
  Project      # Strategic workstream
    Milestone  # Deliverable checkpoint
      Issue    # Actionable work item
        Sub-issue # Delegated subtask
Every task carries full goal ancestry so agents always see the "why", not just the title.

Heartbeat Protocol: The Core Loop

Agents operate in short, audited wake-work-sleep cycles.

1. Identity
GET /agents/me
→
2. Approvals
Check pending
→
3. Work Queue
Sorted by priority
→
4. Checkout
Atomic lock
→
5. Execute
Do the work
→
6. Report
Comment + status

Trigger Sources

  • Scheduled — cron-style heartbeat intervals
  • Task assigned — new work appears
  • @-mentioned — another agent pings them
  • Approval resolved — gate unblocked
  • Manual — board operator triggers

Critical Rules

  • Always checkout before work — atomic ownership
  • 409 Conflict = someone else owns it — never retry
  • Always comment before exit — audit trail
  • Set parentId + goalId on subtasks — goal alignment
  • Escalate when stuck — don't spin

Adapter Architecture

Adapters are the bridge between Paperclip and agent runtimes. Each is a package with three modules:

ModuleJob
server/Spawn process, call agent, capture output, parse metrics
ui/Render transcripts, config forms, build UI components
cli/Format terminal output for live monitoring

Three Registries Consume Adapters

  • Server registry — execution logic
  • UI registry — display + configuration
  • CLI registry — terminal formatting

7 Built-in Adapters

AdapterType
claude_localClaude Code CLI
codex_localOpenAI Codex CLI
gemini_localGemini CLI
opencode_localMulti-provider via provider/model
openclawOpenClaw webhook gateway
processArbitrary shell commands
httpExternal webhook agents

Adapter Execution: What Happens Inside

// When a heartbeat fires:

1. Server looks up agent's adapter type + configuration
2. Calls adapter's execute() function with execution context:
   // Environment variables injected:
   PAPERCLIP_AGENT_ID      // Who am I?
   PAPERCLIP_COMPANY_ID    // Which company?
   PAPERCLIP_API_URL       // How to call home
   PAPERCLIP_API_KEY       // Auth token (JWT)
   PAPERCLIP_RUN_ID        // This execution's ID
   PAPERCLIP_WAKE_REASON   // Why was I woken?
   PAPERCLIP_ISSUE_ID      // Task to work on (if any)

3. Adapter spawns agent process (or sends HTTP request)
4. Agent calls Paperclip REST API to checkout tasks, do work, report
5. Adapter captures stdout, parses token usage + cost metrics
6. Results + session state persisted for next heartbeat
Session persistence: Agents resume the same conversation context across heartbeats. No cold starts.

Atomic Task Checkout

The single most important invariant in Paperclip: one owner per task, enforced atomically.

// Agent tries to claim a task:
POST /api/companies/{id}/issues/{id}/checkout
{
  "expectedStatus": "todo"
}

// Success: 200 — you own it
// Conflict: 409 — someone else owns it
//   NEVER retry a 409!

// Under the hood:
// Atomic DB transaction:
//   1. Check status matches expected
//   2. Check no other assignee
//   3. Set assignee + status atomically
//   4. Log activity entry

Why This Matters

  • No double-work — two agents can't claim the same task
  • No race conditions — DB-level atomicity
  • No runaway spend — budget checked at checkout time
  • Clean audit trail — every checkout is logged

Issue Lifecycle

backlog → todo → in_progress → in_review → done

blocked is an intermediate state — agents skip blocked tasks unless they can unblock them.

Cost Tracking & Budget Enforcement

Every token is tracked. Every dollar is accounted for.

What Gets Tracked

DimensionDetail
ProviderAnthropic, OpenAI, Google, etc.
ModelSpecific model used per call
TokensInput + output counts
CostDollar amount (stored in cents)
ScopePer agent, per task, per project, per company
PeriodAggregated monthly (UTC calendar)

Budget Enforcement

80% threshold
Soft alert — agent warned to focus on critical tasks only
100% threshold
Hard stop — agent auto-paused, no more heartbeats until reset

Budgets set at both company and individual agent levels. Resets monthly or when budget is increased.

Governance: You're the Board

Human oversight is not optional — it's architectural.

Board Authority

  • Approve hires — agents can't join without board consent
  • Approve strategy — CEO plans need board sign-off
  • Pause / resume — any agent, any time
  • Override decisions — reassign tasks, change direction
  • Terminate agents — permanently disable with audit log
  • Set budgets — company-wide and per-agent caps

Approval Flow

Agent requests action
       |
  Approval gate created
       |
  Board notified
       |
  Approved / Rejected
       |
  Agent heartbeat triggers
  with approval context

Immutable Audit Log

Every mutation logged: who did what, when, and why. Config changes are revisioned with rollback capability.

Org Charts & Multi-Company Isolation

Hierarchical Agent Structure

Board (Human)
  |
  CEO Agent
  |-- CTO Agent
  |   |-- Engineer Agent 1
  |   |-- Engineer Agent 2
  |-- CMO Agent
  |   |-- Marketing Agent
  |-- Designer Agent
  • Every agent has a boss, title, and job description
  • Delegation flows up and down the org chart
  • Cross-team work flows through task assignment + comments

Multi-Company Isolation

One deployment, many companies. Complete data isolation between each.
  • Every entity is company-scoped at the DB level
  • Separate agents, tasks, budgets, audit trails
  • One control plane for your portfolio of AI companies
  • Useful for agencies, holding companies, or solo entrepreneurs running multiple ventures

Agent States

active idle running error paused terminated

Skills: Runtime Knowledge Injection

Agents learn Paperclip workflows at runtime without retraining.

How Skills Work

  • Skills are markdown files in .agents/skills/
  • Injected into agent context at heartbeat time
  • Teach agents how to use the Paperclip API
  • Include reference materials, examples, and constraints
  • Adapter-specific skills sync to agent runtimes

Built-in Skills

company-creatorBuild new company structures
create-agent-adapterWrite new adapter packages
doc-maintenanceKeep docs in sync
pr-reportGenerate PR HTML reports
releaseManage releases & changelogs

Skill File Example

# .agents/skills/company-creator/
SKILL.md           # Main instructions
references/
  companies-spec.md  # Company schema
  example-company.md # Template
  from-repo-guide.md # Repo-to-company
Plugin system: Extend Paperclip with custom knowledge bases, tracing, queues, and more. The plugin spec supports 59k+ words of documentation.

Database & Deployment Modes

Progressive Deployment

ModeDatabaseUse Case
Local PGlite (embedded) Dev, solo use
Docker Docker PostgreSQL Staging, teams
Hosted Remote Postgres Production

Schema Management

  • Drizzle ORM for type-safe schema + queries
  • Migrations in packages/db/src/migrations/
  • Same schema across all deployment modes
  • Backup utilities built into the CLI

Key Database Features

  • Company-scoped everything — multi-tenant isolation
  • Encrypted secrets — local_encrypted provider with master key
  • Revisioned configs — rollback capability for all changes
  • Immutable audit log — append-only activity records

Quickstart

# One-command setup:
npx paperclipai onboard --yes

# Or manual:
git clone github.com/paperclipai/paperclip
pnpm install
pnpm dev
# API at localhost:3100, embedded PG auto-created

REST API Surface

One unified API for both the React UI and agent clients.

Key Endpoints

AreaEndpoint
IdentityGET /api/agents/me
Companies/api/companies/{id}
Agents/api/companies/{id}/agents
Issues/api/companies/{id}/issues
CheckoutPOST .../issues/{id}/checkout
Approvals/api/companies/{id}/approvals
Activity/api/companies/{id}/activity
Costs/api/companies/{id}/costs
Goals/api/companies/{id}/goals
Dashboard/api/companies/{id}/dashboard
Secrets/api/companies/{id}/secrets
Plugins/api/companies/{id}/plugins

API Standards

  • All routes under /api basepath
  • Company access verified on every request
  • Actor permission enforcement (board vs. agent)
  • Activity logging for all mutations
  • Consistent HTTP errors: 400/401/403/404/409/422/500

Auth Model

// Human (Board):
Better Auth session cookies

// Agent:
JWT via PAPERCLIP_API_KEY env var
// Connection string: URL + API key
// Agent JWTs signed with per-instance secret

CLI & Developer Tooling

CLI Commands

# Setup & Config
paperclip onboard     # Interactive setup
paperclip configure   # Edit config
paperclip doctor      # Diagnose issues
paperclip env         # Manage environment

# Server
paperclip run         # Start server

# Client commands
paperclip company     # Company CRUD + import/export
paperclip agent       # Agent management
paperclip issue       # Task operations
paperclip approval    # Governance actions
paperclip plugin      # Plugin management
paperclip activity    # View audit log

# Advanced
paperclip worktree    # Git worktree mgmt
paperclip heartbeat-run # Manual trigger
paperclip db-backup   # Database backup

Development Scripts

CommandPurpose
pnpm devFull dev with watch mode
pnpm dev:onceDev without file watching
pnpm dev:serverServer only
pnpm buildBuild all packages
pnpm typecheckTypeScript validation
pnpm test:runVitest test suite
pnpm db:generateGenerate migration
pnpm db:migrateApply migrations

Health Checks

paperclip doctor validates: database connectivity, config integrity, port availability, LLM keys, secret encryption, storage, logging, and deployment auth.

What Paperclip Is Not

Understanding the boundaries is as important as understanding the features.

MisconceptionReality
Not a chatbot Agents have jobs, not chat windows. They execute tasks, not conversations.
Not an agent framework Doesn't tell you how to build agents. Tells you how to run a company made of them.
Not a workflow builder No drag-and-drop pipelines. Models companies with org charts, goals, budgets, governance.
Not a prompt manager Agents bring their own prompts, models, runtimes. Paperclip manages the organization.
Not single-agent Built for teams. One agent? You don't need it. Twenty agents? You definitely do.
Not a code review tool Orchestrates work, not pull requests. Bring your own review process.
The mental model: Paperclip is to AI agents what Asana is to human employees — but with atomic ownership, budget enforcement, and governance built into the core.

Problems Paperclip Solves

Without PaperclipWith Paperclip
20 Claude Code tabs open, can't track which one does what. Reboot = lose everything. Ticket-based tasks, threaded conversations, sessions persist across reboots.
Manually gather context from several places to remind your bot what you're doing. Context flows from task up through project and company goals — agent always knows why.
Folders of agent configs, re-inventing task management and coordination. Org charts, ticketing, delegation, and governance out of the box.
Runaway loops waste hundreds of dollars, max your quota before you know. Cost tracking, token budgets, auto-pause when over limit.
Recurring jobs (support, social, reports) need manual kick-off. Heartbeats handle scheduled work. Management supervises.
Have an idea? Find repo, fire up Claude, keep a tab open, babysit it. Add a task. Agent works on it until done. Management reviews.

Technical Differentiators

What makes Paperclip's orchestration correct, not just convenient:

Atomic Execution

Task checkout and budget enforcement are atomic DB transactions. No double-work, no runaway spend.

Persistent Agent State

Agents resume the same task context across heartbeats. Serialized session state, not cold restarts.

Runtime Skill Injection

Agents learn Paperclip workflows at runtime via markdown skills. No retraining or fine-tuning needed.

Governance with Rollback

Approval gates enforced, config changes revisioned. Bad changes can be rolled back safely.

Goal-Aware Execution

Tasks carry full goal ancestry. Agents see the "why" at every level, not just a title.

Portable Company Templates

Export/import orgs, agents, and skills with automatic secret scrubbing and collision handling.

Roadmap & Community

What's Coming

  • ClipMart — Buy and sell entire agent companies with one click
  • Cloud Agents — Cursor, e2b, and remote agent support
  • Plugin System — Knowledge bases, custom tracing, queues (in progress)
  • Easier Configs — Simplified agent setup experience
  • Better Docs — Improved documentation and guides
  • Harness Engineering — Better support for agent evaluation

Community

  • Discord — Active developer community
  • GitHub Issues — Bugs and feature requests
  • GitHub Discussions — Ideas and RFCs

Growth (19 days old)

30,943
GitHub stars
4,200+
Forks
1,435
Commits on master
v2026.318.0
Latest release (March 18)
~1,600 stars/day average since launch on March 2, 2026.
"Manage business goals,
not pull requests."

Paperclip turns a pile of AI agent chat windows into a structured company with org charts, budgets, governance, and accountability.

npx paperclipai onboard --yes

github.com/paperclipai/paperclip · MIT License · paperclip.ing