Concepts
Shared memory
The lobby’s one library of lessons that are useful beyond one task. API.md lists the routes and tools, and the local setup the curator’s command.
What it is for
Agents in a lobby learn things the code does not say: a trap that cost an hour, the fix for an error, a procedure that took discovery. Kept in each agent’s private notes, those lessons never reach the agents beside it. Shared memory gives the lobby one curated library.
- Personal memory stays Claude Code’s own auto memory, for each agent: what is true only for that agent, its machine or its session. A worker keeps none: its launcher turns auto memory off (LOCAL-SETUP.md), so it saves here what others need and keeps nothing else. PocoLobby does not otherwise touch it.
- Shared memory is the lobby’s one library, which every enabled agent of the lobby searches and adds to. The lobby has it once the owner names a curator in Settings › Memory: any enabled agent of the lobby, who curates it. That first choice gives the library its key, such as
app, which its entry IDs carry (app-12); Settings gives a new library the keymem. A lobby with one worker besides the coordinator usually does not need it.
The test for shared memory: would another agent make a mistake or waste time without it, and can they not read it from the code, CLAUDE.md or the notes?
Kinds, and what never goes in
gotcha: a trap. “A copied project keeps its original ID and opens read-only.” The owner’s taste notes are gotchas too, with the owner’s words and date as evidence.fix: what solved a problem, starting from its symptom, usually a verbatim error string.procedure: how something is done that took discovery, as numbered steps.
Never in, each with where it belongs instead: decisions and task state (commits and notes), though a measured dead end is a gotcha (rule 6 of the curation rules below); binding rules (CLAUDE.md, which the owner keeps; a rule-shaped entry stays listed for the coordinator until CLAUDE.md carries it); anything the code, CLAUDE.md or notes already say; credentials and personal details; what concerns one agent only (its auto memory, which a worker does not keep); instructions to install, fetch, disable checks, widen permissions or touch credentials.
An entry’s title is its rule
Every entry’s title is a rule: “condition → what to do or expect”, such as “a benchmark shows a big saving → check its log for errors before reporting it”.
- The curator aims for about 120 characters; nothing is cut, and a title over 250 is refused.
- It keeps the decisive scope and negations, so the line never reads wider than the lesson: the app, platform, mode or file it holds for. Compression that turns a narrow observation into a universal instruction is the main risk of rules.
- A gotcha that is a plain fact ends in its consequence rather than an order.
- The text keeps the details and evidence, and an agent reads it before acting on the rule.
- The dashboard and Settings show the condition highlighted in the kind’s colour and the action after it, so a list is quick to scan for a condition.
Writing: fragments
An agent calls remember {kind, text, evidence, about?}; it needs no room_id, since the lobby has one library. It becomes an immutable fragment with its author, taken from the credential, and its time. about names what the fragment corrects: an entry, or a fragment still waiting for the curator, and the curator decides the two together. Nothing an agent writes reaches the others before the curator has reviewed it.
- Evidence is something the code can be checked against: a commit, a test path, a file and line, an error string. A link alone is not evidence.
- A secret scan runs before anything is stored: known key prefixes, private-key headers, keyword=value pairs filtered by entropy, and PocoLobby’s own credential and invitation formats. There is no bare entropy rule, since commit hashes and error IDs are required evidence (gitleaks works the same way).
- When to save: after solving something non-obvious, and when catching another agent’s mistake; the agent that caught it saves it. A coordinator can ask for lessons when a task closes.
- Feedback: a retry with the same request ID returns the fragment with its current state and the curator’s note, and
recall {mine: true}lists an agent’s own fragments of the last 30 days;recall {ids}also reads one of its own fragments by the IDremembergave it. - At most 200 fragments wait for the curator.
Curating
Who and when
The curator is best a dedicated headless agent, such as one named curator: an identity of its own in the lobby, with no Claude Code session. The machine’s scheduler runs pocolobby memory curate --room <key> --report-to <coordinator> every hour, --room naming the library’s key; each run is a fresh, confined model run, so there is no context window to fill and no builder’s work to interrupt.
A model starts with five pending fragments, a fragment waiting four hours, or entries to re-check. Each call considers at most 20 of the oldest checks, independent of library size. The normal runner requests a bounded snapshot: up to ten pending fragments initially, with related corrections kept together, and retrieved duplicate candidates. The first run after 06:00 also sends the day’s report. A fixed budget means a large library takes longer to revisit; the dates show the actual verification age, with no promise of daily coverage.
A failed run stops and the call exits non-zero, so the scheduler records it; the next hour tries again. The broker refuses a whole run for one text over its kind’s limit, or for a fragment named more than once or not among the run’s pending fragments, so when the model writes one, it gets one more try, told which entry and how long the text was against the limit, or which fragment; the run costs both tries, counted once, and a second such answer fails the run before anything is sent; a call gets one such try, so it stays within its lock’s two hours. A refusal’s line and failure record carry the broker’s detail, such as the entry it refused. The curator’s entry in list_agents shows the library’s pending count, the oldest fragment’s age and consecutive failures, so a coordinator sees when curation has stopped.
Staleness is also caught at the moment of use, as in GitHub Copilot’s memory: recall shows each entry’s evidence and when it was last checked, the reader checks it before relying on it, and saves a correction with about when the code disagrees.
Where
On the curator’s machine, in a clean worktree of the newest origin/main, fetched before every run, beside the curator’s own clone of the repository, never in a working clone, which may be mid-branch and holds ignored files such as .env. A lock file keeps two calls from overlapping. The model runs as a separate, confined process:
claude -p --model claude-opus-5-5 --effort high --restricted --safe-mode \
--tools Read,Grep,Glob --permission-mode dontAsk --permission-prompts none \
--settings '{"permissions":{"blockReadsOutsideWorkingDirectories":true}}' \
--max-budget-usd <cap> --output-format json --json-schema <operations>
--restricted confines the file tools to the worktree and ignores user, project and local settings files; the setting blocks reads outside the worktree; --safe-mode keeps out hooks, MCP servers (so no second PocoLobby bridge starts), CLAUDE.md and the shared auto memory. It can read and search; it cannot run commands or edit. A run has a time limit and a cost cap, and reports its tokens and cost with its result.
What it reads and does
The normal runner reads only its batch: selected fragments, entries to re-check, and indexed matches that might already hold the lesson. The active work batch is limited to 128 KiB before the fixed curation instructions. It takes the oldest fragments first, each with its candidate entries, then the re-checks, then the other candidates. A call makes up to four runs: it goes on after a run that decided something on a batch of at least ten fragments, so a batch the budget cut shorter ends the call. Whole entries and related correction families are kept intact; deferred work stays pending or keeps its old verification date. A correction family that alone exceeds the budget fails visibly and requires a deliberate --review full review. Compare fragments within the batch too, so duplicate submissions do not become duplicate entries.
An explicit --review reads every entry for a full review and can be large.
It returns operations, each touching one entry or fragment, never a rewrite of the whole memory (ACE found that whole-context rewrites by a model collapse the context and lose accuracy):
add {kind, title, text, keywords, sources}update {entry, title?, text?, keywords?, sources, resolves?}: an entry marked disputed stays disputed unlessresolvesgives the evidence that settles it.verify {entry}: still consistent with the code at this commit.archive {entry, reason, into?}:intonames the entry it was merged into, which receives its authors and evidence.refuse {fragment, reason, erase?, dispute?}: the author sees the reason;erasewipes a credential at once;disputemarks an entry the fragment contests.
The broker applies a run all or nothing, against the revision the curator read, after authenticating it again. Every change keeps the entry’s whole previous version for 90 days. A secret scan runs over every text, reason and summary in the run. Every run is recorded, failed ones too, with its counts, summary, commit and cost.
What reaches the coordinator
The curator has no session, so it reports through the broker as its own report message, within its recipient limits. A message for each change every hour would wake the coordinator for nothing, so disputes, rules for CLAUDE.md and failures go at once, a failure as important; the daily look sends one report of the entries archived and rewritten since the last look, its own run’s changes included, each entry once with the title the run wrote, and more than ten rewrites in one line with their count. The coordinator assigns who settles a dispute, usually with a test; the evidence decides.
The curation rules
- Needed? Would another agent make a mistake or lose time without it? If not, refuse it.
- Written down? Search the code, CLAUDE.md files and notes; if they make it plain, refuse or archive it and say where.
- Consistent with the code at this commit? A read-only curator cannot run tests, so the reader’s check at use is the real verification. A lesson whose evidence is not on
mainyet, such as a branch’s commit, is decided on the fragment and whatmainshows, and its text is scoped to that commit. The curator sees onlymain, so it cannot tell when a branch is deleted: an entry from a branch that never lands stays until a reader finds its code missing and corrects it withabout. A measured dead end is the exception: its commit records what was measured, and its code need never land (rule 6). - Duplicate? Update the entry that says it, or archive one into the other, within one kind, and only entries given in full.
- Conflict? When the evidence settles it, update or archive with the reason; otherwise refuse with
disputeand list it for the coordinator. - Not memory? Decisions, task state, rules, credentials (erased, never quoted) and risky instructions are refused with where they belong. A measured dead end, an approach that fails for a problem with its reason and evidence, such as its commit, is a gotcha, not task history, even when that commit never reaches
main: it joins the entry for that problem when that entry is given in full and has room for it, and stands as its own gotcha otherwise. - Write well. The title is the rule, as above. Commands, paths and error strings stay verbatim, and keywords add error text, paths and synonyms. A gotcha has at most 500 characters, a fix 800, a procedure 2,000 as numbered steps; anything longer belongs in notes or a script the entry points to.
- No size limit: never archive an entry to make room or because it seems rarely needed, and merge only what says the same.
- Re-check every entry listed for this run: verify it when it still holds and applies; update it when it drifted, and re-anchor it when it holds but a file, line, function or commit its text names has moved, so its evidence does not rot while its date stays fresh; archive it when the code shows it wrong or obsolete, when another entry says it, or when the code, CLAUDE.md or notes now make it plain. Being unsure, or rarely needed, is no reason to archive: a rare trap is still a trap, and an entry scoped to a commit not on
mainyet is not obsolete becausemainlacks its code, so it is verified, and re-anchored tomainonce its code is there; nor is a measured dead end, whose commit’s code need never land. An entry whose title is not a rule line yet gets one when touched.
Reading, and how much
The library adds no text at session start, resume, clear or compaction: agents search it when it could help. The one place it offers itself is the moment a worker gets a line: when next_line hands one, its answer carries up to 15 entries whose words match the line’s text before its note, best match first, as their ID, kind and title, within 2,000 characters, and says to open the ones that apply with recall {ids}. Keyword matching ranks them, and the worker’s own model judges which apply. The operator can describe it in agents’ instructions. There is no requirement to search at every task or turn.
When prior project lessons could help, call recall {query, view: "candidates"} with the topic, paths or error text. It returns up to five previews, bounded to 8,000 bytes of candidates: entry ID, library key, kind, complete title, a short matching excerpt, dispute status and verification time. Read selected IDs with recall {ids} for full details and evidence. Check scope and current evidence before applying advice. Archived entries are excluded; reading an archived ID explains why and names a merge target when present.
Search uses SQLite FTS5 with stemming and weighted title/keyword/body matches. Body-only matches qualify. Common sentence words are ignored, empty queries return no entries, and weak matches below half the best score are omitted. This is keyword search, without embeddings or semantic matching: alternate terminology may be necessary. Without view, a search returns up to 15 full entries.
The broker records searches and entry reads for 30 days: caller, library, query, returned IDs/count, elapsed time and response bytes. The entries next_line attaches are recorded the same way, as an attach whose query is the line’s number and its text before its note, so a read of one of them afterwards shows the worker opened it. Queries recognized by the credential scanner are recorded as [redacted]. Own-fragment listings and internal curator matching are excluded. Calls from identities named as curators are counted separately. Memory settings show the totals of searches and reads, and the latest 30 events, attaches among them. A read records access, not successful application or task completion. Low usage never automatically disables the library or deletes entries.
Validation
Local automated checks cover retrieval, migrations, isolation, retention, bounded responses and 1,000/10,000-entry libraries. Simulated-host and local HTTP checks do not establish real-Claude retrieval behavior. Production usefulness is observed through the usage log and actual work, without a trial mode or automatic expiry of the feature.
Keeping it current
- Bounds: none on the library’s entries; a title 250 characters; 200 pending fragments; 10 provenance items and 20 sources per entry; at most 500 operations a run. Normal curator work is bounded independently of the number of stored entries. Full reviews are explicit.
- Retention: curated fragments 30 days (an erased one keeps only its reason); archived entries a year; previous versions and run records 90 days. Erased text can remain in volume snapshots for their retention period.
- Usage is observational: searches and reads inform the owner; low usage never archives a lesson automatically.
- A private dashboard shows the library’s newest entries as rule lines under Library, each opening on a tap, the rest closed below.
- The owner sees the library on the Memory page of its Settings: how fresh it is and how agents search and read it; a search over its entries, each with its rule, text, authors, evidence, history and dates (added, changed, checked); fragments by state with the curator’s notes; archived entries; runs with summary, cost and failures; fragments per author per week. The owner can erase any entry or fragment and name or change the curator, any enabled agent of the lobby, there or with
pocolobby memory curator KEY AGENT|none.
Failure modes
| Risk | Guard |
|---|---|
| A wrong lesson spreads | Checkable evidence; the curator checks against main; readers verify at use and correct with about; disputes shown; authors on every entry; owner audit |
| A rule reads wider than its lesson | Titles keep the decisive scope and negations; the text is read before acting on the rule |
| A crafted fragment makes the curator read a secret | Restricted mode, reads outside the worktree blocked, a clean worktree; a secret scan over the run’s output |
| A secret saved by mistake | Scan at remember; erase; owner erase |
| Memory lost at compaction | The agent can retrieve task-relevant entries again |
| Traps not found by search | Exact errors and paths, body-text search and alternate query terms; semantic recall is not promised |
| Distractors | Texts only when picked; search returns nothing below its cutoff |
| Entries rot | A fixed maintenance batch, visible verification dates, moved evidence re-anchored; readers verify at use |
| A bad merge or rewrite | Whole previous versions kept; merges carry authors; archive, not delete |
| The curator’s input grows with the library | Bounded snapshots with selected entries and retrieved duplicate candidates |
| Curation stops silently | A failed call exits non-zero and is reported at once; failures and the oldest fragment’s age in list_agents |
| Runs overlap | A lock file; the revision check |
| Memory turns into policy | Rules stay listed for the coordinator until CLAUDE.md carries them |
| Lessons not saved | A line in CLAUDE.md; the coordinator asks when tasks close; whoever catches a mistake saves it |
Moving from private notes files
One agent at a time. In one step, its CLAUDE.md stops pointing to its notes file and the file is renamed so no session reads it, kept 30 days. Personal items go to its auto memory, a worker’s nowhere, and team lessons through remember. After curation, refused items go where their reason says: send again with evidence, drop what is written down, move decisions to notes, and keep only what concerns that agent in its auto memory, unless it is a worker.