
How We Evaluate and Improve porc (Pi + ORC) with Harbor
Adding shared memory, skills, or external tools to a coding agent is easy to demo and easy to get quietly wrong. The agent might forget to save lessons unless prompted, spend three tool turns finding a tool it should already know, or waste tokens checking shared state on simple coding tasks.
Pi is a small, extensible coding agent. ORC is the local hub I maintain for shared memories, skills, pads, tasks, runbooks, cron jobs, external integrations, and workspace rules across every coding agent on a machine (covered earlier in Agent Collaboration Across Coding Agents). porc (@orc/pi, in packages/pi) connects the two so Pi shares state with every other agent you run through one orc tool.
To make porc reliable in daily use, we built a Harbor evaluation loop and tuned it from real trajectories. On an 8-task Terminal-Bench 2.1 control, porc added about 780 tokens per request and made 0 orc calls. On a 12-task cross-session ORC suite (24 trials per round), iterating from trajectory logs took porc from 6/24 to 24/24 while plain Pi scored 2/24 (the negative control only).
What porc adds to Pi
porc keeps Pi in charge of your runtime, models, and local skills while putting ORC behind it as the shared engine. You bring whatever model, API key, or subscription you already use in Pi, and local skills in .agents/skills and .pi/skills still load natively and win on name clashes.
Instead of packing context with dozens of tool schemas, porc adds four lightweight pieces (full details in the porc README):
- One
orcmeta tool: direct actions handle frequent work (memory_*,skill_*,job_*,rule_*,project_list,context), whilesearch->describe->invokereaches pads, tasks, knowledge bases, past sessions, and external Spec integrations such as GitHub or Slack. - Per-prompt recall: each prompt gets a short hidden hint naming up to 4 relevant memories and 3 skills, fetched on demand instead of synced to disk.
- A static prompt section: 1,518 characters that stay prompt-cache friendly and tell Pi to skip ORC on self-contained coding tasks.
- Shared workspace rules:
orc rules hook pienforces the exact same guardrails across Pi, Claude Code, and Codex.
| Capability | What it gives you inside Pi |
|---|---|
| Memories and skills | Save conventions or procedures once and let future sessions (or other agents) recall and apply them automatically |
| Pads and task board | Share plans, diagrams, and reports as ORC pad links, and track follow-up work on a shared board |
| Runbooks and session search | Query team knowledge bases (kb_search) and recall earlier coding sessions (session_search) across agents |
| Jobs, rules, and integrations | Schedule recurring Pi cron jobs from chat, add guardrails (rule_add), and register OpenAPI or MCP tools for every agent via spec add |
How we wire Pi and porc into Harbor
Harbor is an open-source evaluation runner for coding agents (I also used it in Teaching Claude to Draft My Israeli Tax Return, Measured with Harbor). Every task is a self-contained folder with a Dockerfile, an instruction.md, and verifier tests that Harbor uploads into the container only after the agent finishes, so the agent can never peek at the grading script. Out of the box, Harbor handles container isolation, parallel runs, retries (-k), trajectory capture, and public benchmarks like Terminal-Bench.
porc_pi.py subclasses Harbor's built-in Pi agent into two arms: HostPi (PORC_DISABLED=true, plain Pi baseline) and HostPorcPi (PORC_PROJECT=harbor-eval, scoped to a scratch ORC project). Both launch host pi with docker-tools.ts, a small extension adapted from Pi's SSH example that routes read, write, edit, and bash into Harbor's container via docker exec and points cwd at the container workdir.
Every code edit and test runs inside the isolated sandbox, while every orc call, recall hint, and rule hook hits the live host daemon. All runs below used Sonnet 5.5 under Harbor 0.27 and local Docker so differences reflect the harness rather than the model.
Step 1: check overhead on ordinary coding tasks
Before testing what ORC adds, we checked whether porc gets in the way of self-contained coding using a Terminal-Bench 2.1 code and debug subset (NovitaAI/tb21-code-debug).
Across the 4-task smoke (4/4 vs 4/4), the 8-task comparison (8/8 vs 7/8), and a 3-attempt rerun of the lone chess-best-move miss (3/3 vs 3/3), HostPorcPi made 0 orc calls across all 15 trials. The static prompt and single tool schema add roughly 780 tokens per request (measured on fix-git before trimming the prompt to 1,518 characters), with zero wasted tool turns.
Step 2: evaluate cross-session capabilities end to end
Single-turn coding benchmarks cannot test shared memory, skills, pads, or guardrails. To test whether what one session learns actually carries over to a fresh session, we built a 12-task cross-session suite (harbor/orc-tasks) driven by run_orc_eval.py.
Each round snapshots ORC, seeds a runbooks knowledge base, runs parallel native pi -p teach sessions in fresh temp directories (a convention, a release-notes skill, a passing incident note, and a handoff note), then launches fresh Harbor containers (k=2, 24 trials per round) across all 12 tasks.
The key design choice is dual scoring in score_orc.py. A trial passes only when both the container verifier returns 1.0 and the trajectory contains the expected successful orc tool call with its key arguments. Three examples from harbor/orc-tasks show the pattern:
memory-service-conventions(cross-session recall): a teach session shares our HTTP port (8473) and health route (GET /livez). A fresh container asks Pi to write/app/server.pyfollowing team conventions. Harbor verifies the server uses8473and/livez, andscore_orc.pyrequiresmemory_readormemory_list.external-github(integrations with container internet off): the container hasallow_internet = falseand asks for the open-issue count onniradler/orc. Harbor checks/app/issues.txtagainst the live count, andscore_orc.pyrequiresinvoke <tool>@githubrouted through ORC on the host.negative-control(skipping ORC on plain code): asks Pi to fixnormalize_memory_namein/app/orc_memory.py. Harbor runs unit tests, andscore_orc.pyfails the trial if anyorccall appears.
After scoring, the driver diffs the ORC snapshot and deletes everything created during the round so rounds never bleed into each other.
What actually moved the score from 6/24 to 24/24
Running the full suite across four rounds (rescored under the same strict scorer, raw logs in eval-data/) made every bottleneck obvious:
Plain Pi scored 2/24 (negative-control only) because its teach sessions wrote conventions into ephemeral temp folders that the next session could never see. On porc, four concrete changes closed the remaining gaps:
- Fix the harness before tuning prompts (
6/24 -> 18/24): on offline Harbor tasks, querying container IDs by Docker Compose labels instead ofhostnamerestored 12 passes without touching a word of the prompt. - Give direct paths for common tools (
18/24 -> 20/24and fewer calls): trimming the prompt from 1,932 to 1,467 characters and naming exact calls (invoke kb_search {query},invoke pad_create,invoke task_create,invoke session_search) fixedkb-runbookimmediately, cut pad creation from 3.0 to 1.5 ORC calls, and cut task creation from 2.0 to 1.0. - Name explicit triggers for unasked saves (
20/24 -> 24/24): telling Pi to callmemory_createin the same turn when a user drops phrases like"heads up","FYI", or"for whoever picks this up"(1,518 characters total) turned passive acknowledgments into saved memories that the next session recalled on the first try. - Let failing tasks expose product bugs: the suite caught real code issues beyond the prompt, including a 5-second timeout that silently killed
tool_search(raised to 30 s), headless writes that needed fail-closed defaults, workspace rules needing to default on, and a 13th task (session-transcript-recall) that revealed Pi sessions were not being lexically indexed by ORC yet (fixed right after).
Try ORC and porc
If you already use Pi with any model or subscription, you can try porc in one command once ORC is running:
pi install npm:@orc/piOpen Pi in any repository and run /orc to bind a project, /orc-remember to save a convention across sessions, or /orc-skills to browse shared skills. To inspect the Harbor agents, task suite, and 216 exported trial rows, see packages/pi/harbor and packages/pi/docs/eval-data.
If you are adding memory, skills, or tools to a coding agent, wire your agent into Harbor, score both final answers and tool trajectories, and let the failing runs tell you what to fix next.
Up next
Prompt tuning got a frontier model to 24/24, and the same Harbor tasks can now double as training environments. In the next post, inspired by Hugging Face's work on Harness Adapters, we will fine-tune a Pi LoRA adapter directly on porc tools so smaller open models learn when to call ORC and when to leave it alone without relying on a long system prompt.

