counterparts 0.3.19 → 0.3.21

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 (108) hide show
  1. package/CHANGELOG.md +119 -0
  2. package/README.md +12 -4
  3. package/docs/module-map.md +6 -0
  4. package/package.json +1 -1
  5. package/src/adapters/claude-code/CONTRACT.md +14 -13
  6. package/src/adapters/claude-code/NOTES.md +29 -0
  7. package/src/adapters/claude-code/bin/hook.ts +12 -4
  8. package/src/adapters/claude-code/bin/runner.ts +41 -20
  9. package/src/adapters/claude-code/doctor.ts +123 -30
  10. package/src/adapters/claude-code/hooks.ts +70 -86
  11. package/src/adapters/claude-code/index.ts +0 -3
  12. package/src/adapters/cli/NOTES.md +8 -0
  13. package/src/adapters/cli/commands-delete.ts +273 -0
  14. package/src/adapters/cli/commands-install.ts +29 -10
  15. package/src/adapters/cli/commands-note.ts +1 -1
  16. package/src/adapters/cli/commands-readings.ts +4 -2
  17. package/src/adapters/cli/commands-scope.ts +25 -4
  18. package/src/adapters/cli/commands-self.ts +4 -1
  19. package/src/adapters/cli/commands-start-fresh.ts +1 -1
  20. package/src/adapters/cli/commands.ts +22 -3
  21. package/src/adapters/cli/help.ts +7 -7
  22. package/src/adapters/cli/install.ts +4 -2
  23. package/src/adapters/cli/mechanisms.ts +2 -2
  24. package/src/adapters/cli/removal.ts +1 -1
  25. package/src/adapters/config.ts +112 -30
  26. package/src/adapters/dashboard/CONTRACT.md +14 -0
  27. package/src/adapters/dashboard/NOTES.md +15 -0
  28. package/src/adapters/dashboard/activity.ts +1 -1
  29. package/src/adapters/dashboard/bin/dashboard.ts +3 -3
  30. package/src/adapters/dashboard/browse.ts +1 -1
  31. package/src/adapters/dashboard/identity.ts +1 -1
  32. package/src/adapters/dashboard/registries.ts +14 -14
  33. package/src/adapters/dashboard/resolve.ts +1 -1
  34. package/src/adapters/dashboard/status.ts +5 -2
  35. package/src/adapters/dashboard/web/actions.ts +21 -2
  36. package/src/adapters/dashboard/web/app.html +1 -1
  37. package/src/adapters/dashboard/web/flow.ts +1 -1
  38. package/src/adapters/dashboard/web/mechanisms/consolidation/index.js +2 -2
  39. package/src/adapters/dashboard/web/mechanisms/consolidation/panel.js +1 -1
  40. package/src/adapters/dashboard/web/mechanisms/decay/index.js +1 -1
  41. package/src/adapters/dashboard/web/mechanisms/reconsolidation/index.js +2 -2
  42. package/src/adapters/dashboard/web/mechanisms/retrieval/panel.js +3 -3
  43. package/src/adapters/dashboard/web/mechanisms/salience/panel.js +2 -2
  44. package/src/adapters/dashboard/web/narrate.ts +11 -11
  45. package/src/adapters/dashboard/web/pages/flow/sections/heatmap.js +1 -1
  46. package/src/adapters/dashboard/web/pages/health/sections/checks.js +3 -2
  47. package/src/adapters/dashboard/web/pages/health/sections/cycle.js +5 -5
  48. package/src/adapters/dashboard/web/pages/health/sections/mechanisms.js +1 -1
  49. package/src/adapters/dashboard/web/pages/health/sections/wake.js +2 -2
  50. package/src/adapters/dashboard/web/pages/memories/sections/tools.js +73 -3
  51. package/src/adapters/dashboard/web/pages/self/sections/dreams.js +2 -2
  52. package/src/adapters/dashboard/web/pages/self/sections/journal.js +5 -5
  53. package/src/adapters/dashboard/web/pages/self/sections/page.js +13 -13
  54. package/src/adapters/dashboard/web/pages/self/sections/settling.js +1 -1
  55. package/src/adapters/dashboard/web/pages/self/sections/wake.js +7 -7
  56. package/src/adapters/dashboard/web/server.ts +9 -1
  57. package/src/adapters/dashboard/web/shared/event-modal.js +1 -1
  58. package/src/adapters/dashboard/web/shared/memory-card-words.js +1 -1
  59. package/src/adapters/dashboard/web/shared/memory-modal.js +5 -5
  60. package/src/adapters/dashboard/web/views/activity.ts +1 -1
  61. package/src/adapters/dashboard/web/views/dreams.ts +1 -1
  62. package/src/adapters/dashboard/web/views/health.ts +1 -1
  63. package/src/adapters/dashboard/web/views/mechanisms.ts +6 -6
  64. package/src/adapters/dashboard/web/views/mind.ts +21 -9
  65. package/src/adapters/dashboard/web/views/overview.ts +3 -3
  66. package/src/adapters/expansions.ts +14 -1
  67. package/src/adapters/fired.ts +1 -1
  68. package/src/adapters/lifecycle.ts +25 -4
  69. package/src/adapters/log/index.ts +21 -0
  70. package/src/adapters/mcp/CONTRACT.md +1 -1
  71. package/src/adapters/mcp/server-self-tools.ts +25 -1
  72. package/src/adapters/mcp/server-words.ts +3 -2
  73. package/src/adapters/mcp/server.ts +45 -9
  74. package/src/adapters/mcp/tools.ts +4 -3
  75. package/src/adapters/plugin.ts +44 -8
  76. package/src/adapters/sessions.ts +5 -2
  77. package/src/adapters/snapshots.ts +90 -1
  78. package/src/adapters/store-id.ts +58 -0
  79. package/src/core/counterpart-boundary.ts +9 -0
  80. package/src/core/counterpart.ts +19 -6
  81. package/src/core/dream/CONTRACT.md +8 -0
  82. package/src/core/dream/index.ts +15 -2
  83. package/src/core/handoff/last-here.ts +24 -12
  84. package/src/core/onboarding.ts +231 -62
  85. package/src/core/prospective/CONTRACT.md +4 -1
  86. package/src/core/prospective/index.ts +23 -5
  87. package/src/core/recall/CONTRACT.md +3 -1
  88. package/src/core/recall/INTERFACE-GAPS.md +1 -1
  89. package/src/core/recall/NOTES.md +14 -0
  90. package/src/core/recall/session.ts +40 -1
  91. package/src/core/reconsolidation.ts +1 -1
  92. package/src/core/remember/CONTRACT.md +14 -8
  93. package/src/core/remember/owes.ts +68 -28
  94. package/src/core/remember/owner-strike-seam.ts +6 -3
  95. package/src/core/remember/spans.ts +3 -2
  96. package/src/core/remember/tunables.ts +18 -5
  97. package/src/core/remember/write-up-seam.ts +2 -1
  98. package/src/core/self/CONTRACT.md +25 -9
  99. package/src/core/self/NOTES.md +6 -0
  100. package/src/core/self/briefing-delivery.ts +349 -0
  101. package/src/core/self/briefing-page.ts +315 -0
  102. package/src/core/self/briefing-room.ts +563 -0
  103. package/src/core/self/briefing.ts +304 -1156
  104. package/src/core/self/index.ts +28 -6
  105. package/src/core/store/NOTES.md +6 -5
  106. package/src/core/store/index.ts +39 -0
  107. package/src/core/store/paths.ts +9 -2
  108. package/src/adapters/claude-code/primacy.ts +0 -162
package/CHANGELOG.md CHANGED
@@ -1,5 +1,124 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.21 — 2026-10-13
4
+
5
+ Your conversation text is kept for less time, and never in a backup. The text of a conversation is now deleted 3 days after it has been written up and the session has ended (it was 7), and it is never kept more than 14 days after the session's last activity, written up or not; both numbers can be changed with `"retention": {"afterWriteUpDays": 3, "maxDays": 14}` in `claude-code.json`. The first time the new version runs on an existing memory, everything older than those limits is deleted in one go, so if you want to keep more, add the `retention` setting before your first session on 0.3.21. Daily backups stop copying conversation text; backups made before this update still hold it until they rotate out, or until you run `counterparts delete backups`. New `counterparts delete conversation-text`, `delete backups` and `delete activity-log` (and "Delete data…" on the dashboard's Memories page) each delete one kind of data after showing what they would delete. The few words recall carries from your last message are cleared once a session has been quiet past the same 14-day limit. Also: the plugin installs over HTTPS without a GitHub SSH key (run `/plugin marketplace update counterparts` first if you added the marketplace before), "installed twice" is said once, the first meeting says where the sidebar appears, and the sidebar's fox and its look in the Claude Desktop app are polished (the Desktop shows the fox, not the brain, this version). No store-format change (store v13, cache v6) and no wiring change: nothing to run after upgrading from 0.3.20, and `counterparts connect` is not needed.
6
+
7
+ - **The plugin installs without a GitHub SSH key.** On a computer with no SSH key that
8
+ GitHub accepts, `/plugin install counterparts@counterparts` failed with "Permission denied
9
+ (publickey)", even though adding the marketplace had worked. The marketplace now names the
10
+ repository by its `https://` address, which needs no key. If you added the marketplace
11
+ before, run `/plugin marketplace update counterparts` first, then install again.
12
+ - **"Installed twice" is said once.** With both the npm install and the plugin, the plugin
13
+ stands down and said so at the start of every session, which read like an error. It now
14
+ says it at the first session that finds both, then stays quiet; `counterparts doctor`
15
+ still shows it. Nothing about how the two share the memory has changed.
16
+ - **Conversation text is kept for less time, and never in a backup.** The text of your
17
+ conversations is deleted 3 days after it is written up and the session has ended (it
18
+ was 7), and is never kept more than 14 days after the session's last activity, written
19
+ up or not. Both can be changed in `claude-code.json`:
20
+ `"retention": {"afterWriteUpDays": 3, "maxDays": 14}`. Daily backups no longer copy it
21
+ at all, so restoring one loses whatever was not yet written up. Backups made before
22
+ this update still hold it until they rotate out, or until you delete them.
23
+ - **Delete one kind of data at a time.** `counterparts delete conversation-text`,
24
+ `delete backups` and `delete activity-log` each delete that one kind and nothing else.
25
+ Each shows what it would delete first (for conversation text, how many sessions were
26
+ still waiting to be written up and would be lost) and asks once; `--yes` skips the
27
+ question for a script. The dashboard's Memories page has the same three under
28
+ "Delete data…".
29
+ - **The first meeting says where the sidebar is.** In the plugin, the end of the first
30
+ meeting now says the memory sidebar appears on the right once the window is wide
31
+ enough.
32
+ - **The sidebar's fox is a little more alive, and calmer about it.** He does small things
33
+ more often (a blink, a flick of his tail tip, an ear twitch, a glance), and flicks his tail
34
+ within a few seconds of the sidebar opening. When something comes to mind he perks up,
35
+ curious, with one ear raised. Left alone, he lies down after 45 seconds and naps after two
36
+ minutes; anything you do gets him up. His small moves no longer make his whole body
37
+ flicker, in the desktop app and in Ghostty or kitty. In iTerm, WezTerm and VS Code he
38
+ now has his intended colours (a warmer orange, a cream chest), and his notepad shows.
39
+ - **A clearer hint when the window is too narrow for the sidebar.** The line under the
40
+ prompt now says to widen the window, instead of naming a command that can't open it there.
41
+ - **Your words from a session's last turn no longer stay in the database.** Recall keeps a
42
+ few words from your previous message to help with the next one. A session that ended,
43
+ or was closed abruptly, kept its last few words indefinitely. Now they are cleared once
44
+ the session has been quiet for the retention limit (14 days unless you changed it),
45
+ including for sessions from before this update. Backups taken from then on don't
46
+ contain them either.
47
+ - **The sidebar looks right in the Claude Desktop app.** It now uses the app's own colours (light or
48
+ dark), has no lines of dashes, wraps its text to the app's font, leaves a blank row between
49
+ items, and draws the "Mechanisms today" bars at a readable size. The fox no longer shows a dark
50
+ edge on the light page and fits a narrower pane.
51
+ - **The memory count sits on the sidebar's title row, beside the day** ("1511 memories · day 22",
52
+ shortened when the pane is narrow), in every app, and the search row appears only when search is
53
+ switched on.
54
+ - **The sidebar's "quietly available" titles read cleanly.** "Earlier (now [id]): ..." shows as
55
+ "Earlier: ...", "Unsettled - may be out of date, see [id]: ..." as "Unsettled: ...", "Corrected by
56
+ [id]: ..." as "Corrected: ...", and the trailing "(earlier: [id])" and "(corrects [id])" are left
57
+ off; a click on one opens that memory, not the one its note points at.
58
+ - **In the Desktop app the avatar is the fox or nothing.** The brain doesn't draw there yet, so the
59
+ avatar row offers animal and off, and a brain chosen in the terminal shows the fox on the Desktop. The
60
+ terminal keeps its brain.
61
+ - **Pressing the Counterparts switch in auto mode no longer shows an engine error.** When auto mode
62
+ declines the press, a short note says so and tells you what to ask Claude instead ("pause
63
+ Counterparts here"); the switch stays as it was.
64
+
65
+ ## 0.3.20 — 2026-10-12
66
+
67
+ New installs from the plugin now remember from the second day. (Plugin first runs and scripted `install --yes` had never set a size limit for the wake, so every session opened on "No briefing has been composed yet"; earlier plugin installs had the same gap, and they are fixed automatically, with no action and no change to your configuration file; the first session after upgrading may still open on that line, and the wake is composed when that session ends.) The first meeting is the heart of this release. A new install now opens with a short, easy conversation where Claude introduces itself, asks one question at a time (all fine to pass), writes up what it learned right there, and ends with "What would you like to work on today?". Nothing interrupts it: no dream starts and the end-of-turn write-up waits, so the first dream comes the next day. Everyday words replace the internal ones: session starts say "Coming up:" and "Might be relevant:", dates read "Oct 11", and the dashboard uses the same words. A brand-new install's first `counterparts doctor` shows no ambers, a plugin install gets a one-line welcome, and the README is honest about what recall by meaning can and cannot find. The sidebar gains onboarding, a small fox, a second theme and the dashboard's store id; its Claude Code memory switch is gone, and the dead read of an A/B file in the home directory is removed. Reminders are no longer spent on a compaction nobody reads, and the wake never drops a section without saying so. No store-format change (store v13, cache v6) and no wiring change: nothing to run after upgrading from 0.3.19, and `counterparts connect` is not needed.
68
+
69
+ - **The sidebar's first-meeting prompt reads like a sentence.** The line Claude Code shows when the plugin asks Claude to say hello is now "Counterparts is installed. Claude would like to introduce itself."
70
+ - **The sidebar's quiet line reads as one phrase.** A fresh save shows as `Stored "title" — ` and as much of what was written as the width allows, cut at a word, instead of `stored: ` before a title that has its own prefix.
71
+ - **On the classic screen the sidebar's line suggests `/tui fullscreen`.** Where the pane cannot dock, the dim line under the prompt now says that `/tui fullscreen` shows the memory sidebar; nothing about the setting is changed for you.
72
+ - **The first meeting is no longer interrupted.** While you and Claude are getting to know each other, no dream starts and the end-of-turn write-up waits. When the meeting finishes, Claude writes it up right there and tells you in a few lines what it will remember. The first dream comes on your next day, not the first one.
73
+ - **The opening asks once.** Claude introduces itself in one line and asks whether you have five minutes in the question dialog only, not in the text as well.
74
+ - **Easier questions.** The meeting now asks about the highlight of your week, what you're enjoying working on, what you love about what you do, a good Saturday, and what got you started. One question at a time, at most one follow-up, and "pass" is always fine. It never asks your pronouns. Until you say them, Claude writes about you by name or as "they", in memories, chapters and dreams.
75
+ - **The meeting ends with what to do next.** It ends with "What would you like to work on today?" rather than a list of facts. Where your memory lives, what is kept and how to uninstall are given word for word when you ask.
76
+ - **Plugin installs are told what to say, not what to type.** The first-run line says to say "no dreams" and no longer gives a `counterparts` command. A dream's summary now says to say "undo that dream", and Claude can undo it through its own tools.
77
+ - **The README and the plugin's page say what recall by meaning can and can't find.** The
78
+ small on-device model finds close paraphrases ("my doctor" finds a note about a
79
+ physician), but not a description that never names the thing ("a pet that purrs" for a
80
+ note about your cat). Exact words are strongest, and a short memory matches better than
81
+ one padded with names and details.
82
+ - **A brand-new install's first `counterparts doctor` no longer goes amber while the first night run is still working.** On the first day your memory lives past midnight, the Sweep, Sleep, Backfill and Snapshots lines now say in green that the first night run starts today and writes them when it finishes; they turn amber only once a whole earlier day has passed with nothing written.
83
+ - **A reminder isn't spent on a session nobody reads.** When Claude compacts a long conversation (or a subagent compacts its own), a reminder due today is no longer said there and marked as told. It waits for the next message you type. The nightly dream run is also no longer handed the day's reminders as quiet hints, so it can't use up the nudges meant for your day.
84
+ - **Nothing in the wake disappears without a word.** When the wake is short of room, a section that
85
+ can't fit all its items now always keeps a line saying how many more there are and the ids to open
86
+ them, like a table of contents. Before, that line went in last and only when room was left over, so
87
+ a whole section ("Still open" or "Arriving:") could vanish with no sign. A section that still lists
88
+ something keeps its count right under it. Sections that list nothing fold into one line when they
89
+ must: "More than this wake lists: 3 still open (recall ids: …); 2 on how I work (recall ids: …)". A
90
+ plain reminder due today is still said in full.
91
+ - **"Nearby" says how many it left out, when there's room.** The hints the wake picked and then had no
92
+ room for are counted with their ids, in room nothing else wants. They never push out "Last here" or
93
+ another section's items. The rest of the store is still not counted: recall finds it by asking.
94
+ - **Doctor tells a step-down from a drop.** A section shown by count is the wake doing its job. A
95
+ memory the wake picked and then left out of every line turns the Wake line red, as a bug to report.
96
+ - **The sidebar has a second look.** `/counterparts theme cozy` turns the pane warm (dark walnut, parchment text, leaf green and pumpkin) in every session; `/counterparts theme tron` brings back the black, cyan and amber it has always had, which stays the default.
97
+ - **The sidebar's button for a put-off first meeting says what it starts.** It reads "Start the 5-minute intro" (was "Meet your counterpart").
98
+ - **The sidebar no longer sounds broken when there is nothing to show.** With the dashboard closed, Mechanisms today says "Counts appear once the dashboard is open (/counterparts:dashboard)", the same for every install; with nothing new yet, the quiet line under the prompt reads "Watching quietly · nothing new yet".
99
+ - **Plainer first-week wording.** The privacy answer, the first-meeting style notes, the daily tidy-up line, the day-one health check, `counterparts --help` and the README now say things in everyday words. The style notes use your name (or "They") instead of "the owner", and the privacy answer spells out exactly how long session text is kept.
100
+ - **Dates read like dates.** The "Yesterday" and "Last here" lines at the start of a session say "Oct 11" instead of "10-11", say "2 sessions in other projects" instead of "chapters from 2 sessions in other directories", and no longer count chapters.
101
+ - **A friendlier first day.** Before a first page and identity exist, the assistant says "We've only just met" and "Still forming: I write this page after a few sessions". The session-start headings "Arriving:" and "Nearby, if it helps:" are now "Coming up:" and "Might be relevant:".
102
+ - **README.** Says the "who I am, who you are" opening arrives after the first few sessions, and that Windows is not yet supported.
103
+ - **The dashboard uses the same words as the session start.** Where the dashboard said "Arriving" and "memories nearby", it now says "Coming up" and "Might be relevant", the headings a session opens with. "Lived day 12" is now "day 12 of use", as the health check says it, and "the owner" is "you". Places your sessions ran are "projects", not "directories".
104
+ - **Clearer count lines at the session start.** When there's no room to list everything, the count line now says "3 more coming up" or "2 more might be relevant" rather than "arriving" or "nearby".
105
+ - **Status shows a readable date.** The opening line of `counterparts dashboard status` says "I have had 19 days of use — the latest Oct 11" in place of "I have lived 19 days — the last of them 2026-10-11".
106
+ - **Claude's first hello says the memory grows with you.** The first meeting's introduction now ends "so I can carry what matters from one session to the next, and grow along with you." When the sidebar's "Meet your new counterpart." starts the meeting, Claude reads it as the meeting and opens with that introduction.
107
+ - **A one-line welcome.** A new plugin install's first session now says "Counterparts is set up: a memory that stays on this computer, in ~/.counterparts. (Daily tidy-up, called dreaming, is on; say "no dreams" to turn it off.)" instead of three lines.
108
+ - **The dashboard says which memory it shows.** `GET /api/whoami` returns a short store id and the version, and `/api/onboarding` carries the same id. Each session start names the same id for the sidebar, so with two memories on one computer the sidebar can tell whether the dashboard on its port is the right one. The id never contains the folder's path.
109
+ - **A small fox now lives at the top of the sidebar.** Most of the time it sits still. Every so often it blinks, glances around, flicks an ear or swishes its tail, and after a few quiet minutes it curls up for a nap until your next message. It also shows what your memory is doing: it perks up with a spark when something comes to mind, writes on a notepad when a memory is saved, waves during your first meeting, and sleeps with a dream beside it while a dream runs.
110
+ - **The fox is drawn as finely as your terminal allows.** You get a full picture in kitty and Ghostty, fine block characters in iTerm2, WezTerm and VS Code, and half-blocks everywhere else. In the desktop app it is a drawing. `/counterparts avatar detail auto|images|fine|basic` picks one yourself, and `/counterparts avatar brain|animal|off` switches between the fox, the brain and no avatar. If you chose the brain before, you keep it.
111
+ - **"Start the 5-minute intro" starts the intro in any session.** The button now runs `/counterparts:meet`, so Claude knows what you asked for, even in a session days after you put the meeting off.
112
+ - **The sidebar starts the dashboard for you.** When the dashboard isn't running, the Mechanisms section says "Start the dashboard to see stats here", and clicking it runs `/counterparts:dashboard`.
113
+ - **The sidebar never shows another memory's numbers.** If the dashboard on your machine belongs to a different memory store (a trial store, say), the sidebar shows "This dashboard belongs to another memory." in place of its counts.
114
+ - **The sidebar's search box is hidden for now.** In some terminals it couldn't be clicked into. It will come back once that is fixed. Ask Claude to recall things in the meantime.
115
+ - **The sidebar no longer offers to turn off Claude Code's own memory.** The opt-in "Claude memory" switch is gone, along with the `COUNTERPARTS_SIDEBAR_CC_MEMORY` setting that showed it. If you had turned Claude Code's memory off with it, your MEMORY.md files and Claude Code's memory instructions come back from your next session.
116
+ - **Counterparts no longer reads a file outside its own directories.** The parallel run's
117
+ switch, which could read an A/B assignment file in your home directory when a `parallel`
118
+ setting was turned on, is gone; a configuration that still has a `parallel` key keeps
119
+ working and the key is ignored.
120
+ - **New installs from the plugin now remember from the next session on.** An install made by the plugin's first run, or by `counterparts install` from a script, never set a size limit for the wake. With no limit, the briefing was never composed, so every session opened with "No briefing has been composed yet" even after days of use. Your memories were still saved, and recall still found them. Every Claude Code install now sets the same 9,000-byte limit the terminal install always set. An install made before this, without the setting, now uses 9,000 too, without any action from you; your configuration file is not changed. The first session after upgrading may still open on that line: the wake is composed when that session ends. `counterparts doctor`'s Config line says which limit is in use and whether it is the default.
121
+
3
122
  ## 0.3.19 — 2026-10-12
4
123
 
5
124
  Reminders now arrive. A reminder due today stays under "Arriving:" in the wake all day, the near ones come first when a session starts, a reminder is no longer counted as told to a message nobody typed (an agent's hand-back or a task notification), and a memory that reads like a reminder but has no date now says so. Counterparts also reads far less of Claude Code's own files: the nightly run no longer scans `~/.claude/projects`, and the wake-arrival check is off unless you ask for it, which is what the plugin directory asked for. Underneath: the core can change (a kept promise can retire, a declared change moves it in about three days), the night folds memories that belong together and writes up everything it was owed, cards for people and projects are born at last, and the biggest source files are split so the plugin bundle fits the directory's file limit. No store-format change (store v13, cache v6), so there is no migration, and nothing to run after upgrading from 0.3.18.
package/README.md CHANGED
@@ -11,7 +11,7 @@ its memories itself, and they fade and grow the way yours do. It runs today with
11
11
  ## Install
12
12
 
13
13
  You need [bun](https://bun.sh) 1.3 or newer, or [Node](https://nodejs.org) 22.15 or newer.
14
- macOS and Linux.
14
+ macOS and Linux; Windows not yet supported.
15
15
 
16
16
  ```
17
17
  curl -fsSL https://bun.sh/install | bash # if you don't have bun
@@ -40,8 +40,8 @@ to be deleted. The full walkthrough is in [`docs/QUICKSTART.md`](docs/QUICKSTART
40
40
  learned, in its own words. Notes, not transcripts.
41
41
  - **It forgets on purpose.** Memories fade unless they come up again. What matters
42
42
  sticks; the rest lets go.
43
- - **It knows who it has been.** Every session opens with a short "who I am, who you are,
44
- where we left off" that it wrote itself.
43
+ - **It knows who it has been.** After the first few sessions, every session opens with a short "who I am, who you
44
+ are, where we left off" that it wrote itself.
45
45
  - **It keeps a journal.** Each session becomes a chapter in a first-person account of
46
46
  your time together.
47
47
  - **It changes its mind slowly.** What it believes about you shifts only under real
@@ -49,7 +49,10 @@ to be deleted. The full walkthrough is in [`docs/QUICKSTART.md`](docs/QUICKSTART
49
49
  - **Things come to mind.** As you talk, related memories surface quietly, the way one
50
50
  thing reminds you of another.
51
51
  - **It's yours.** Everything lives on your machine in one SQLite file you can read,
52
- export or delete. No API keys, no accounts, nothing sent anywhere.
52
+ export or delete. No API keys, no accounts, nothing sent anywhere. The text of your
53
+ conversations is kept only until it's written up: deleted 3 days after that, never
54
+ kept more than 14 days, and never in a backup. You can delete the conversation text,
55
+ the backups or the activity log on their own at any time (`counterparts delete`).
53
56
 
54
57
  ## Who it's for
55
58
 
@@ -120,6 +123,11 @@ There are no API keys, and nothing leaves your machine except through Claude Cod
120
123
  itself. Search by meaning runs on a small model on your machine, and a session that ends
121
124
  before it's written up is written up by the next session in that project.
122
125
 
126
+ That small model finds close paraphrases ("my doctor" finds a note about a physician), but
127
+ not a description that never names the thing: "a pet that purrs" won't find a note about
128
+ your cat. Exact words are strongest, and a short memory matches better than one padded with
129
+ names and details.
130
+
123
131
  ## Background
124
132
 
125
133
  Counterparts is the third version of a memory project. The earlier ones (claude-engram,
@@ -74,6 +74,12 @@ walk seam (its importers are pinned); each other command family is a `commands-*
74
74
  (every one that reads the zone it sets); the finding's shape and the checkout, open, upgrade,
75
75
  self-page, host, write-up and report groups are `doctor-*.ts` files. A moved class body is a free function taking the
76
76
  instance, behind a one-line delegate on the class (`docs/decisions.d/refactor-file-split.md`).
77
+ `self/briefing.ts` (split 2026-10-12, moves only, past ~100 KB) keeps the lanes, the
78
+ composition and `render`; `briefing-room.ts` holds the room machinery `render` calls
79
+ (`takeRoom`, the rescues, `tellLost`), `briefing-page.ts` the page's block and ladder and
80
+ the room it is sized to, and `briefing-delivery.ts` the sentinel reader, the preface and
81
+ the splices. `briefing.ts` re-exports every public name, so no import changed; the parts'
82
+ importers are pinned (`split-parts.test.ts`).
77
83
 
78
84
  ## Tools (`tools/`)
79
85
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "counterparts",
3
- "version": "0.3.19",
3
+ "version": "0.3.21",
4
4
  "license": "MIT",
5
5
  "description": "Memory that turns AI tools into counterparts - a local-first, human-memory-modeled memory layer for AI.",
6
6
  "repository": {
@@ -21,7 +21,7 @@ where it called its own, in the same order, with the same rows. What stays here
21
21
  host's: the five event names and their dispatch (`hooks.ts`), the payload translation, the
22
22
  JSON envelope and the room it measures (`bin/hook.ts`, `envelope.ts`), the transcript
23
23
  reader and the wake-arrival check against it (`transcript.ts`), the Stop ask's words
24
- (`stopAsk`, `STOP_HUMAN_LINE`), the first-launch question, the parallel run's primacy, the
24
+ (`stopAsk`, `STOP_HUMAN_LINE`), the first-launch question, the
25
25
  update and doctor notices, the dream line and the headless nightly run. The configuration
26
26
  (`AdapterConfig`, `loadConfig`) and the worker spawn (`planSpawn`, `spawnDetached`) moved to
27
27
  the shared leaves `adapters/config.ts` and `adapters/spawn.ts` the same day; `index.ts`
@@ -128,20 +128,21 @@ credential — belongs here, discovered at runtime, never assumed by the core.
128
128
 
129
129
  - **The A/B day-alternating wake mute is gone** — the *day-alternation*, that is. Computing
130
130
  a parity off an anchor date is not a memory property (§1) and no schedule decides who
131
- speaks here. What survives is smaller and temporary: for the **parallel run** beside v1,
132
- a **primacy resolver** (`primacy.ts`) behind the `parallel.enabled` config flag. It reads
133
- v1's own assignment file and lets the delivering hooks speak only when that file names the
134
- slot v2 occupies; it **fails toward mute** where v1 fails toward inject, so the joint
135
- failure state is v1-only rather than two voices or none. Absent flag ⇒ v2 delivers, which
136
- is the ordinary build. The flag, the resolver, and the two durable events were meant to be
137
- **retired at PROMOTE** — they are scaffolding for a comparison, not a feature. The parallel
138
- run ended on 2026-09-21 and nothing retired them: they are **still wired**
139
- (`hooks.ts#deliveryVerdict`, config `parallel`), and inert on every install that does not
140
- set the flag. Removing them is a separate change.
131
+ speaks here. The parallel run beside v1 had a smaller, temporary successor — a primacy
132
+ resolver (`primacy.ts`) behind a `parallel.enabled` config flag that read v1's assignment
133
+ file from the home directory. **Removed 2026-10-12, the parallel run ended 2026-09-21.** A
134
+ configuration that still carries `parallel` is ignored, never refused. The resolver lives
135
+ on only in the maintainer instrument `tools/parallel/primacy.ts`, which is not shipped.
141
136
  - **The 9,000-byte wake budget is not a constant here or anywhere.** The adapter
142
137
  **discovers or asserts** its host's injection ceiling and reports it as a capability;
143
138
  the core composes to whatever it is told (scar §2.18). v1's number was 90% of one host's
144
139
  cliff, encoded as though it were physiology.
140
+ The core still has no default. The adapter's own is `config.ts#CLAUDE_CODE_BUDGET_BYTES`
141
+ (9,000, this host's measured number): every Claude Code install writes it into a new
142
+ configuration, and the hooks, the worker and the night run fill it in for a file with no
143
+ key (`withBudgetDefault`, 2026-10-12), reported as defaulted, never as reported. Claude
144
+ Desktop's server takes no default itself, but the worker it starts is this runner, so a
145
+ keyless store it shares is rendered at 9,000 as well.
145
146
  - **Multi-file API-key rotation and per-key cursor bookkeeping are dropped** — and since
146
147
  2026-09-24 there are no keys at all (§1a), so there is nothing to rotate and no credential
147
148
  source to configure. (Until then credentials came from one configured source the package
@@ -1004,8 +1005,8 @@ session the host's registry knows (one our hooks saw start), so the unbound MCP
1004
1005
  shared `mcp` id is passed by, and only for a person's interactive conversation: a session
1005
1006
  whose host entrypoint (`CLAUDE_CODE_ENTRYPOINT`, kept on the registry record) says
1006
1007
  `claude -p`, the Agent SDK, `mcp` or a GitHub action owes no short write-up (N2). It is
1007
- not a retention debt (text ages out with its week; a written-up one keeps it up to 7 days
1008
- after the write-up, like a full debt) and not in doctor's awaiting count. The headless
1008
+ not a retention debt (text ages out on the retention clock; a written-up one keeps it up to 3
1009
+ days after the write-up, like a full debt, and never past the 14-day ceiling) and not in doctor's awaiting count. The headless
1009
1010
  nightly run's child and an observer capture nothing, so they owe nothing. When a pointer
1010
1011
  defers for room, its record names what else rode beside the wake, and doctor's advice
1011
1012
  names that rather than the wake's budget (M3).
@@ -2560,3 +2560,32 @@ words are said.
2560
2560
 
2561
2561
  **The wake-arrival check is opt-in** (`COUNTERPARTS_WAKE_CHECK=1`). Off, `checkWakeArrival` returns
2562
2562
  before the registry read; doctor's Wake line, with no arrival rows, names the opt-in.
2563
+
2564
+ ## 2026-10-12 — who was told at 00:19: the night run's children were not
2565
+
2566
+ The 0.3.19 release check reported a fresh SessionStart at 00:19 telling a plain reminder, and the night
2567
+ run's own `claude -p` children were the suspects. Read from the host's transcripts (no store opened):
2568
+
2569
+ - The sessions that started at 00:19:49 and 00:22:17 local on 10-12 were under
2570
+ `~/.claude/projects/<the store directory's slug>/`, cwd the store, entrypoint `sdk-cli`. These were the
2571
+ dream child and the reflection child. Neither holds a plain-reminder line or a `systemMessage`.
2572
+ - A `claude -p` probe on 2.1.296 (user hooks off, empty strict MCP config, the parent's `ATTENDED=1`) printed
2573
+ `CLAUDE_CODE_ENTRYPOINT=sdk-cli`, `CLAUDE_CODE_SESSION_ATTENDED=0`, `COUNTERPARTS_NIGHT_RUN=<run>`. The host
2574
+ resets both of its own flags for a child, and the run's marker passes through.
2575
+ - The one reminder injected at 00:19 was a `UserPromptSubmit` (00:19:49.18) in the coordinator's open `cli`
2576
+ session, on an "Another Claude session sent a message: … [Subagent hand-back]" turn. Its system message also
2577
+ carried the dream and share lines, and it started the night run (first child +0.6 s). That was on 0.3.18,
2578
+ before #445's `startedByHost`.
2579
+ - What was still open: a `SessionStart:compact` inside an Agent-tool subagent (10-10, `cli`) was handed a full
2580
+ wake, and the night child's prompt recall handed the day's reminders as "Quietly available" lines and spent their
2581
+ fires. Both are closed by `watchedAtStart` and `noCues` (docs/decisions.d/fix-start-told-unwatched-1012.md).
2582
+
2583
+ ## 2026-10-12 — the primacy read removed
2584
+
2585
+ Removed 2026-10-12, the parallel run ended 2026-09-21. `primacy.ts` read v1's A/B assignment file in the home directory
2586
+ behind `parallel.enabled`, which install never set; a plugin-directory pre-flight flagged it as a read
2587
+ outside the disclosed files. The hooks no longer ask who delivers, `loadConfig` no longer reads
2588
+ `parallel` (an old key, in any shape, is ignored rather than taking the config to observer), and the
2589
+ resolver moved to `tools/parallel/primacy.ts` for the instrument that still reads old run directories.
2590
+ The `adapter.primacy.*` event names stay in core and the dashboard so a store's old rows still read.
2591
+ Earlier entries above that mention primacy describe the code as it was then.
@@ -43,7 +43,7 @@ import { canonicalScope, isEntrypoint, readSession } from "../../sessions.js";
43
43
  import { openLog } from "../../log/index.js";
44
44
  import type { LogEvent, ProcessLog } from "../../log/index.js";
45
45
  import { resolveZone, todayIn } from "../../../core/time.js";
46
- import { TUNABLES, loadConfig, withEmbedderDefault } from "../../config.js";
46
+ import { TUNABLES, loadConfig, withBudgetDefault, withEmbedderDefault } from "../../config.js";
47
47
  import type { AdapterConfig } from "../../config.js";
48
48
  import { HOOKS, openAdapter } from "../index.js";
49
49
  import { STOP_HUMAN_LINE, plainLine, withoutDream, withoutDreamNote, withoutPlain } from "../hooks.js";
@@ -71,9 +71,11 @@ import {
71
71
  firstRunNoticePath,
72
72
  hookGate,
73
73
  installRoute,
74
+ markTwiceSaid,
74
75
  pluginOrigin,
75
76
  runningAsPlugin,
76
77
  takeFirstRunNotice,
78
+ twiceNoticePath,
77
79
  } from "../../plugin.js";
78
80
  import { claimDelivery, deliveryClaimKey, finishClaim, firesOnce } from "../claim.js";
79
81
 
@@ -200,9 +202,11 @@ export function hostConfig(
200
202
  // stood down because we did not" — the difference matters only for a config
201
203
  // somebody NAMED (`namedUnreadableRefusal`).
202
204
  // THE EMBEDDER DEFAULT (config.ts#resolveEmbedder): an absent block is the
203
- // local table.
205
+ // local table. THE CEILING DEFAULT (`config.ts#withBudgetDefault`): a file
206
+ // with no `injectionBudgetBytes` wakes under Claude Code's 9,000 rather than
207
+ // on the bootstrap line for good.
204
208
  return {
205
- config: withEmbedderDefault({ ...loaded, dataDir: loaded.dataDir ?? dataDir() }),
209
+ config: withBudgetDefault(withEmbedderDefault({ ...loaded, dataDir: loaded.dataDir ?? dataDir() })),
206
210
  reason: load.reason,
207
211
  };
208
212
  }
@@ -706,7 +710,11 @@ async function main(): Promise<void> {
706
710
  // it was installed: a first run the plugin made beside it is not this
707
711
  // hook's to announce, now or after a later move to the plugin.
708
712
  takeFirstRunNotice(firstRunNoticePath(choice.path));
709
- if (gate.line !== null) process.stdout.write(JSON.stringify({ systemMessage: gate.line }));
713
+ // Said at the first session start that finds both, then not again
714
+ // (`plugin.ts#twiceNoticePath`).
715
+ if (gate.line !== null && markTwiceSaid(twiceNoticePath(choice.path, process.env))) {
716
+ process.stdout.write(JSON.stringify({ systemMessage: gate.line }));
717
+ }
710
718
  }
711
719
  return;
712
720
  }
@@ -36,13 +36,15 @@
36
36
  * (`core/coverage/`);
37
37
  * 3c. RAW TRANSCRIPT RETENTION (owner's ruling 2026-09-23): once per date —
38
38
  * behind an `O_EXCL` latch under `spans/retention/` — a session's captured
39
- * text is deleted 7 days after it ended when it owes no write-up and the
40
- * registry does not hold it open (`remember/owes.ts` decides,
39
+ * text is deleted 3 days after it ended when it owes no write-up and the
40
+ * registry does not hold it open, and 14 days after its last activity
41
+ * whatever is true — the configuration's `retention` block may set both
42
+ * (`config.ts#retentionClocks`; `remember/owes.ts` decides,
41
43
  * `remember/retention.ts` deletes, and this file is the only one that may
42
44
  * import the second), and one `remember.prune` row says what was deleted,
43
- * what is waiting on a write-up, what is younger than a week and what is
44
- * still open. Keyless, like every step but the sweep. BEFORE the snapshot on
45
- * purpose: raw text in every backup is the reason it exists;
45
+ * what is waiting on a write-up, what is inside its clock and what is
46
+ * still open. Keyless, like every step but the sweep. (Before the snapshot,
47
+ * which since 2026-10-13 copies no conversation text at all.)
46
48
  * 4. the DAILY ROTATING SNAPSHOT (`adapters/snapshots.ts`), last and outside
47
49
  * the cycle. Last because it copies the state the three steps above just
48
50
  * left; outside because sleep must not learn that the floor is changing —
@@ -69,6 +71,7 @@ import { fileURLToPath } from "node:url";
69
71
 
70
72
  import { Counterpart, RUNNER_FAILED_EVENT } from "../../../core/counterpart.js";
71
73
  import { recordCoverage } from "../../../core/coverage/index.js";
74
+ import { clearIdleCarries } from "../../../core/recall/index.js";
72
75
  import { RETENTION_EVENT, retentionRow, retentionRuns } from "../../../core/remember/index.js";
73
76
  import type { HostSessionEvidence, RetentionReport } from "../../../core/remember/index.js";
74
77
  // THE DELETING HALF, by path, and from this file alone (PR #189 review, B1):
@@ -92,7 +95,7 @@ import {
92
95
  } from "../../config-path.js";
93
96
  import type { ConfigChoice } from "../../config-path.js";
94
97
 
95
- import { loadConfig, withEmbedderDefault } from "../../config.js";
98
+ import { loadConfig, retentionClocks, withBudgetDefault, withEmbedderDefault } from "../../config.js";
96
99
  import type { AdapterConfig } from "../../config.js";
97
100
  import { openEmbedder } from "../index.js";
98
101
  import type { LiveEmbedder } from "../embed-client.js";
@@ -198,6 +201,9 @@ export const retentionHost: (store: Store) => (session: string) => HostSessionEv
198
201
  export function retentionJob(input: {
199
202
  counterpart: Counterpart;
200
203
  date: string;
204
+ /** The configuration's two clocks (`config.ts#retentionClocks`); the
205
+ * defaults when absent. */
206
+ clocks?: { retentionMs: number; maxMs: number };
201
207
  onEvent?: (name: string, data: Record<string, string | number | boolean | null>) => void;
202
208
  }): RetentionJobReport {
203
209
  const { counterpart, date } = input;
@@ -210,7 +216,7 @@ export function retentionJob(input: {
210
216
  // THE SAME SOURCES THE WRITE-UP READS (`sessions.ts#writeUpSources`), so
211
217
  // what this pass keeps as owed and what the next session is asked to write
212
218
  // up are one set, by construction rather than by two copies agreeing.
213
- const sources = writeUpSources(store);
219
+ const sources = writeUpSources(store, input.clocks ?? {});
214
220
  // THE DATE IS VISIBLE FROM THE MOMENT IT IS HELD (re-review R7): a
215
221
  // `STARTED` row goes in as soon as the latch is taken, before anything is
216
222
  // planned, so a run the watchdog kills halfway leaves "started, never
@@ -220,7 +226,7 @@ export function retentionJob(input: {
220
226
  store.appendEvent({
221
227
  name: RETENTION_EVENT,
222
228
  day: store.livedDay(),
223
- payload: retentionRow({ ...EMPTY_RETENTION, reason: "STARTED" }, date),
229
+ payload: retentionRow({ ...EMPTY_RETENTION, reason: "STARTED" }, date, sources),
224
230
  dedupKey: `${RETENTION_EVENT}:${date}:started`,
225
231
  });
226
232
  } catch (err) {
@@ -236,7 +242,7 @@ export function retentionJob(input: {
236
242
  store.appendEvent({
237
243
  name: RETENTION_EVENT,
238
244
  day: store.livedDay(),
239
- payload: retentionRow({ ...EMPTY_RETENTION, reason: "LATCH_HELD" }, date),
245
+ payload: retentionRow({ ...EMPTY_RETENTION, reason: "LATCH_HELD" }, date, sources),
240
246
  dedupKey: `${RETENTION_EVENT}:${date}:held`,
241
247
  });
242
248
  } catch (err) {
@@ -256,7 +262,7 @@ export function retentionJob(input: {
256
262
  store.appendEvent({
257
263
  name: RETENTION_EVENT,
258
264
  day: store.livedDay(),
259
- payload: retentionRow(report, date),
265
+ payload: retentionRow(report, date, sources),
260
266
  dedupKey: `${RETENTION_EVENT}:${date}`,
261
267
  });
262
268
  recorded = true;
@@ -450,17 +456,28 @@ export async function runOnce(input: {
450
456
  emit("coverage.threw", { code: err instanceof Error ? err.name : "UNKNOWN" });
451
457
  }
452
458
  // 3c. RETENTION — on the failed path as well as the good one (a day whose
453
- // sweep broke still ages the week-old text of sessions that owe nothing),
454
- // and BEFORE the copy below, so the day's backup never carries raw text
455
- // past its week. Its own try: a retention pass may not cost the snapshot.
459
+ // sweep broke still ages the text of sessions that owe nothing), with the
460
+ // configuration's clocks. Its own try: a retention pass may not cost the
461
+ // snapshot.
456
462
  try {
457
- retentionReport = retentionJob({ counterpart, date: today, onEvent: emit });
463
+ retentionReport = retentionJob({ counterpart, date: today, clocks: retentionClocks(config), onEvent: emit });
458
464
  if (retentionReport.reason === "failed") {
459
465
  noteFailure(counterpart, emit, retentionReport.code ?? "UNKNOWN", "retention", today);
460
466
  }
461
467
  } catch (err) {
462
468
  emit("retention.threw", { code: err instanceof Error ? err.name : "UNKNOWN" });
463
469
  }
470
+ // 3d. TYPED WORDS LEAVE QUIET SESSIONS (2026-10-13): recall's carried cue
471
+ // tokens are emptied in every session idle past the same ceiling, so a
472
+ // session that ended or was killed does not keep them, and the copy below
473
+ // does not take them. Every run, not once a date: it reads only rows that
474
+ // still carry words. Its own try, like the steps above.
475
+ try {
476
+ const cleared = clearIdleCarries(counterpart.store, retentionClocks(config).maxMs);
477
+ if (cleared > 0) emit("runner.carries", { cleared });
478
+ } catch (err) {
479
+ emit("carries.threw", { code: err instanceof Error ? err.name : "UNKNOWN" });
480
+ }
464
481
  // 4. THE DAY'S COPY OF THE STORE — after everything above has written, on
465
482
  // the failed path as well as the good one, and before the store is closed.
466
483
  // It never throws by construction (`adapters/snapshots.ts`); the try is
@@ -574,13 +591,17 @@ export function runnerConfig(
574
591
  const loaded = loadConfig(raw);
575
592
  const pinned = pinnedDataDir(env);
576
593
  // THE EMBEDDER DEFAULT (config.ts#resolveEmbedder), the same rule the hook
577
- // applies, so the worker backfills with the table the hooks embed with.
594
+ // applies, so the worker backfills with the table the hooks embed with. And
595
+ // the hook's ceiling default (`config.ts#withBudgetDefault`), so the worker
596
+ // and the night run render the wake the session start reads.
578
597
  return {
579
- config: withEmbedderDefault({
580
- ...loaded.config,
581
- // The PIN wins. The spawner wrote it last precisely so nothing else can.
582
- dataDir: pinned ?? loaded.config.dataDir ?? dataDir(),
583
- }),
598
+ config: withBudgetDefault(
599
+ withEmbedderDefault({
600
+ ...loaded.config,
601
+ // The PIN wins. The spawner wrote it last precisely so nothing else can.
602
+ dataDir: pinned ?? loaded.config.dataDir ?? dataDir(),
603
+ }),
604
+ ),
584
605
  reason: loaded.reason,
585
606
  };
586
607
  }