omp packages

@kentaylorappdev/picode0.6.0

Cross-picode communication extension for pi coding agent — independent threads that coordinate work, share state, and converse without losing context

kentaylorappdev Published 4 days ago MIT ~0 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

Picode

Run a team of Pi coding agents without merging their sessions. Ask one coordinator to investigate work, delegate implementation, and verify the result. Workers keep their own conversation history and report back through durable mailboxes instead of relying on terminal output.

Install · Quick start · How it works · Contributing

What you get

  • A hands-on coordinator. It reads, searches, and runs checks directly, delegates coding by default, and can take over when you say “you do this.”
  • Tracked replies. A worker going idle doesn't mean it answered. Picode tracks which tasks still need a reply, even across restarts.
  • Visible, resumable workers. Herdr runs workers in panes you can inspect. Picode can reuse a worker or resume a stopped session with its handoff and context.
  • Local by default. Coordination state lives in .picode/; no message broker is required. Slash commands and the CLI let you see what's still in flight.

Install

Use Node.js 22.19 or newer, install Herdr, and configure a model provider in Pi. Install Pi with npm install -g @earendil-works/pi-coding-agent if you don't have it yet. Then run:

herdr integration install pi
pi install git:github.com/ktappdev/picode@main

Picode installs into Pi directly from GitHub. Herdr is required for the coordinator and automatic worker management. For messaging between manually started workers, see Runtime notes.

Quick start

Open a Herdr pane in the repo you want to work on and start the coordinator:

pi --picode-id coordinator

Try one of these requests:

  • “Check what changed on this branch.” The coordinator inspects the repo itself.
  • “Fix the invoice rounding bug and verify it.” The coordinator scopes the change, delegates implementation to a worker, and checks the result.
  • “You fix the invoice rounding bug yourself.” The coordinator takes over the implementation and verification.

You don't need to start workers yourself. Use /picode-status to see outstanding replies and /picode-list to see the team.

Picode is opt-in. Use --picode-id, the coordinator shorthand --picode, or resume a session that already has a Picode identity. Sessions in the same working directory share coordination data under .picode/.

Optional: picode shell shortcut

To run picode coordinator instead of pi --picode-id coordinator, add this alias to your Bash or Zsh profile:

alias picode='pi --picode-id'

For PowerShell, add this function to $PROFILE:

function picode { pi --picode-id @args }

Open a new shell to use the shortcut.

How Picode and Herdr work together

Herdr runs the agents; Picode coordinates them. Herdr manages panes, tabs, and Pi processes. Picode manages identities, roles, task messages, and replies.

  1. The coordinator finds an available worker or uses spawn_worker to start one in Herdr.
  2. It dispatches work with picode_send and requests a reply. The worker sees the task in its own Pi session.
  3. The worker reports back with picode_finish, which saves a handoff and sends the final reply. The coordinator checks the result and can reuse, revive, or clean up the worker.

Pane status and reply status are separate: an idle worker may still owe a reply. See the message model and storage backends for how Picode keeps track.

Runtime notes

Picode detects Herdr automatically. Set PICODE_RUNTIME=herdr to require it for a worker session. The coordinator already requires Herdr.

For manual messaging, start a worker with pi --picode-id builder in the same working directory as its peers. Without Herdr, these workers can still send and receive messages, but automatic spawning and pane tools aren't available.

To try a worker without installing Picode, use Pi's extension option:

pi -e git:github.com/ktappdev/picode@main --picode-id my-picode

The message model

There is only one message shape: the envelope. Two optional fields give it meaning.

Envelope {
  id            its own identity, minted per send, looks like <from>/<ulid>
  from, to      sender and target picode names
  body          the content
  sentAt        ISO-8601 timestamp
  re?           reply correlation: settles the debt on that envelope id
  expects?      true means the sender needs a reply, tracked until one arrives
  urgency?      "interrupt" cancels the receiver's unstarted tool calls and steers;
                "high" steers at the next opening; "low" waits until idle
  deliverAfter? not deliverable before this instant
  expiresAt?    not deliverable after this instant
}

Here is how it reads in practice:

  • expects: true makes a request. The receiver records an owed reply. The sender records an obligation with a deadline (15 minutes by default) and gets a one-time nudge if it is not answered in time.
  • re: <id> makes a reply. It settles the debt.
  • Both together is a reply that asks a follow-up, useful when you can't answer without more information.
  • Neither is a plain note.
  • urgency sets when it lands. low (the default) waits until the receiver is idle; high steers — the receiver reads it at its next opening, before its next model request; interrupt steers and preempts — the receiver's tool calls that have not started yet are cancelled so it reads you before its next model request. An interrupt is labelled [interrupt request from …] in the message header. It cannot cancel a tool call that is already running.

There are no message types on the wire and no locks. If a picode wants to block on a reply, it arms a barrier (with wait=true or picode_wait) and ends its turn. The reply wakes it. A scheduled self-wake is just an envelope to your own name with deliverAfter.

Messages show up as [<kind> from <sender> #<id>]. The kind (request, reply, reply+request, or note) is derived from the fields, and requests carry the id you should echo back as re.

Tools the model can use

Tool Purpose
picode_send Send an envelope to one name, a,b, *, or role:<role>. Supports expects, re, urgency (interrupt redirects a worker mid-task), deliverAfterSeconds, wait=true to arm a barrier inline.
picode_wait Wait for all or any of several outstanding replies (a barrier). Accepts deadlineSeconds and an optional message injected on resolution. action="cancel" drops a barrier armed on a bad id (barrier ids or awaited envelope ids).
picode_status Read this picode's state, obligations, owed replies, barriers, and open papercut count.
picode_list List all known threads in the workspace. recent=true adds the recent-workers digest (exact ids, derived areas, context age, what each left unverified) — use it before revive_closed_session.
picode_journal Report tool/harness/setup papercuts or list open issues from the shared Markdown journal. Old work journals remain readable as archives.
picode_suspend Mark this picode On Hold. The inbox queues until resume.
picode_resume Resume from On Hold and drain queued messages.
picode_panes Survey panes/windows in the current runtime scope: status, role, and cleanup suggestions. Read-only surveillance.
picode_pane_read Read a worker pane's terminal output (scrollback). Use for silent worker recovery — when a worker owes a reply but hasn't sent via picode_send.
spawn_worker Spawn a new worker pane: splits, names, launches pi, waits for idle. Auto-reuses idle workers, claims empty panes, grid-aware split direction. Optional tab param for multi-tab spawning.
picode_tab_create Open a Herdr tab. Coordinator-only.
picode_tab_close Close a Herdr tab. Refuses working or coordinator panes. Coordinator-only.
cleanup_panes Close known stale worker panes in the current runtime scope. dry_run=true previews; pane_id="<id>" targets one; force=true permits idle workers.
picode_purge Delete stale picode data directories. Default skips local debts and coordinator references; force=true also reconciles this picode's ledgers.

Slash commands for humans

Command Purpose
/picode-status Show state and the open papercut count.
/picode-list List all known threads.
/picode-send <to> <body> Send a high-urgency note to another picode.
/picode-suspend Mark On Hold.
/picode-resume Resume from On Hold.
/picode-models Show, set, or reset per-role worker model config.
/picode-thinking Show, set, or reset per-role worker thinking levels.
/picode-journal View papercuts and mark issues solved.
/picode-quiet Toggle the quiet operator screen (display only).

/picode-quiet hides picode's traffic rows — envelope batches, system prompts, and quiet-tool call rows — without changing behavior: messages, obligations, journal, status, and the model's context are untouched. Steered (⚠) and interrupt (⛔) envelopes stay visible, and expanding any row still shows it. Usage: /picode-quiet [on | off | status] [--project]. The saved setting resolves PICODE_QUIET_TUI=1|0 env → project <git-root>/.picode/quiet-tui.json → global ~/.pi/agent/.picode/quiet-tui.json → loud (default).

Worker roles

Each picode has a role that shapes its system prompt. The role is auto-detected from the name you give it.

Role Subtype Description
coordinator - Handles routine work directly, delegates code implementation by default, and implements personally when asked.
builder Worker Implements code changes, edits files, runs type checks.
reviewer Worker Reviews diffs, audits for bugs, security, and quality. Read-only.
scout / explorer Worker Explores the codebase, finds files, answers architecture questions. Read-only. Summarizes findings instead of dumping raw output.
bug-hunter Worker Hunts bugs by reading code, session entries, task envelopes, and handoff notes. Reports root cause and a suggested fix but does not implement it. Read-only.
tester Worker Writes and runs tests, reproduces bugs, checks coverage.
designer Worker Designs and implements frontend UI. Reads existing frontend patterns, keeps scope to UI work, and reports any required cross-layer changes.
visionary Worker Reads attached or local images and reports grounded observations. Read-only; requires a multimodal model.
gauntlet Worker Adversarial production hardener with split personalities (review → fix → test). Finds realistic production failures, fixes them, leaves regression tests. Full tools except dispatch.

UI work can route directly to designer: it reads the existing frontend, designs and implements its own UI plan. Use reviewer only when risk or diff size warrants a narrow functional-preservation audit; reviewer checks that existing behavior still works, not visual direction. Use planner or builder when the change is complex, cross-cutting, or explicitly split into design and implementation.

Prefix matching means builder-1, builder-a, builder_foo, and builder.task all resolve to the builder role. Any name that does not match a known role (or prefix) becomes a generic worker with base worker rules only.

The communication contract

Workers reply to the coordinator only through picode_send. Plain text typed in a worker's pane reaches the human user, not the coordinator. If a worker answers in plain text, the coordinator never sees it and the human has to relay it. This contract is built into every worker prompt.

If a worker goes silent (no picode_send reply within about 10 minutes), the coordinator's recovery rule kicks in: read the worker's pane output, find the plain-text reply, and either accept it or resend the request while reminding the worker to use picode_send.

Coordinator mode

When a picode has the coordinator role (auto-detected from the name coordinator):

  • Routine work stays with the coordinator. File reads, repository searches, diff inspection, focused checks, and straightforward authorized pushes or PRs do not need a worker.
  • Code implementation is delegated by default. The coordinator scopes the work and verifies the result. Larger tasks can be split among workers when that helps.
  • Say “you do this” to take over a task. The coordinator handles the core work itself, including edits and verification, and may enlist workers for narrow support unless you say otherwise. This applies only to the task at hand.
  • The coordinator is not read-only. It keeps the session's configured tools, including editing and shell tools when available. Delegation is a behavior rule, not a permission boundary.
  • Herdr-native orchestration. The coordinator uses Herdr to create and reuse worker panes, open tabs when needed, inspect output and lifecycle, and clean up stale workers. Picode handles roles, task messages, reply obligations, and handoffs; Herdr handles the live agent runtime. See How Picode and Herdr work together.
  • Reuses panes. It checks existing panes first and reuses idle or done workers instead of spawning duplicates.
  • Adaptive layout. Workers split in the direction that keeps new panes close to square. Grid-aware splitting avoids tall stacks. Empty panes are claimed instead of splitting. The coordinator stays at 50 percent on the left and the worker area fills the right half.
  • Structured dispatch. Tasks go out as Objective, Context, Constraints, Action Steps, Deliverables, and Prerequisites.
  • Revivable workers. Worker prompts carry a Recent workers digest: the last few workers, the directories each one actually touched (derived from its saved session, not self-reported), whether it is still live, and what it left unverified. When new work lands in territory a stopped worker already mapped, the coordinator can bring that same agent back on duty with revive_closed_session(picode_id, task) — full tools, its handoff note, its mailbox, and its own conversation context intact — instead of starting a fresh worker cold. It is deliberately harder to reach for than spawn_worker: a task is required, and the result reports how stale the revived context is (context_age_minutes, head_moved_since_exit), because a worker resuming an outdated view of the tree will edit confidently and wrongly. One at a time, never in parallel.
  • Worker handoff notes. Workers close an assigned task with picode_finish rather than a plain "done" send: one call records a durable handoff (what landed, what was left unverified) and sends the final report. The note lives at .picode/picodes/<id>/handoff.json and is written by the worker, never the coordinator — it knows what actually happened, whereas the coordinator only knows what it asked for. A worker whose pane was killed leaves no note, and still appears in the ledger.
  • Project preferences. Ask the coordinator to save a durable role preference in a per-project prompt override.

Worker models

Model defaults live globally at ~/.pi/agent/.picode/models.json. Optional project overrides live at <git-root>/.picode/models.json.

{
  "builder": "anthropic/claude-sonnet-4",
  "reviewer": "anthropic/claude-haiku-4",
  "explorer": "anthropic/claude-haiku-4",
  "visionary": "opencode-go/mimo-v2.5",
  "default": "anthropic/claude-sonnet-4"
}

Resolution order: project role/default → global role/default → built-in role/default. Project files are sparse; setting only scout leaves every other role inherited. Existing project files remain project overrides until reset.

  • Roles match by prefix, so a builder key matches builder-1 and builder-a.
  • It falls back to the default key, then to the built-in default model.
  • The coordinator reads the merged config and passes the resolved model to each spawned worker.
  • visionary must point to a multimodal model; do not leave it on a text-only default model.
  • Old "journal" and "journal-cadence" settings are ignored; papercut reporting needs no separate model or cadence.
  • /picode-models asks whether to edit global defaults or project overrides.
Command Effect
/picode-models Choose scope, then open selector.
/picode-models builder anthropic/claude-sonnet-4 Set project override (legacy behavior).
/picode-models --global builder MODEL Set one global default.
/picode-models --project scout MODEL Set one project-only override.
/picode-models --project --reset Remove project overrides; inherit global.
/picode-models --global --reset Clear global overrides; restore built-ins.

Worker thinking levels

Thinking levels are configured separately from worker models. Global defaults live at ~/.pi/agent/.picode/thinking.json; optional project overrides live at <git-root>/.picode/thinking.json. The built-in role defaults are preserved unless overridden: builder/reviewer/bug-hunter high, planner/designer/gauntlet max, scout/explorer/visionary medium, tester/runner low. Other roles inherit Pi's default. Pi clamps a requested level to the maximum supported by the selected model.

Supported levels: off, minimal, low, medium, high, xhigh, max.

Command Effect
/picode-thinking Show effective levels, with project → global → built-in precedence.
/picode-thinking builder low Set the project override for builder.
/picode-thinking --global builder max Set a global default.
/picode-thinking --project scout high Set a project-only override.
/picode-thinking --project --reset Remove project overrides; inherit global/default levels.
/picode-thinking --global --reset Clear global overrides; restore built-ins.

Role names match by prefix, so builder applies to builder-1 and builder-a.

Customizing prompts

Role defaults live in src/prompts/. You can extend or replace a role's prompt with a Markdown file in your project without changing the extension.

Create .picode/prompts/<role>.md at your project root (the git repo root, or the cwd if you are not in a repo):

.picode/
  prompts/
    coordinator.md   # extends or replaces the coordinator rules
    builder.md       # extends or replaces the builder rules
    reviewer.md      # extends or replaces the reviewer rules
    visionary.md     # extends or replaces the visual-analysis rules
    worker.md        # catch-all for any generic worker role

Extend mode (default)

Your override file is appended after the bundled role prompt, wrapped in a ### Project-Specific Rules (USER-ENFORCED) section. Bundled rules stay active; your rules take precedence. This is the default — no frontmatter needed.

Replace mode

Add frontmatter to fully swap the bundled prompt (legacy behavior):

---
mode: replace
---

Your custom prompt content here...

Notes

  • Empty files are ignored, so you get the bundled default.
  • Unknown roles fall back to worker.md.
  • Prompts are loaded once at startup. Restart the picode after editing.
  • Save durable project-specific role preferences in these override files rather than changing the extension source. Review existing coordinator overrides if they still enforce the old read-only or delegation-first behavior.

Sample overrides to copy live in examples/prompts/.

The papercut journal

Journaling now records tool, harness, and setup friction, not work completed. At the end of each work run, coordinators and workers briefly review their session context for actionable papercuts, then report findings with picode_journal(action="report", ...) before their final response/report or yielding control. Workers closing a task do this before picode_finish. Clean runs produce no entries; the same occurrence is not reported again in later runs. Agents keep working through nonblocking friction rather than stopping to catalog it mid-task.

This is a prompt-directed retrospective within the existing run, not a background summarizer or an agent_end hook that wakes the model again. There are no automatic summaries, separate model calls, or compaction.

One shared file, .picode/issues.md, is the source of truth. Issues survive worker cleanup/purge. It is workspace-local even when coordination uses Restate: agents on different machines need a shared workspace filesystem to share this log.

Reports include a stable ID, reporter/time, affected area, observed problem, impact, workaround, and operator help needed. Matching open title/area pairs accumulate repeat reports; a recurrence after resolution gets a new ID. Reuse the existing title/area rather than rephrasing them.

## PC-001 — Tool unavailable despite appearing in instructions

- [ ] Solved
- Reported: 2026-10-11T10:00:00.000Z · builder · builder-1
- Area: tools
- Reports: 1
- Problem: example_inspect returned “Tool not found”.
- Impact: Had to find another way to inspect the output.
- Workaround: Used bash.
- Help needed: Correct the instructions or enable the tool.

Report actionable friction, not routine failed commands, ordinary application bugs, expected failing tests, or task progress. Never include secrets. Nonblocking issues are logged quietly at the end of the run; blockers must be escalated immediately rather than waiting for the retrospective via worker → coordinator → operator. A workaround does not count as a fix, and listing issues does not assign agents to fix them.

Only the operator marks issues solved:

Command Effect
/picode-journal List open issues.
/picode-journal solved List solved issues.
/picode-journal all List both.
/picode-journal show PC-001 Show details and resolution notes.
/picode-journal solve PC-001 [note] Mark solved, keeping the history.
/picode-journal status Open/solved counts and file location.

You can also check an issue's - [x] Solved box directly in Markdown. Preserve its ID, heading format, and Solved checkbox, and edit while agents are idle to avoid racing a report. Tool writes lock the complete read-modify-write transaction and replace the file atomically.

Without Pi running, use node bin/picode-cli.mjs journal or node bin/picode-cli.mjs journal solve PC-001 "Enabled the tool" (add --dir PATH for another workspace). The MCP server exposes the same report/list actions, but no solve action.

Existing per-picode journal.md files are left untouched as legacy work archives; they are not replayed on startup. Read one with picode_journal(action="archive", id="worker-id") (old id-only calls still work). They remain subject to the existing stale-picode purge policy. Old model/cadence settings and --picode-journal / --picode-journal-model flags are accepted but ignored. The old trim/clear/compact commands are removed so they cannot erase issue history.

Prompt-cache diagnostics

Active Picode sessions write a local trace to .picode/cache-diagnostics/. It records prompt-component and request-body fingerprints plus provider usage counters (input, cache-read, cache-write, and reported cost), never prompt text, message text, tool descriptions, or worker notes. Traces are bounded to about 1 MB per picode.

When provider usage indicates a cache miss larger than Pi's 1,024-token noise floor, Picode warns whether its prompt changed since the previous request or stayed unchanged. A changed fingerprint is a correlation, not proof of provider causation; an unchanged Picode prompt points toward cache retention, session/model changes, or another extension. Traces mark whether the preceding cache request was an assistant response or Pi's cache warmer, including the warm request's reported cost when available. The warning includes the trace path for follow-up.

On Pi versions with structured system-prompt sections, Picode stores its thread rules as a transcript-backed section so custom-message-triggered turns retain the same rules. Older Pi versions keep the existing per-run prompt override behavior.

See CACHE-DIAGNOSTICS.md for the runbook: what the trace fields mean, how to read a miss, what the tracker cannot prove, and the experiment that settles whether a miss comes from prompt content or from a new provider cache key.

Human monitoring and steering

bin/picode-cli.mjs lets a human act on the picode system without running pi. It is a full protocol citizen working over plain files.

node bin/picode-cli.mjs list                      # table of all threads
node bin/picode-cli.mjs status link               # one picode's full coordination state
node bin/picode-cli.mjs status link --json        # same, as machine-readable JSON
node bin/picode-cli.mjs watch                     # live coordination board
node bin/picode-cli.mjs tail link                 # follow one picode's state/messages and shared papercuts
node bin/picode-cli.mjs inbox link                # pending and recent messages
node bin/picode-cli.mjs send link "status?" --expects       # ask, tracked
node bin/picode-cli.mjs send link "looks good" --re link/01ABC…  # reply, settles the debt
node bin/picode-cli.mjs send '*' "standup in 5"   # broadcast note
node bin/picode-cli.mjs delete link               # remove a picode (refuses if it looks live)
node bin/picode-cli.mjs delete --stale --yes      # prune every stopped or stale picode

Connecting other coding agents (MCP)

bin/postbox-mcp.mjs is a zero-dependency MCP (Model Context Protocol) stdio server. Point any MCP-capable agent at it and that agent becomes a full Postbox picode over plain files, speaking the same .picode/picodes/<id>/ layout that pi and picode-cli use. A Claude Code or Codex session can then send, receive, and settle reply debts with pi threads and each other, with no pi process required on its side.

It exposes the six protocol tools (picode_send, picode_inbox, picode_wait, picode_status, picode_list, picode_journal) and keeps the sending agent's presence and obligation ledger in state.json. Identity comes from environment variables: POSTBOX_THREAD_ID (required), POSTBOX_DIR (workspace root, defaults to cwd), and optional POSTBOX_ROLE or POSTBOX_PARENT.

Register it with Claude Code:

claude mcp add postbox -e POSTBOX_THREAD_ID=cc-1 -- node /path/to/picode/bin/postbox-mcp.mjs

Or with Codex, in ~/.codex/config.toml:

[mcp_servers.postbox]
command = "node"
args = ["/path/to/picode/bin/postbox-mcp.mjs"]
env = { POSTBOX_THREAD_ID = "codex-1" }

One caveat: foreign agents are pull-delivery only. They see incoming messages when they call picode_inbox or picode_wait, not through pi's push injection into a live turn.

There is also bin/postbox-hook.mjs, a Claude Code hook that does push-style delivery: cold-start drain, turn-start, post-tool-use, and stop-block.

Storage backends

Local filesystem (default). Zero dependencies. Coordination state lives in .picode/picodes/<id>/state.json and inbox/; papercuts live separately in .picode/issues.md (messages are enqueued atomically with a rename, and read in FIFO order thanks to ULID-sorted filenames).

Restate backend. A durable backend that can wake a stopped picode. A deliverAfter envelope coming due for a stopped picode causes the companion service to spawn pi back up, because the mailbox and its timer live in Restate rather than in the process that armed it.

Pluggable adapter. The StorageAdapter interface means you can add a backend with a single factory registration.

Running with the Restate adapter

The default local backend is durable enough to survive a crash, but a stopped pi process obviously cannot watch its own inbox or fire its own heartbeat while it is not running. The Restate backend trades "no dependencies" for one real capability the local backend structurally cannot offer: waking a stopped picode.

This backend has a real operational footprint. Three things need to be running:

  1. A self-hosted restate-server (single binary or Docker), for example:

    docker run --rm -p 8080:8080 -p 9070:9070 docker.io/restatedev/restate:latest
    
  2. The companion service, which hosts the Picode and PicodeRegistry virtual objects:

    npm run restate:serve
    

    It listens on port 9080 by default. Three environment variables shape how it revives a stopped picode:

    • RESTATE_INGRESS_URL is the ingress URL the spawned pi connects back to (default http://localhost:8080).
    • PI_THREAD_EXTENSION is the path to this extension's entry point, passed to the spawned pi as --extension (omit if your pi config already loads it).
    • PI_BIN is the pi executable to spawn (default pi from PATH; required on Windows, where the npm-installed pi is a .cmd shim that spawn() cannot execute).

    The revived pi runs in the picode's original working directory, recorded in its state.

  3. Register the deployment with the server's admin API (one time, or after changing src/restate/service.ts):

    curl -X POST http://localhost:9070/deployments -d '{"uri":"http://localhost:9080"}'
    

Then start pi pointed at it:

pi --picode-id coordinator --picode-storage restate --picode-storage-url http://localhost:8080

Known limitations versus the local backend: watchInbox polls every two seconds instead of getting an instant fs.watch notification (cold-start delivery at session start is unaffected either way). A future-dated envelope's delayed self-check cannot be un-armed once scheduled, since Restate has no public "cancel a delayed send" API. It no-ops if the envelope was already drained by the time it fires. The bin/picode-cli.mjs human monitoring CLI only ever reads the local filesystem layout, so it will not see threads running against the Restate backend.

CLI flags

  • --picode-id <id>: opt into Picode with a stable identity such as coordinator or worker-a.
  • --picode: shorthand for --picode-id coordinator.
  • --picode-role <role>: role label, targetable via picode_send to="role:<role>". Optional. Auto-detected from the id (exact match or prefix: builder-1 becomes builder).
  • --picode-parent <id>: parent picode id, the escalation target. Optional. Auto-defaults to coordinator for non-coordinator threads.
  • --picode-journal <value> and --picode-journal-model <model>: deprecated compatibility flags, accepted but ignored. Use explicit papercut reporting instead.
  • --picode-storage <local|restate>: storage backend. Default is local.
  • --picode-storage-url <url>: backend connection URL. Ignored by the local backend.

State machine

IDLE -> THINKING -> WORKING -> OPEN -> DONE

OPEN -(suspend)-> ON HOLD -(resume)-> OPEN
any -(unclean exit)-> STOPPED

There is no waiting state. Debts and barriers are durable records rather than states, so nothing needs repair on restart beyond done or stopped going back to idle. Full detail is in THREAD-MODEL.md.

Herdr integration details

  • Pane labels: Picode labels its Herdr panes with a 📬 picode badge and the role, such as 📬 picode ⚪ coordinator or 📬 picode 🔴 builder. The Pi terminal title also shows the role and working directory.
  • Pane and tab lifecycle: spawn_worker uses Herdr to find/reuse a suitable pane, choose an adaptive split, launch Pi, and wait for it to become ready. When the tab is full, the coordinator can create another Herdr tab. Picode also provides pane inspection, pane reads, cleanup, and controlled revival tools.
  • Status and events: Picode uses Herdr's pane/workspace identity and event API to scope operations and notice tracked worker pane exits. Herdr's own Pi integration reports Pi session identity and lifecycle so Herdr can restore and identify sessions.
  • Install both pieces: Install Picode in Pi, then install Herdr's Pi integration with herdr integration install pi. See the Herdr integration docs and the Herdr agent automation guide.

Contributing

Try a local checkout, run the checks, or report a reproducible bug. Start with CONTRIBUTING.md for setup and pull request guidance, AGENTS.md for the source map, and TESTING.md for test guidelines.

License

MIT