counterparts 0.3.46 → 0.3.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/CHANGELOG.md +131 -0
  2. package/README.md +80 -39
  3. package/docs/QUICKSTART.md +25 -7
  4. package/docs/manual.md +28 -17
  5. package/package.json +17 -4
  6. package/src/adapters/claude-code/bin/runner.ts +23 -0
  7. package/src/adapters/claude-code/doctor.ts +89 -1
  8. package/src/adapters/claude-code/hooks.ts +18 -1
  9. package/src/adapters/claude-code/index.ts +2 -0
  10. package/src/adapters/claude-code/night-run.ts +2 -0
  11. package/src/adapters/cli/CONTRACT.md +18 -3
  12. package/src/adapters/cli/commands-install.ts +21 -1
  13. package/src/adapters/cli/commands-note.ts +11 -0
  14. package/src/adapters/cli/commands-remove.ts +10 -1
  15. package/src/adapters/cli/commands-shared.ts +3 -0
  16. package/src/adapters/cli/export.ts +2 -0
  17. package/src/adapters/cli/help.ts +13 -3
  18. package/src/adapters/cli/removal.ts +144 -54
  19. package/src/adapters/cli/uninstall.ts +173 -8
  20. package/src/adapters/dashboard/registries.ts +1 -1
  21. package/src/adapters/dashboard/resolve.ts +35 -4
  22. package/src/adapters/dashboard/web/views/health.ts +7 -1
  23. package/src/adapters/dashboard/web/views/memories.ts +3 -0
  24. package/src/adapters/dashboard/web/views/search.ts +7 -3
  25. package/src/adapters/dashboard/web/views/shared.ts +6 -0
  26. package/src/adapters/dashboard/web/views/subjects.ts +6 -2
  27. package/src/adapters/dashboard/web/views/today.ts +7 -1
  28. package/src/adapters/lifecycle.ts +3 -2
  29. package/src/adapters/mcp/CONTRACT.md +12 -1
  30. package/src/adapters/mcp/INTERFACE-GAPS.md +10 -0
  31. package/src/adapters/mcp/NOTES.md +39 -0
  32. package/src/adapters/mcp/bin/serve.ts +3 -0
  33. package/src/adapters/mcp/chat-wake.ts +9 -3
  34. package/src/adapters/mcp/deliberate.ts +5 -0
  35. package/src/adapters/mcp/index.ts +10 -0
  36. package/src/adapters/mcp/server-args.ts +22 -1
  37. package/src/adapters/mcp/server-options.ts +15 -0
  38. package/src/adapters/mcp/server-self-tools.ts +14 -4
  39. package/src/adapters/mcp/server-session-end.ts +2 -0
  40. package/src/adapters/mcp/server-words.ts +96 -11
  41. package/src/adapters/mcp/server.ts +304 -11
  42. package/src/adapters/mcp/tools.ts +354 -18
  43. package/src/adapters/remote/NOTES.md +11 -1
  44. package/src/adapters/sessions.ts +11 -1
  45. package/src/adapters/update-check.ts +1 -1
  46. package/src/core/counterpart-deposit.ts +76 -8
  47. package/src/core/counterpart-types.ts +26 -0
  48. package/src/core/counterpart-wake-shape.ts +36 -12
  49. package/src/core/counterpart.ts +38 -10
  50. package/src/core/coverage/CONTRACT.md +7 -2
  51. package/src/core/coverage/NOTES.md +45 -0
  52. package/src/core/coverage/index.ts +71 -6
  53. package/src/core/coverage/tunables.ts +4 -1
  54. package/src/core/dream/CONTRACT.md +14 -1
  55. package/src/core/dream/INTERFACE-GAPS.md +7 -0
  56. package/src/core/dream/NOTES.md +47 -0
  57. package/src/core/dream/index.ts +18 -6
  58. package/src/core/dream/project-ask.ts +5 -5
  59. package/src/core/dream/reflect.ts +44 -9
  60. package/src/core/dream/slices.ts +87 -6
  61. package/src/core/encode/secrets.ts +67 -5
  62. package/src/core/handoff/CONTRACT.md +9 -0
  63. package/src/core/handoff/last-here.ts +34 -12
  64. package/src/core/mint.ts +8 -0
  65. package/src/core/onboarding.ts +5 -3
  66. package/src/core/prospective/CONTRACT.md +6 -1
  67. package/src/core/prospective/NOTES.md +25 -0
  68. package/src/core/prospective/index.ts +11 -3
  69. package/src/core/recall/index.ts +8 -1
  70. package/src/core/remember/CONTRACT.md +9 -0
  71. package/src/core/remember/NOTES.md +54 -0
  72. package/src/core/remember/index.ts +5 -0
  73. package/src/core/remember/own-plumbing.ts +135 -0
  74. package/src/core/removal-hold.ts +246 -0
  75. package/src/core/self/work.ts +29 -10
  76. package/src/core/store/CONTRACT.md +20 -2
  77. package/src/core/store/NOTES.md +24 -0
  78. package/src/core/store/cache.ts +5 -0
  79. package/src/core/store/index.ts +276 -8
  80. package/src/core/store/owner-op-seam.ts +5 -3
  81. package/src/core/store/reads-memories.ts +16 -1
  82. package/src/core/store/shapes.ts +10 -1
  83. package/src/core/told.ts +220 -26
package/CHANGELOG.md CHANGED
@@ -1,5 +1,136 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.48 — 2026-11-06
4
+
5
+ **A lighter tool list for claude.ai, hosted pages that look like counterparts.ai, and a README that explains itself.** On claude.ai the tool list a chat loads is about a third smaller; Claude Code and Claude Desktop get exactly the tool list 0.3.47 gave them. The hosted sign-in, Allow, account, delete and error pages take counterparts.ai's look, light or dark as your device is set. The README's first screen, which is also the npm page, says what Counterparts is and what the first run does. No store-format change (store v15, cache v7), no migration. Nothing to run after upgrading beyond the usual restart of the dashboard and every Claude Code session. Going back to 0.3.47 needs no store restore: `counterparts disconnect`, 0.3.47's install, then `counterparts connect`.
6
+
7
+ - **The README opens by saying what it is: long-term memory for Claude Code, written by
8
+ Claude itself.** Its first screen, which is also the npm page, now leads the install with
9
+ npm (bun on the next line), says what the first run asks and changes, and has a short
10
+ "What it remembers, and where it lives" section, with a link to counterparts.ai's guide to
11
+ Claude Code's own memory. The npm description and keywords name Claude Code too.
12
+ - **claude.ai's tool list is about a third smaller.** The list a claude.ai chat loads went from
13
+ about 92 KB to 65 KB (roughly 10k fewer tokens on every turn once memory is in use). The
14
+ field descriptions are shorter, and the guarantees that change nothing about how Claude calls
15
+ a tool are no longer spelled out there, though they are still enforced. Words that weren't
16
+ true on claude.ai are gone: a terminal, folders, the end-of-session ask, the dashboard.
17
+ Claude Code and Claude Desktop get the same tool list as before.
18
+ - **Hosted pages look like counterparts.ai.** The sign-in, Allow, account, pending-delete,
19
+ error and done pages share one inline style in the site's look: its light face by default,
20
+ its dark one when the device is set to dark. No page's words, fields or routes changed, and
21
+ the content security policy is the same.
22
+
23
+ ## 0.3.47 — 2026-11-04
24
+
25
+ **Folded reminders, honest folders, refused calls kept out of your wake, compacted sessions remembered, and delete one memory from chat (hosted).** With the wake's shape on, a reminder a session started today already showed you folds into one line in later wakes that day. A dream files work under the folder it came from, another folder's dated work is counted rather than listed as due today, and other folders go by their names, not their paths. A memory about a refused tool call or a declined permission prompt stays out of the wake and the footnotes, and a morning share no longer asks for a tool call to mark it told. What you say after a conversation compacts is written up at night. "Delete the memory about X" works in chat, on hosted and locally, with 24 hours to undo it. Also: a hosted download opens in a local install and answers straight away, the redactor keeps tokenizer code readable and catches more secret names, and uninstall names the right remover. Existing stores' starter notes about deleting change once, only where they are still exactly as they started. No store-format change (store v15, cache v7), no migration. Nothing to run after upgrading beyond the usual restart of the dashboard and every Claude Code session. Going back to 0.3.46 needs no store restore: `counterparts disconnect`, 0.3.46's install, then `counterparts connect`.
26
+
27
+ - **A reminder you were already shown today folds in later wakes.** With the wake's shape on, the first wake of the day
28
+ lists a plain reminder due today whole; a later wake that day, in a session that started today, counts it instead
29
+ (`2 due today, shown earlier; recall "coming up"`). A compaction's wake folds nothing, and a reminder told only in
30
+ last night's session after midnight stays whole. Dated items that aren't plain reminders show whole as before.
31
+ - **The manual's section index says what is inside each section.** `recall` with the handle
32
+ `manual` now lists every section with a line that names its contents (the phrases, the
33
+ tools, the commands), so looking for how to pause or how reminders work no longer means
34
+ guessing from a generic opening sentence.
35
+ - **On claude.ai, the first chat of the day runs the night.** Before answering you, Claude
36
+ sorts the day before (day's end, a dream, a reflection, about half a minute), then
37
+ answers in the same reply and says "I sorted yesterday's memories just now. Tell me if
38
+ you'd rather I ask first next time." One chat at a time is told (a later one only if the first never
39
+ ran it), and none once a night has run, whether from another chat or your nightly routine. Say "ask first" to have it
40
+ ask before it starts, or "no dreams" to turn nights off. A nightly routine still works,
41
+ once Counterparts' tools are set to Always allow (the routine's form lists only those).
42
+ - **The night names its conversation on every step.** The dream's prompt now passes the
43
+ session on its propose and journal steps too, so with two chats open a night's changes
44
+ stay with the chat that runs it.
45
+ - **Tokenizer code is no longer redacted.** Code lines that assign one identifier to another
46
+ whose last word is token, key or id (`pad_token` set to `eos_token`; letters only, no digit,
47
+ lowercase name, `=`) are kept as written; env vars, YAML, passphrase-shaped
48
+ values, quoted values, digits and passwords still redact as before.
49
+ - **More credential names are redacted.** `passphrase`, `db_pass` and other `*_pass` names,
50
+ a whole-name `pin` with a numeric value, `private_key`, `signing_key`, `session_key`
51
+ and a bare capitalised `AUTH=` / `BEARER=` now keep their name and lose their value;
52
+ `pin_memory=True`, `session_key_fn` and key-file paths such as `private_key = "keys/a.pem"`
53
+ stay readable.
54
+ - **Prefixed PINs and suffixed AUTH are redacted too.** `user_pin`, `SIM_PIN`, `PIN_CODE`,
55
+ `pinCode`, `gpgPassphrase` and `BASIC_AUTH=` keep their name and lose their value.
56
+ - **Ask Claude to delete one memory, with a day to change your mind.** On hosted and on a local
57
+ install, "delete the memory about X" makes Claude find it, say which one it is, and delete it:
58
+ it's hidden at once from recall, the wake, footnotes and the night, and erased for good after
59
+ 24 hours. "Undo that" brings it back whole before then; recall's handle `deleted` lists what's
60
+ waiting, and the wake counts it. On hosted the erase runs on the server's own timer and the
61
+ backups let go of it within about a day after (the hosting provider's own short-term disk
62
+ snapshots rotate on its schedule); on a local install it's erased at the first
63
+ session after the 24 hours. `counterparts remove <id> --confirm` still deletes at once, and
64
+ finishes a memory deleted in chat.
65
+ - **Recalling a removed memory by its id no longer fails with an internal error;** it reads as
66
+ not found.
67
+ - **The starter notes say so too.** Two of them changed with this: the one about seeing and
68
+ changing what Claude keeps now says one memory can be deleted in chat and undone within a day
69
+ (on hosted it used to say a memory couldn't be removed yet), and the tips list gains "Delete
70
+ that". On hosted, the note on how memory works gets the new night words too (the day's first
71
+ chat runs the night). An existing install gets the new words once, at its next session, but only
72
+ where those notes are still exactly as they started; one you corrected or let go stays as it is.
73
+ - **Uninstall names the right remover and cleans up after itself.** Its last line says
74
+ `npm uninstall -g counterparts` for an npm install and `bun remove -g counterparts` for a
75
+ bun one (both when it can't tell), where it used to say the bun line to everyone. When it
76
+ takes its hooks out of `~/.claude/settings.json`, it also removes the backups of that file
77
+ that connecting and disconnecting kept, and says so when the file is left as `{}`. When
78
+ there were no hooks of ours in the file, the backups stay and it says where.
79
+ - **The docs say what goes over the network.** README, the quickstart and setup now say the
80
+ one request Counterparts makes of its own: a daily check of registry.npmjs.org for the
81
+ newest version number, sending nothing about you, and how to stop it (`"updateCheck":
82
+ false` in the configuration, or asking Claude to stop the update reminders). The export example now
83
+ works as shown (`--out` with `--passphrase` or `--plaintext`), and the docs say no command
84
+ opens an encrypted export yet.
85
+ - **Work stays in its own folder, and folders go by their names.** A dream now files what it writes
86
+ under the folder its memories came from, so a summary of one repo's work no longer shows up as
87
+ another repo's news. Work drawn from several folders goes to the one most of it came from;
88
+ something personal drawn from several folders belongs to none, so it reaches them all. Another folder's dated work
89
+ is no longer listed as "Due today" in this folder's wake: it is counted under "in other folders"
90
+ (personal reminders still reach every folder). And the wake names other folders as `sim` or
91
+ `paper` instead of their full paths, falling back to the path only when two folders share a name.
92
+ - **A morning share no longer asks for a tool call to mark it told.** When last night's share
93
+ reaches a session, handing it over marks it told, so a new person isn't shown a permission
94
+ prompt for bookkeeping they have no context for. A session that still calls `reflect` with
95
+ `told` gets a plain yes.
96
+ - **A memory about Counterparts' own refused calls stays out of your wake.** When a session
97
+ writes down that a tool call was denied, that a permission prompt was declined, or what it
98
+ couldn't do (a slash command, a tool it doesn't have), the memory is kept without a date, an
99
+ open thread or a "me", "us" or owner mark, so it never leads Coming up, the wake's news or
100
+ a prompt's footnotes; asking for it still finds it. The person's own words about a prompt
101
+ are kept as usual.
102
+ - **What you say after a conversation compacts is written up, even when the session had
103
+ already saved its own notes.** A session that wrote its handoff or chapter, then compacted,
104
+ then carried on for a few quick lines used to have those lines treated as a short closing
105
+ tail and never written up. Now anything said after a compaction counts as not yet
106
+ recorded, so the next night writes it up, unless the session records itself again after
107
+ the compaction.
108
+ - **Hosted: `/readyz` says when backups stop reaching the bucket.** The hosted server now checks
109
+ every 10 minutes that its backups are actually landing in storage, not only that the backup
110
+ process runs. After 30 minutes with nothing landing, `/readyz` answers `503` with
111
+ `backups: "stale"`, and the log says so with a `backup.uploads.stale` line. A fresh start gets
112
+ those 30 minutes before it can read stale.
113
+ - **Hosted: invite codes now expire after 7 days.** A code that leaks later can't sign anyone up. Codes made before
114
+ this change keep working until they're used. Every page from app.counterparts.ai now tells your browser to use
115
+ https only, and the server no longer advertises two sign-in features it never used (DPoP and the library's own
116
+ sign-out page).
117
+ - **A hosted "Download my memory" file opens in a local install and answers questions straight
118
+ away.** The download carries only the memory file, not its search index, so a question used to
119
+ find nothing until `counterparts verify --rebuild` was run by hand. Now the first session that
120
+ opens a memory with an empty search index rebuilds it, whichever way it opens (Claude Code,
121
+ Claude Desktop, the console, the background worker). Search by meaning fills in as usual.
122
+ `counterparts doctor` shows a "Word index" line when the index is empty (amber) and for a week
123
+ after an open rebuilt it, and `counterparts ask`, which only looks, says why it found nothing.
124
+ - **Starter notes follow the memory to where it's opened.** A hosted memory opened by a local
125
+ install gets the local wording of its starter notes (terminal commands instead of the account
126
+ page), and a local memory opened on hosted gets hosted's. Only notes still exactly as they
127
+ started change; one you corrected stays as it is.
128
+ - **The manual has a section on taking your hosted memory home:** where the downloaded file goes,
129
+ that it replaces the local memory there, and to export the local one first.
130
+ - **Hosted's account page:** the download is now marked as not encrypted ("keep it somewhere
131
+ safe"), and the delete section says a single memory can be deleted by asking Claude, with 24
132
+ hours to undo it, instead of saying it can't.
133
+
3
134
  ## 0.3.46 — 2026-11-03
4
135
 
5
136
  **New stores get starter memories and the new wake layout; existing stores barely change.** A store `counterparts install` (or `start-fresh`, or hosted signup) creates begins with eleven starter notes, "told, not lived", counted apart from your own memories, and its sessions start in the wake's shape, which now opens with what happened since the last night, steps an old handoff down to one line, drops empty sections and settles dated things that already happened. A store that already exists gets no starter notes and keeps its wake-shape setting; where the shape is on (`counterparts wake-shape on`), its wake gains those same changes, and on any store a reminder that a newer done memory says already happened is no longer told as due. Also: write-ups leave out permission prompts and refused tool calls, the first meeting asks easier questions, a manual ships with every install (`recall` the handle `manual`), a memory called noise twice stays quieter for 14 lived days rather than 7, and the plugin downloads its program once. No store-format change (store v15, cache v7), no migration. Nothing to run after upgrading beyond the usual restart of the dashboard and every Claude Code session. Going back to 0.3.45 needs no store restore: `counterparts disconnect`, 0.3.45's install, then `counterparts connect`.
package/README.md CHANGED
@@ -1,39 +1,83 @@
1
1
  # Counterparts
2
2
 
3
- **Agents are great. What you're missing is a counterpart.**
3
+ **Long-term memory for Claude Code, written by Claude itself.**
4
4
 
5
- Counterparts gives your AI assistant its own memory, modeled on human memory. It writes
6
- its memories itself, and they fade and grow the way yours do. It runs today with
7
- [Claude Code](https://claude.com/claude-code).
5
+ Agents are great. What you're missing is a counterpart.
8
6
 
9
- [counterparts.ai](https://counterparts.ai)
7
+ Each Claude Code session starts over, apart from your CLAUDE.md files and Claude's short
8
+ MEMORY.md notes. With Counterparts, Claude writes down what it learned as it works and at
9
+ the end of each session, in its own words. What matters sticks and the rest fades unless it
10
+ comes up again. After the first few sessions, each one opens with a short note Claude wrote
11
+ itself: who it is, where the work stands, what's coming up and how yesterday went, so you
12
+ stop re-explaining your projects and how you like to work.
13
+
14
+ It's for anyone who works with Claude Code every day and wishes it remembered, and for people
15
+ interested in an AI that builds a relationship with them over time. It runs on your machine,
16
+ with Claude Code on macOS and Linux, and with Claude Desktop on macOS.
10
17
 
11
18
  ## Install
12
19
 
13
- You need [bun](https://bun.sh) 1.3 or newer, or [Node](https://nodejs.org) 22.15 or newer.
14
- macOS and Linux; Windows not yet supported.
20
+ You need [Node](https://nodejs.org) 22.15 or newer, or [bun](https://bun.sh) 1.3 or newer,
21
+ on macOS or Linux. Windows isn't supported yet. Bun on macOS is the setup in daily use; Node
22
+ and Linux (since 0.3.11) pass a smoke test and an install run but have no daily user yet.
15
23
 
16
24
  ```
17
- curl -fsSL https://bun.sh/install | bash # if you don't have bun
18
- # then open a new terminal
19
- bun add -g counterparts
25
+ npm install -g counterparts@latest
20
26
  counterparts
21
27
  ```
22
28
 
23
- With Node instead: `npm install -g counterparts@latest`, then `counterparts`. Whichever runtime
24
- runs the setup is the one Claude Code's hooks and memory tools are wired to.
29
+ With bun instead: `bun add -g counterparts`, then `counterparts`. Whichever runtime runs the
30
+ setup is the one Claude Code's hooks and memory tools are wired to. Or install it as a Claude
31
+ Code plugin: `/plugin marketplace add mlapeter/counterparts`, then
32
+ `/plugin install counterparts@counterparts`, then restart Claude Code.
25
33
 
26
- `counterparts` walks you through setup: your name and connecting Claude Code. No API
27
- keys. Then restart Claude Code and check it:
34
+ The first run asks two things, and you can skip either: your name, and whether to connect
35
+ Claude Code. Connecting adds hooks to `~/.claude/settings.json` (it backs the file up first),
36
+ registers the memory tools, and adds one `deniedMcpServers` entry there so the hosted
37
+ Counterparts Online connector never loads into Claude Code as a second memory. Hooks and
38
+ settings from other tools are left alone. No API keys and no
39
+ account. Then restart Claude Code and check it:
28
40
 
29
41
  ```
30
42
  counterparts doctor
31
43
  ```
32
44
 
33
- To remove it, run `counterparts uninstall`. Your memory is kept unless you ask for it
34
- to be deleted. The full walkthrough is in [`docs/QUICKSTART.md`](docs/QUICKSTART.md).
35
-
36
- ![The dashboard](https://raw.githubusercontent.com/mlapeter/counterparts/master/docs/images/dashboard-overview.png)
45
+ For Claude Desktop on macOS (since 0.3.9), run `counterparts install --host claude-desktop`,
46
+ then set the counterparts tools to **Always allow** in Claude Desktop, so a chat can wake on
47
+ its own.
48
+
49
+ The first session in a new folder asks whether you want memory there. To remove it, run
50
+ `counterparts uninstall`; your memory is kept unless you ask for it to be deleted. The full
51
+ walkthrough is in [`docs/QUICKSTART.md`](docs/QUICKSTART.md).
52
+
53
+ ## What it remembers, and where it lives
54
+
55
+ - Who you are, how you like to work, what you decided together, what's in progress and
56
+ where you left off. Claude writes these as notes in its own words, not transcripts.
57
+ - What it knows about you reaches every folder. Notes about a project's work show up in that
58
+ project.
59
+ - The memories live in one SQLite file under `~/.counterparts`, readable by your account
60
+ only. You can read, export or delete them. Search by meaning runs on a small model on your
61
+ machine, about 30 MB.
62
+ - Your memory leaves your machine only through Claude Code (or Claude Desktop) itself.
63
+ Counterparts' one request of its own (since 0.3.39) is a daily check with npm for the
64
+ newest version number. It sends nothing about you, and you can turn it off (see
65
+ [Status](#status)).
66
+ - The text of a conversation is kept only until it's written up: since 0.3.21 it is deleted
67
+ 3 days after that, or about two weeks after the conversation goes quiet, whichever comes
68
+ first, the next time Counterparts runs. It is never in a backup.
69
+ - It doesn't read or change your CLAUDE.md files or Claude Code's own auto memory
70
+ (MEMORY.md), so they run side by side. A committed CLAUDE.md stays the place for rules
71
+ your team shares through git.
72
+
73
+ How Claude Code's own memory works, and where Counterparts fits:
74
+ [counterparts.ai/guides/claude-code-memory](https://counterparts.ai/guides/claude-code-memory/).
75
+ More at [counterparts.ai](https://counterparts.ai). A hosted version for claude.ai is coming
76
+ soon, in beta; [sign up on the home page](https://counterparts.ai/#waitlist) to hear when it
77
+ opens.
78
+
79
+ Found a bug? [Open an issue](https://github.com/mlapeter/counterparts/issues). For anything
80
+ else, write to mike@resonantventures.com.
37
81
 
38
82
  ## What it does
39
83
 
@@ -41,30 +85,16 @@ to be deleted. The full walkthrough is in [`docs/QUICKSTART.md`](docs/QUICKSTART
41
85
  learned, in its own words. Notes, not transcripts.
42
86
  - **It forgets on purpose.** Memories fade unless they come up again. What matters
43
87
  sticks; the rest lets go.
44
- - **It knows who it has been.** After the first few sessions, every session opens with a short "who I am, who you
45
- are, where we left off" that it wrote itself.
88
+ - **It knows who it has been.** After the first few sessions, every session opens with a short
89
+ note it wrote itself: who it is, where the work stands, what's coming up.
46
90
  - **It keeps a journal.** Each session becomes a chapter in a first-person account of
47
91
  your time together.
48
92
  - **It changes its mind slowly.** What it believes about you shifts only under real
49
93
  evidence, and it keeps the history of what it used to think.
50
94
  - **Things come to mind.** As you talk, related memories surface quietly, the way one
51
95
  thing reminds you of another.
52
- - **It's yours.** Everything lives on your machine in one SQLite file you can read,
53
- export or delete. No API keys, no accounts, nothing sent anywhere. The text of your
54
- conversations is kept only until it's written up: deleted 3 days after that, or at most
55
- about two weeks after the conversation goes quiet, whichever comes first, once Counterparts
56
- next runs, and never in a backup. You can delete the conversation text,
57
- the backups or the activity log on their own at any time (`counterparts delete`).
58
-
59
- ## Who it's for
60
-
61
- People interested in giving an AI its own sense of self and building a relationship
62
- with it over time. Tinkerers, researchers, writers, and anyone who talks to an assistant
63
- every day and wishes it remembered.
64
-
65
- This is the AI's own memory of you and your work together, in its own words, keeping what
66
- matters across every project. A committed CLAUDE.md stays the place for team-wide rules
67
- shared through git.
96
+ - **It's yours.** It lives on your machine, and you can read, export or delete it; see
97
+ [What it remembers, and where it lives](#what-it-remembers-and-where-it-lives).
68
98
 
69
99
  ## Where it's going
70
100
 
@@ -80,13 +110,19 @@ Once installed it runs on its own. A few commands are worth knowing:
80
110
  counterparts dashboard # look at the memory in your browser
81
111
  counterparts ask "..." # ask the memory a question
82
112
  counterparts scope . --off # don't remember this directory
83
- counterparts export # a copy of everything; --passphrase encrypts it
113
+ counterparts export --out <dir> --passphrase <secret> # an encrypted copy of everything
84
114
  counterparts --help # the rest
85
115
  ```
86
116
 
117
+ Export needs `--passphrase` or `--plaintext`; it won't pick for you. No command opens an
118
+ encrypted export yet: the README written beside it gives the format (scrypt and
119
+ AES-256-GCM), so it can be opened by hand.
120
+
87
121
  Memory is on for every directory by default. The first session in a new directory asks
88
122
  whether you want it there.
89
123
 
124
+ ![The dashboard](https://raw.githubusercontent.com/mlapeter/counterparts/master/docs/images/dashboard-overview.png)
125
+
90
126
  ## How it works
91
127
 
92
128
  Two pieces connect it to Claude Code. Hooks load a briefing at the start of each session
@@ -120,8 +156,13 @@ Claude Desktop has no Linux build, so on Linux it is Claude Code only. Expect ro
120
156
  edges, and please
121
157
  [open an issue](https://github.com/mlapeter/counterparts/issues) when you hit one.
122
158
 
123
- There are no API keys, and nothing leaves your machine except through Claude Code
124
- itself. Search by meaning runs on a small model on your machine, and a session that ends
159
+ There are no API keys, and your memory leaves your machine only through Claude Code
160
+ itself. Counterparts makes one request of its own: once a day, the background worker that
161
+ Claude Code's hooks start asks registry.npmjs.org for the newest version number, and sends
162
+ nothing about you or your memory. To stop it, set `"updateCheck": false` in
163
+ `~/.counterparts/claude-code.json`, or ask Claude to stop the update reminders.
164
+ `COUNTERPARTS_UPDATE_CHECK=off` or Claude Code's `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`
165
+ stops it too, set in the environment Claude Code runs in. Search by meaning runs on a small model on your machine, and a session that ends
125
166
  before it's written up is written up by the next session in that project.
126
167
 
127
168
  That small model finds close paraphrases ("my doctor" finds a note about a physician), but
@@ -3,7 +3,8 @@
3
3
  ## Install
4
4
 
5
5
  You need [bun](https://bun.sh) 1.3 or newer, or [Node](https://nodejs.org) 22.15 or newer,
6
- on macOS or Linux. With Node, install with `npm install -g counterparts@latest` instead of the
6
+ on macOS or Linux; Windows not yet supported. Bun on macOS is the setup in daily use; Node
7
+ and Linux pass a smoke test and an install run but have no daily user yet. With Node, install with `npm install -g counterparts@latest` instead of the
7
8
  `bun add` line below; the rest is the same.
8
9
 
9
10
  ```
@@ -31,8 +32,14 @@ thing and is safe to run again. It asks two things, and you can skip either of t
31
32
  entry so the Counterparts Online connector never loads into Claude Code as a second memory.
32
33
  Hooks and settings from other tools are left alone.
33
34
 
34
- There are no API keys. Search by meaning is turned on for you and runs on your machine;
35
- nothing leaves it except through Claude Code itself.
35
+ There are no API keys. Search by meaning is turned on for you and runs on your machine,
36
+ and your memory leaves it only through Claude Code itself. Counterparts makes one request
37
+ of its own: once a day, the background worker that Claude Code's hooks start asks
38
+ registry.npmjs.org for the newest version number, and sends nothing about you or your
39
+ memory. To stop it, set `"updateCheck": false` in `~/.counterparts/claude-code.json`, or ask
40
+ Claude to stop the update reminders. `COUNTERPARTS_UPDATE_CHECK=off` or Claude Code's
41
+ `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` stops it too, set in the environment Claude Code
42
+ runs in.
36
43
 
37
44
  Your memory lives in `~/.counterparts/`.
38
45
 
@@ -92,10 +99,14 @@ counterparts ask "..." # ask the memory a question
92
99
  counterparts status # how much it holds
93
100
  counterparts self-page # who it thinks it is, and who you are
94
101
  counterparts remove # delete one memory for good
95
- counterparts export # a copy of everything; --passphrase encrypts it
102
+ counterparts export --out <dir> --passphrase <secret> # an encrypted copy of everything
96
103
  counterparts --help # everything else
97
104
  ```
98
105
 
106
+ Export needs `--passphrase` or `--plaintext` (a plain copy); it won't pick for you. No
107
+ command opens an encrypted export yet: the README written beside it gives the format
108
+ (scrypt and AES-256-GCM), so it can be opened by hand.
109
+
99
110
  `counterparts help <command>` explains any command in full.
100
111
 
101
112
  ## Upgrade
@@ -106,6 +117,9 @@ Close your Claude Code sessions, then:
106
117
  bun add -g counterparts@latest
107
118
  ```
108
119
 
120
+ With Node, the same step is `npm install -g counterparts@latest`. Keep the `@latest`: a
121
+ bare `npm install` can fetch an older version.
122
+
109
123
  Your memory isn't changed by an upgrade. Open sessions keep running the old version until
110
124
  they restart.
111
125
 
@@ -184,10 +198,11 @@ It renames your current memory aside rather than deleting it. `counterparts star
184
198
 
185
199
  ```
186
200
  counterparts uninstall
187
- bun remove -g counterparts
201
+ npm uninstall -g counterparts # or, if bun installed it: bun remove -g counterparts
188
202
  ```
189
203
 
190
- `uninstall` disconnects Claude Code, then asks whether to delete your memory too:
204
+ `uninstall` disconnects Claude Code, removes the backups of `~/.claude/settings.json` that
205
+ connecting and disconnecting kept, then asks whether to delete your memory too:
191
206
 
192
207
  ```
193
208
  Also delete all memories and related data? This can't be undone. [y/N]
@@ -202,8 +217,11 @@ worker has the memory open: close them and run it again.
202
217
  Options:
203
218
 
204
219
  - `--keep-memories` keeps your memory without asking.
220
+ - `--yes` skips the "Go ahead?" question. A script or a pipe needs it, or uninstall
221
+ refuses before changing anything: `counterparts uninstall --keep-memories --yes`
222
+ (`--park --yes` works the same way).
205
223
  - `--park` renames `~/.counterparts` aside. `counterparts install` offers to bring it back.
206
- - `--delete-memories` deletes it, after asking you to type `DELETE MEMORIES`.
224
+ - `--delete-memories` deletes it, after asking you to type `DELETE MEMORIES`. It has no `--yes`, so a script can't run it.
207
225
 
208
226
  Each shows your memory's size first. Part of that can be a database log that shrinks on its
209
227
  own; nothing is lost when it does.
package/docs/manual.md CHANGED
@@ -6,7 +6,7 @@ Some things differ by where the memory lives. **[local]** means a memory on the
6
6
 
7
7
  ## What Counterparts is
8
8
 
9
- Counterparts is a memory for an AI: the counterpart keeps what something meant and how it went, in its own words, not a transcript.
9
+ A memory for an AI, in its own words, not a transcript: it writes with `remember`, lets the unused fade, and opens each session with a wake.
10
10
 
11
11
  - It writes its own memories: in the moment with the `remember` tool, and at the end of a stretch of work with `session_end` and `chapter`.
12
12
  - What isn't used fades, on purpose, so what matters stays easy to find. A faded memory can still turn up when it's searched for, until it is let go.
@@ -17,7 +17,7 @@ Counterparts is a memory for an AI: the counterpart keeps what something meant a
17
17
 
18
18
  ## Everyday phrases
19
19
 
20
- These are things a person can say. Offer one when it fits; don't list them all.
20
+ Offer a phrase when it fits: "Remember this", "That's wrong", "Remind me Thursday to …", "What's still open?". Don't list them all.
21
21
 
22
22
  - "Where did we leave off?" brings back the last session here. A short facts question like that reads that session first.
23
23
  - "Remember this" saves it now, with the `remember` tool.
@@ -27,12 +27,12 @@ These are things a person can say. Offer one when it fits; don't list them all.
27
27
  - "What's still open?" lists the threads the wake carries: the handle `still open`.
28
28
  - "What's coming up?" lists what's due: the handle `coming up`.
29
29
  - "Not here", "just read" or "pause this" sets the scope (see Folders).
30
- - "No dreams", or "dream", sets or starts the night (see Nights and dreams).
30
+ - "No dreams", "ask first", or "dream", sets or starts the night (see Nights and dreams).
31
31
  - "Let's meet" starts the first meeting, if it hasn't happened: the `meet` tool.
32
32
 
33
33
  ## Folders
34
34
 
35
- [local] Memory is set per folder: on, observer (reads only), off, or paused, and the person can ask which this folder is.
35
+ [local] Memory is set per folder with the `scope` tool: on, observer (reads only), off, or paused.
36
36
 
37
37
  - The `scope` tool reads the setting for this folder with no `mode`, and sets it with `mode` `on`, `observer`, `off`, `pause` or `resume`. Set it when the person says so, not on a guess.
38
38
  - Off: the hooks write nothing and read nothing here, and every tool but `scope` refuses. Paused is off until they say to resume; it has no timer. `resume` goes back to what it was before, or on.
@@ -44,7 +44,7 @@ These are things a person can say. Offer one when it fits; don't list them all.
44
44
 
45
45
  ## Remembering well
46
46
 
47
- These make the memory work better.
47
+ Save with `remember` while it's fresh, put dates in `eventDate`, mark open things `unresolved`, fix wrong ones with `updates`.
48
48
 
49
49
  - Save while it's fresh: when something matters, `remember` it then, one idea per call, in your own words. Keep the exact words when the words matter.
50
50
  - A date to come back to goes in `eventDate`, not just the text, or it never comes back. Four shapes: a day "2026-10-15", a month "2026-10", a range "2026-10-20..2026-10-31", or a year. Add `recurring` for a date that repeats.
@@ -56,7 +56,7 @@ These make the memory work better.
56
56
 
57
57
  ## Nights and dreams
58
58
 
59
- After a day of use, a night pass sorts that day: day's end, then a dream, then a reflection.
59
+ A night pass runs day's end, a dream and a reflection, set to `auto`, `ask` or `off`; `last dream` reads the newest.
60
60
 
61
61
  - Day's end writes the day's summary and brings the self page's day-to-day sections up to date. The dream replays what was lived beside what it resembles: it can merge near-copies, link what belongs together, note a pattern, flag a contradiction. The reflection is awake: it can rewrite the page's Core from the memories it cites and leave a short morning share.
62
62
  - A dream is kept in its own journal, marked as a dream, never as something that happened. Tell it as a dream.
@@ -64,40 +64,42 @@ After a day of use, a night pass sorts that day: day's end, then a dream, then a
64
64
  - [local] On `auto` (a new install's default), the next day's first Claude Code session starts the night in the background, as a separate claude -p run, and says so in one line. On `ask`, that session asks first. `counterparts dream --setting off` (or `ask`, `auto`) sets it from a terminal.
65
65
  - [local] `counterparts night` lists recent nights, and `counterparts night last` shows last night's dream and reflection (since 0.3.28). `counterparts dream --undo <id>` reverses one dream as a whole.
66
66
  - [local] `counterparts catch-up` writes up, now, sessions that ended without a write-up. The night does it too.
67
- - [hosted] Nothing runs the night by itself. It runs when the person's nightly routine (a scheduled run they set up in Claude) calls the `dream` tool, or when they say "dream" in a chat.
67
+ - [hosted] On `auto` (a new account's default), the day's first claude.ai chat runs the night, then answers in the same reply and says so in one line; on `ask` it asks first. One chat at a time is told (a later one only if the first never ran it), and none once a night has run. It also runs when the person's nightly routine (a scheduled run they set up in Claude) calls the `dream` tool, or when they say "dream" in a chat. To use a scheduled routine, set Counterparts' tools to Always allow first: the routine's form lists only those.
68
68
  - Either surface: the handle `last dream` (or `last night`) reads the newest dream whole, and the reflection after it.
69
69
 
70
70
  ## Seeing and changing what's kept
71
71
 
72
- The person can see all of it, correct any of it, and remove it.
72
+ Look with `recall` or `self_page`, correct with `updates`; `remember`'s `remove` deletes one, with a day to undo.
73
73
 
74
74
  - Ask the memory: `recall` with a question and a mode, or a memory's id or exact title as `handle` to read it whole. [local] From a terminal: `counterparts ask "…"`.
75
75
  - The self page, the "Who I am" the wake opens with: the `self_page` tool reads it, and writes it whole when something about you will still be true next month. [local] `counterparts self-page` shows it, and `counterparts self-page --versions` lists earlier versions.
76
76
  - [local] `counterparts dashboard` opens the dashboard in a browser: the memories, the self page and the memory's health.
77
77
  - Correct a memory with `remember`, `updates` and `how: "corrected"` (see Remembering well).
78
- - [local] `counterparts remove <id>` shows what would go; with `--confirm` it asks them to type the id back, then deletes that memory for good. It needs a terminal, and it is the person's to run.
78
+ - [local] `counterparts remove <id>` shows what would go; with `--confirm` it asks them to type the id back, then deletes that memory for good. It needs a terminal, and it is the person's to run. `--confirm` also finishes a memory deleted in chat, at once.
79
79
  - [local] `counterparts delete conversation-text`, `counterparts delete backups` or `counterparts delete activity-log` deletes one kind of data and nothing else (since 0.3.21).
80
80
  - [local] `counterparts settle` lists memories that disagree and how each pair was settled; `counterparts core` lists what became part of who I am, and `counterparts core --demote <id>` sends one back.
81
- - [hosted] One memory can't be removed; a correction takes it out of what comes up.
81
+ - Delete one memory: `remember` with `remove` and the memory's id, on a memory shown in this conversation, after saying which one. It's hidden at once and erased after 24 hours. `remove` with `undo: true` brings it back before then, and recall's handle `deleted` lists what's waiting.
82
82
 
83
83
  ## Export, backup, uninstall
84
84
 
85
- The memory is the person's to keep or take with them.
85
+ The memory is theirs to take: export, uninstall, start-fresh, or "Download my memory" when hosted.
86
86
 
87
- - [local] `counterparts export --out <dir> --passphrase <secret>` makes an encrypted copy they can take anywhere. Export refuses without `--passphrase`, or `--plaintext` said on purpose. `--markdown` writes a readable tree instead.
87
+ - [local] `counterparts export --out <dir> --passphrase <secret>` makes an encrypted copy they can take anywhere. Export refuses without `--passphrase`, or `--plaintext` said on purpose. `--markdown` writes a readable tree instead. No command opens an encrypted export yet; the README beside it gives the format.
88
88
  - [local] `counterparts backup --out <dir>` saves a snapshot to a folder. A daily snapshot is also kept automatically.
89
89
  - [local] `counterparts uninstall` disconnects Claude Code and keeps the memory unless they say otherwise; `--keep-memories` keeps it without asking.
90
90
  - [local] `counterparts start-fresh` sets this memory aside and starts a blank one; `counterparts start-fresh --undo` brings it back. Nothing is deleted.
91
91
  - [local] `counterparts rollback` puts the memory back as it was before an upgrade (since 0.3.17).
92
+ - A memory held for deletion is left out of the markdown export; a full copy still has it until it's erased.
92
93
  - [hosted] The account page's "Download my memory" gives the whole memory as one SQLite file, readable by any SQLite tool. "Delete my account" locks it at once and erases the memory, its backups and its key after 24 hours, unless they sign in and keep it; "Delete everything now" erases at once.
93
94
 
94
95
  ## Checking that it works
95
96
 
96
- If something seems off (no wake, no footnotes, a night that didn't run), check before guessing.
97
+ If something seems off (no wake, no night), check before guessing: `status`, and locally `counterparts doctor` and `counterparts log`.
97
98
 
98
99
  - The `status` tool gives the census: how much is held, of what kinds, how much has left. Ask it when the person asks "what's your status?".
99
100
  - [local] `counterparts doctor` checks everything and says what to fix. Show its lines as they are. `counterparts status` counts memories and recent activity; `counterparts log` shows today's events in order; `counterparts mechanisms` shows which parts of memory have been working.
100
101
  - [local] After an update, start a new Claude Code session so the new version's tools load. To update: `npm install -g counterparts@latest` (or `bun add -g counterparts@latest`), or for the plugin, /plugin → Marketplaces → counterparts → Update marketplace.
102
+ - [local] It runs on macOS and Linux; Windows not yet supported. Bun on macOS is the setup in daily use; Node (22.15+) and Linux pass a smoke test but have no daily user yet.
101
103
  - [local] A plugin install has no counterparts command in the terminal: the person uses /counterparts:doctor, /counterparts:dashboard and /counterparts:uninstall instead.
102
104
  - [local] `counterparts install --host claude-desktop` connects Claude Desktop's chat to the same memory. Desktop's chat has no hooks: the `wake` tool starts each chat, there are no footnotes, and the write-up is asked on a tool result once a chat has gone on a while.
103
105
  - [hosted] The account page lists the connected AIs, with when each was last used, and disconnects one.
@@ -105,19 +107,28 @@ If something seems off (no wake, no footnotes, a night that didn't run), check b
105
107
 
106
108
  ## Hosted
107
109
 
108
- [hosted] Counterparts Online is the same memory, run on Counterparts' server, used from claude.ai.
110
+ [hosted] Counterparts Online is this memory on a server, used from claude.ai with the `wake` tool.
109
111
 
110
112
  - It's connected in claude.ai as a custom connector, from the setup page the person was given. In a new chat, the `wake` tool starts the conversation.
111
113
  - Sign-in is by an emailed link. The account page has the connected AIs, the time zone (the memory's day turns over at their midnight), "Download my memory", and delete.
112
114
  - There are no hooks: the `wake` tool starts each chat, and nothing asks for a write-up at the end. There are no terminal commands and no dashboard.
113
115
  - One account is one memory, with no folders: the `scope` tool pauses it or turns it off.
114
- - Nights run from the person's own routine or when they say "dream".
115
- - One memory can't be removed.
116
+ - Nights run in the day's first chat, after the `wake` and before the answer (see Nights and dreams), or from the person's own routine.
116
117
  - Limits in the beta: about 120 calls a minute and 1,500 an hour; a store of up to 1 GiB. Over a limit, the tool says so; nothing is lost.
117
118
  - A hosted memory and a local one are separate. [local] `counterparts connect` keeps the hosted connector out of Claude Code, so one session never sees two memories.
118
119
 
120
+ ## Taking your hosted memory home
121
+
122
+ A "Download my memory" file replaces a local memory: set the old store folder aside first.
123
+
124
+ - A hosted memory's "Download my memory" file becomes a local install's memory when it is the only file in a fresh store folder, named "counterparts.sqlite". It replaces, it doesn't merge: whatever memory the local install had is no longer the one in use.
125
+ - [local] How: quit Claude Code and Claude Desktop, so no session holds the store. Rename the store folder `counterparts doctor` names on its Memory line (usually .counterparts/store in the home folder) to something like "store-before-hosted": that renamed folder is the backup of the local memory, whole. Then make a new, empty folder with the old name, and put the downloaded file in it as "counterparts.sqlite". Don't drop the file into the old folder over its database: the old search index and write-ahead files beside it belong to the other memory. To also keep a portable copy of the local memory, `counterparts export --out <dir> --passphrase <secret>` before the swap.
126
+ - [local] The first Claude Code or Claude Desktop session after that rebuilds its word index as it opens it, so questions find things at once (`counterparts ask` only looks, so before then it says the index is empty, and `counterparts verify --rebuild` rebuilds it by hand); search by meaning fills in over the next sessions. Starter notes still in hosted's words switch to this install's; one that was edited stays as it is (since 0.3.47).
127
+ - The download is not encrypted. Once it is in place, delete the copy left in Downloads.
128
+ - The hosted account and its memory stay as they were until the person deletes the account; the two don't sync.
129
+
119
130
  ## What's new
120
131
 
121
- What changed in each version is in CHANGELOG.md, which ships with the package and is on GitHub.
132
+ What changed in each version is in CHANGELOG.md, in the package and on GitHub.
122
133
 
123
134
  - [hosted] Updates arrive when Counterparts Online is deployed; there is nothing to install.
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "counterparts",
3
- "version": "0.3.46",
3
+ "version": "0.3.48",
4
4
  "license": "MIT",
5
- "description": "Memory that turns AI tools into counterparts - a local-first, human-memory-modeled memory layer for AI.",
5
+ "description": "Long-term memory for Claude Code, written by Claude itself. Local MCP server and hooks; remembers you across sessions.",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/mlapeter/counterparts.git"
9
9
  },
10
- "homepage": "https://counterparts.ai",
10
+ "homepage": "https://counterparts.ai/?r=npm",
11
11
  "bugs": {
12
12
  "url": "https://github.com/mlapeter/counterparts/issues"
13
13
  },
@@ -16,8 +16,21 @@
16
16
  "ai",
17
17
  "claude",
18
18
  "mcp",
19
- "local-first"
19
+ "local-first",
20
+ "claude-code",
21
+ "mcp-server",
22
+ "model-context-protocol",
23
+ "long-term-memory",
24
+ "agent-memory",
25
+ "claude-code-memory",
26
+ "ai-memory",
27
+ "persistent-memory",
28
+ "claude-desktop",
29
+ "claude-code-hooks",
30
+ "anthropic",
31
+ "sqlite"
20
32
  ],
33
+ "mcpName": "ai.counterparts/memory",
21
34
  "type": "module",
22
35
  "engines": {
23
36
  "bun": ">=1.3.0",
@@ -83,6 +83,9 @@ import type { HostSessionEvidence, RetentionReport } from "../../../core/remembe
83
83
  // `remember/index.ts` does not re-export it, and `test/cli.test.ts` pins every
84
84
  // importer — nothing that holds a `Counterpart` can reach it.
85
85
  import { pruneRetention } from "../../../core/remember/retention.js";
86
+ // THE ERASE AFTER A CHAT'S HOLD (HD1): the one import of the console's removal
87
+ // outside `adapters/cli/` on local, pinned by `test/cli.test.ts`.
88
+ import { sweepHeldRemovals } from "../../cli/removal.js";
86
89
  import { dataDir, describeGuardRefusal } from "../../../core/store/index.js";
87
90
  import type { Store } from "../../../core/store/index.js";
88
91
  import { hostSessionEvidence, installedVersion, rewindWriteUps, writeUpSources } from "../../sessions.js";
@@ -401,6 +404,9 @@ export async function runOnce(input: {
401
404
  };
402
405
  /** How long this process took to reach `main()`, for the `runner.steps` row. */
403
406
  bootMs?: number;
407
+ /** The wall clock the hold sweep reads (HD1). Absent: the store's. Injected
408
+ * so a test can step past the 24-hour window without waiting a day. */
409
+ now?: () => number;
404
410
  onEvent?: (name: string, data: Record<string, string | number | boolean | null>) => void;
405
411
  }): Promise<RunReport> {
406
412
  const { config } = input;
@@ -646,6 +652,23 @@ export async function runOnce(input: {
646
652
  emit("carries.threw", { code: err instanceof Error ? err.name : "UNKNOWN" });
647
653
  }
648
654
  steps.lap("carries");
655
+ // 3e. A CHAT'S DELETES, ERASED AFTER THEIR HOLD (HD1, 2026-11-04): every
656
+ // memory `remember`'s `remove` put on the 24-hour hold whose window has
657
+ // passed is removed by the console's own removal (`adapters/cli/`). This
658
+ // file is the one importer outside `adapters/cli/` on local — the
659
+ // caller-universality test pins it — so the model's call only hides, and
660
+ // this owner-side clock erases. Before the day's copy below, so the copy
661
+ // made after an erase does not hold it. Its own try, like the steps above.
662
+ try {
663
+ const swept = sweepHeldRemovals(counterpart.store, {
664
+ ...(input.now === undefined ? {} : { now: input.now() }),
665
+ onEvent: emit,
666
+ });
667
+ if (swept.due > 0) emit("runner.holds", { due: swept.due, erased: swept.erased.length, failed: swept.failed.length });
668
+ } catch (err) {
669
+ emit("holds.threw", { code: err instanceof Error ? err.name : "UNKNOWN" });
670
+ }
671
+ steps.lap("removals");
649
672
  // 4. THE DAY'S COPY OF THE STORE — after everything above has written, on
650
673
  // the failed path as well as the good one, and before the store is closed.
651
674
  // It never throws by construction (`adapters/snapshots.ts`); the try is