counterparts 0.3.50 → 0.3.53
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.
- package/CHANGELOG.md +122 -0
- package/README.md +18 -10
- package/docs/QUICKSTART.md +46 -12
- package/docs/manual.md +2 -1
- package/docs/module-map.md +4 -0
- package/package.json +3 -2
- package/src/adapters/claude-code/NOTES.md +43 -0
- package/src/adapters/claude-code/child.ts +23 -2
- package/src/adapters/claude-code/doctor-growth.ts +269 -0
- package/src/adapters/claude-code/doctor-host.ts +19 -1
- package/src/adapters/claude-code/doctor-recall-steps.ts +84 -0
- package/src/adapters/claude-code/doctor.ts +26 -3
- package/src/adapters/claude-code/hooks.ts +7 -1
- package/src/adapters/cli/INTERFACE-GAPS.md +18 -0
- package/src/adapters/cli/NOTES.md +24 -0
- package/src/adapters/cli/commands-dashboard.ts +9 -1
- package/src/adapters/cli/commands-project.ts +2 -1
- package/src/adapters/cli/commands-readings.ts +19 -8
- package/src/adapters/cli/commands-verify.ts +1 -1
- package/src/adapters/cli/commands.ts +4 -2
- package/src/adapters/cli/export.ts +2 -1
- package/src/adapters/cli/install.ts +14 -6
- package/src/adapters/cli/mechanisms.ts +1 -1
- package/src/adapters/cli/wire.ts +22 -6
- package/src/adapters/dashboard/activity.ts +6 -3
- package/src/adapters/dashboard/registries.ts +11 -0
- package/src/adapters/dashboard/web/flow.ts +3 -0
- package/src/adapters/dashboard/web/lanes.ts +4 -0
- package/src/adapters/dashboard/web/narrate.ts +23 -0
- package/src/adapters/dashboard/web/views/activity.ts +4 -2
- package/src/adapters/dashboard/web/views/flow-view.ts +6 -0
- package/src/adapters/dashboard/web/views/memory.ts +13 -0
- package/src/adapters/dashboard/web/views/shared.ts +2 -1
- package/src/adapters/fired.ts +113 -11
- package/src/adapters/host-wiring.ts +3 -1
- package/src/adapters/lifecycle.ts +48 -10
- package/src/adapters/mcp/CONTRACT.md +22 -1
- package/src/adapters/mcp/server-args.ts +51 -0
- package/src/adapters/mcp/server-self-tools.ts +15 -2
- package/src/adapters/mcp/server-session-end.ts +8 -2
- package/src/adapters/mcp/server-words.ts +15 -2
- package/src/adapters/mcp/server.ts +178 -7
- package/src/adapters/mcp/tools.ts +47 -5
- package/src/adapters/plugin.ts +1 -0
- package/src/adapters/presence.ts +74 -0
- package/src/adapters/runtime.ts +258 -8
- package/src/adapters/scopes.ts +3 -2
- package/src/adapters/spawn.ts +3 -0
- package/src/adapters/update-check.ts +1 -1
- package/src/adapters/windows-shims.mjs +102 -0
- package/src/core/close-hint.ts +297 -0
- package/src/core/counterpart-boundary.ts +15 -0
- package/src/core/counterpart-deposit.ts +24 -3
- package/src/core/counterpart-events.ts +14 -0
- package/src/core/counterpart-types.ts +6 -0
- package/src/core/counterpart-wake-shape.ts +865 -56
- package/src/core/counterpart.ts +179 -12
- package/src/core/dream/CONTRACT.md +3 -0
- package/src/core/dream/NOTES.md +9 -0
- package/src/core/dream/index.ts +1 -1
- package/src/core/dream/night-line.ts +11 -2
- package/src/core/dream/reflect.ts +92 -37
- package/src/core/encode/NOTES.md +56 -0
- package/src/core/encode/secrets.ts +490 -3
- package/src/core/event-rollup.ts +175 -0
- package/src/core/handoff/CONTRACT.md +10 -1
- package/src/core/handoff/last-exchange.ts +24 -4
- package/src/core/interference.ts +496 -0
- package/src/core/open-close.ts +583 -0
- package/src/core/owner-waits.ts +246 -0
- package/src/core/prospective/CONTRACT.md +24 -0
- package/src/core/prospective/derive.ts +22 -1
- package/src/core/prospective/index.ts +115 -1
- package/src/core/recall/CONTRACT.md +9 -2
- package/src/core/recall/INTERFACE-GAPS.md +6 -0
- package/src/core/recall/NOTES.md +99 -0
- package/src/core/recall/activate.ts +83 -6
- package/src/core/recall/index.ts +80 -5
- package/src/core/recall/probe.ts +134 -0
- package/src/core/recall/steps.ts +86 -0
- package/src/core/recall/tunables.ts +11 -0
- package/src/core/reconsolidation.ts +14 -4
- package/src/core/remember/CONTRACT.md +2 -1
- package/src/core/remember/NOTES.md +15 -0
- package/src/core/remember/spans.ts +44 -6
- package/src/core/self/CONTRACT.md +76 -0
- package/src/core/self/NOTES.md +199 -0
- package/src/core/self/index.ts +105 -5
- package/src/core/self/set-down.ts +774 -0
- package/src/core/self/stories.ts +79 -0
- package/src/core/self/tunables.ts +134 -0
- package/src/core/self/work.ts +9 -5
- package/src/core/self/writer.ts +57 -8
- package/src/core/sleep/CONTRACT.md +36 -2
- package/src/core/sleep/NOTES.md +35 -0
- package/src/core/sleep/close.ts +77 -0
- package/src/core/sleep/cycle.ts +44 -0
- package/src/core/sleep/index.ts +4 -0
- package/src/core/sleep/interfere.ts +73 -0
- package/src/core/sleep/log.ts +27 -2
- package/src/core/sleep/tunables.ts +19 -0
- package/src/core/sleep/types.ts +20 -0
- package/src/core/store/index.ts +162 -10
- package/src/core/store/operational.ts +22 -0
- package/src/core/store/owner-op-seam.ts +16 -0
- package/src/core/store/reads-history.ts +173 -7
- package/src/core/store/reads-memories.ts +267 -4
- package/src/core/store/shapes.ts +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,127 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.53 — 2026-11-09
|
|
4
|
+
|
|
5
|
+
**Your page names what it sets down and tells more than corrections; the morning wake reads cleaner; things waiting on you come up when they're relevant, not as a pile.** What you'll notice: the morning after a night's page write, the wake can say "Set down from my page last night: …"; the wake ends with a "Carried forward" line, gives overdue items as a count with the oldest date, and names the session id in its first line; and now and then a line "Waiting on <you>, ask when it fits: …" when something you owe an answer on comes up in the conversation or at the week's session start. The wake changes are in the shaped wake (on for a store created since 0.3.46, or after `counterparts wake-shape on`). `remember` takes `story: true`. 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.52 is a reinstall with no store restore: `counterparts disconnect`, 0.3.52's install, then `counterparts connect`.
|
|
6
|
+
|
|
7
|
+
- **The page says what it sets down.** The self page stays within its room, so each night a new line pushes an old
|
|
8
|
+
one out. Now the night's page writers name the lines they take out, with a short why, and anything taken out
|
|
9
|
+
that wasn't named is recorded anyway; a line only reworded, or folded into a story still on the page, isn't
|
|
10
|
+
counted as gone. Each line set down is kept as a memory, word for word. The next morning's wake names up to two
|
|
11
|
+
("Set down from my page last night: …"), and `recall "set down"` lists them all, newest first, with why and date.
|
|
12
|
+
When life brings one up again (it's used, or a newer memory says it again), the night's writers are shown it and
|
|
13
|
+
may put it back.
|
|
14
|
+
- **The page's stories are about growth, not only corrections.** On a store that keeps its page in its own form
|
|
15
|
+
(`counterparts page-form own`), the night's page writers are told to keep a mix of story kinds (corrections that
|
|
16
|
+
changed how the counterpart works, and also what went right, discoveries, and moments with the owner), and that a
|
|
17
|
+
story earns its place if it would still teach something in a different project. Day's end is shown the day's
|
|
18
|
+
memories about me or us with a small head start over the day's work, so a busy work day doesn't crowd them out.
|
|
19
|
+
A practice on the page that is only about the work may move into a skill memory, which recall brings back when
|
|
20
|
+
the work calls for it; the set-down record names it. On every store, `remember` takes `story: true` to nominate a
|
|
21
|
+
moment as a story: the night's writer sees it first and still decides, and one it passes by fades like any
|
|
22
|
+
other memory.
|
|
23
|
+
- **The wake says what it points at, once.** A reminder told in another session is listed again by title instead of
|
|
24
|
+
"shown earlier", which that session never saw. The night's closing line no longer repeats a sentence the page or
|
|
25
|
+
day's end already says, and the same line on a second morning shrinks to a clause. Overdue items get their own count
|
|
26
|
+
with the oldest date. A handoff waiting on an answer with nothing new sinks below the others, and one more than a week
|
|
27
|
+
old that nothing refers to stops being listed (still under `recall "handoffs"`). Every line under Elsewhere says when.
|
|
28
|
+
"Last said" quotes a whole first sentence when it fits. "Last night" stops saying the run is under way once the
|
|
29
|
+
dream is written up. And the wake's first line names the session id, which the `reflect` tool asks for.
|
|
30
|
+
- **What waits on you comes up when it's relevant, not as a pile.** An item waiting on your answer is no longer one of
|
|
31
|
+
the wake's still-open lines. Instead, when a turn you start touches one, it's raised once after the recall block,
|
|
32
|
+
with what it needs and how long it has waited; and a session's wake says at most one ("Waiting on <you>, ask
|
|
33
|
+
when it fits: …"), the most relevant to the folder's week first, the same item there at most once a week. Each item is raised at most once a lived day across
|
|
34
|
+
every session, then again after 3, 7 and 14 lived days, and then it's parked (still under `recall "still open"`).
|
|
35
|
+
- **"PW" before a version number is no longer read as a password.** 0.3.52's prose-password check redacted the
|
|
36
|
+
version in "PW 1.48" (short for Playwright); a bare Playwright version after "PW" is now left alone, and short
|
|
37
|
+
passwords after "PW" are still redacted. The manual and README say "most passwords" named in a sentence.
|
|
38
|
+
|
|
39
|
+
## 0.3.52 — 2026-11-09
|
|
40
|
+
|
|
41
|
+
**Counterparts now runs on Windows (new: tell us how it goes), and a password said in a sentence is no longer kept.** It also brings memory that fades on purpose as it grows: old per-turn records roll up, older release notes give way to newer ones, finished things stop being overdue, and the night closes items itself. What you'll notice: the morning's "Last night" can say in one line which open items the night closed; doctor has new Growth lines saying what is filling up and whether it leaves as fast, and a Recall steps line saying where recall's time goes; fewer overdue and still-open items at wake. One thing goes for good: the per-turn recall records (`recall.decision`, `recall.credit`, `recall.rated`) are now kept 30 lived days instead of 90, and on the first night after updating, the ones older than that are rolled up into one summary row per day (counts, the memories credited, the sessions) and deleted. If you want them, copy your store before updating. 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.50 needs no store restore: `counterparts disconnect`, 0.3.50's install, then `counterparts connect` (the rows already rolled up stay gone).
|
|
42
|
+
|
|
43
|
+
0.3.51 was packed but never published; everything it held is in this entry.
|
|
44
|
+
|
|
45
|
+
- **Doctor says where recall's time goes.** Each recall now records how long each of its steps took (finding words,
|
|
46
|
+
this turn's meaning, the link walk, ranking, the gate, settled pairs, habituation, the render, and the rest), and
|
|
47
|
+
`counterparts doctor` has a `Recall steps` line with the last week's median for each, largest first. It only
|
|
48
|
+
measures: what recall shows is unchanged, byte for byte.
|
|
49
|
+
- **A password said in a sentence isn't kept.** "My wifi password is …", "the PIN is …", "pw for the router
|
|
50
|
+
is …": the value is replaced with `[REDACTED:password]` and the sentence stays, so the memory still says there is
|
|
51
|
+
one. Ordinary sentences about passwords ("I forgot my password", "the password field is empty") are left alone.
|
|
52
|
+
- **The raw conversation text gets the same stripping.** What's kept of a conversation until it's written up now
|
|
53
|
+
goes through the same check as a memory before it's saved, on your machine and on hosted. Text saved before this
|
|
54
|
+
version isn't rewritten; it's deleted on its usual schedule. Not every secret has a shape: don't paste things you
|
|
55
|
+
wouldn't want kept.
|
|
56
|
+
- **Counterparts runs on Windows.** Install it with npm (`npm install -g counterparts@latest`) and Node 22.15 or newer,
|
|
57
|
+
then `counterparts` and `counterparts connect` as on macOS and Linux, from cmd, Git Bash or PowerShell (where
|
|
58
|
+
Windows' default policy refuses npm's scripts, `counterparts.cmd` works). The hooks `connect` writes run whether
|
|
59
|
+
Claude Code uses Git Bash or PowerShell for them, and the memory tools register with Claude Code installed either
|
|
60
|
+
way (its installer or npm). It's new and has few users yet: tell us how it goes. Under WSL it works as on Linux.
|
|
61
|
+
QUICKSTART's "On Windows" says what differs.
|
|
62
|
+
- **Old routine work notes fade faster once a newer one moves on.** When a newer work memory in the same folder
|
|
63
|
+
says a later version in the same series was released or published ("0.3.50 released"), the night fades the
|
|
64
|
+
older status note ("0.3.46 ready to publish", "0.3.47 after-publish steps") the way a revision does: it
|
|
65
|
+
stays findable by id and in facts (folded under the newer one), labelled earlier, drops out of the wake's
|
|
66
|
+
lines, and can be undone. Only routine notes nobody used: anything the owner said,
|
|
67
|
+
anything felt, anything about the owner, us or me, and open items keep their slow fade.
|
|
68
|
+
- **A done memory is never overdue.** A memory marked `status: done` whose date is today
|
|
69
|
+
or already passed now reads that date as when it happened: it leaves Coming up (due
|
|
70
|
+
today included), the overdue count and the plain-reminder line, older memories
|
|
71
|
+
included. Writing one through `remember` or `session_end` stores the date as
|
|
72
|
+
`occurredOn` and says so beside the memory. A repeating reminder is unchanged: a done
|
|
73
|
+
there still closes only this time.
|
|
74
|
+
- **Old chapters stop turning up as footnotes.** A journal chapter whose last entry is two weeks
|
|
75
|
+
(14 lived days) old or more is no longer offered beside a prompt, so its slot goes to another
|
|
76
|
+
memory. It's all still kept: asking (facts or meaning), opening it by id, the wake and the
|
|
77
|
+
night read it as before.
|
|
78
|
+
- **Doctor says what is growing and whether it leaves as fast.** Five new lines, `Growth:
|
|
79
|
+
memories`, `event log`, `cue pairs` and `dream queue`, plus new and swept edges on the
|
|
80
|
+
`Association` line: how full each is, what came in and what left over the last 7 lived
|
|
81
|
+
days, and which is faster. The memories line also says how many nights the prune takes to
|
|
82
|
+
get round the store, and counts the kinds it never takes (the journal, chapter copies,
|
|
83
|
+
handoffs, cards) apart.
|
|
84
|
+
- **The per-turn event rows are kept 30 lived days, not 90.** `recall.decision`,
|
|
85
|
+
`recall.credit` and `recall.rated` make up most of the event log. Each day of them is
|
|
86
|
+
summed into one kept row before it goes. The all-time numbers read those sums beside
|
|
87
|
+
the rows still kept, so they don't shrink: the dashboard's counts, `counterparts
|
|
88
|
+
mechanisms`, `probe-oq4`, a memory's days used and the sessions seen. Everything else in
|
|
89
|
+
the log keeps 90 lived days. The table of what each recall turn showed goes after 30 too.
|
|
90
|
+
- **The night closes done release steps itself, and stops asking.** When a work memory in a folder says a release
|
|
91
|
+
happened ("0.3.50 released"), the night closes the open items in that folder that were earlier steps of the same
|
|
92
|
+
series ("0.3.46 ready to publish", "0.3.47 after-publish steps", "0.3.48 cut"). Each close is recorded with its
|
|
93
|
+
reason and the memory that showed it, and the next wake says what closed in one line under "Last night". A
|
|
94
|
+
question to the owner is never closed this way. What only might be done (a pinned build whose series moved on, a
|
|
95
|
+
PR a later memory says merged, or what the night's reflection wasn't sure of) is no longer asked about in the
|
|
96
|
+
morning share: `recall "still open"` marks it `mayBeDone`. Say one isn't done and it reopens (the reflect tool's
|
|
97
|
+
`reopen`, or a write that updates it and says it's still open).
|
|
98
|
+
- **A reminder to do something in one folder is said in that folder.** A plain reminder written as another folder's
|
|
99
|
+
work no longer shows whole in this folder's wake, above it, or in the terminal line: it waits for its own folder
|
|
100
|
+
(and any folder joined to it as one project), whose first wake that day says it whole, even when another folder
|
|
101
|
+
woke first. Elsewhere, "in other folders" names it by folder and title (up to two, when there's room) and
|
|
102
|
+
`recall "coming up"` lists it. Reminders about you, us or me still show in every folder, once, then fold to
|
|
103
|
+
"shown earlier". A claude.ai chat, which has no folder, is told only those personal ones.
|
|
104
|
+
- **A deadline in a folder you didn't open still reaches you.** A folder's reminder that went unsaid because no
|
|
105
|
+
session ran there is said once, two days you used Counterparts after its day, in whatever session you're in,
|
|
106
|
+
with its folder named ("garden: send the invoice, due Wed 4 Nov 2026"). It never interrupts a prompt, and
|
|
107
|
+
checks you set for yourself wait for their folder.
|
|
108
|
+
- **Doctor tells a quiet folder from a missed reminder.** A reminder due while its folder had no session is an info
|
|
109
|
+
line, not a warning; it's a warning only if it still wasn't said after that one crossing.
|
|
110
|
+
- **An open thread marked "world" stays in its folder.** Something the world owes (a reply, a dated check) is in the
|
|
111
|
+
Still open of the folder it was written in, not every folder's. So is a dated item marked world.
|
|
112
|
+
- **A write names the open items it looks like it settles, from any folder.** When a
|
|
113
|
+
memory you write through `remember` or `session_end` says something was done ("0.3.47
|
|
114
|
+
published", "#760 merged"), the result lists up to three open items whose subject it
|
|
115
|
+
matches, wherever they were written, with their folder, and asks you to close any that
|
|
116
|
+
really are settled (`updates` + `unresolved: false`). Nothing is closed on its own. An
|
|
117
|
+
item that was a question to the owner says that only their answer closes it.
|
|
118
|
+
- **The remember tool no longer promises mood-matched recall.** Its feelings text said a
|
|
119
|
+
memory's mood would help find it again; mood has carried no weight in recall since October,
|
|
120
|
+
so the promise is gone.
|
|
121
|
+
- **Hosted: a command-line step exits only after its output is written.** Under bun, the
|
|
122
|
+
operator's commands (`migrate-keys` and the rest) could exit before what they printed
|
|
123
|
+
reached a pipe, a Railway log included; they now wait for it (five seconds at most).
|
|
124
|
+
|
|
3
125
|
## 0.3.50 — 2026-11-06
|
|
4
126
|
|
|
5
127
|
**Write-only backups for hosted: a leaked environment can no longer open a backup.** This release changes only hosted Counterparts (app.counterparts.ai). Its backup keys used to be openable with a key kept in the server's environment; now the server keeps that key on its own disk and puts each backup key in the bucket sealed to a recovery key whose private half is kept offline, so the server can write those keys and never read them back. For every store made from now on, the environment and a copy of the bucket together open nothing. The stores that already existed before the operator's one-time migration keep their keys, so a copy of the bucket taken before it, together with the old environment key, still opens their backups; that is accepted for those stores only, and is why the migration runs before anyone outside the family is invited. The npm package, Claude Code and Claude Desktop behave exactly as in 0.3.49. No store-format change (store v15, cache v7), no migration on your machine. Nothing to run after upgrading beyond the usual restart of the dashboard and every Claude Code session. Going back to 0.3.49 needs no store restore: `counterparts disconnect`, 0.3.49's install, then `counterparts connect`.
|
package/README.md
CHANGED
|
@@ -13,13 +13,15 @@ stop re-explaining your projects and how you like to work.
|
|
|
13
13
|
|
|
14
14
|
It's for anyone who works with Claude Code every day and wishes it remembered, and for people
|
|
15
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
|
|
16
|
+
with Claude Code on macOS, Linux and Windows, and with Claude Desktop on macOS.
|
|
17
17
|
|
|
18
18
|
## Install
|
|
19
19
|
|
|
20
20
|
You need [Node](https://nodejs.org) 22.15 or newer, or [bun](https://bun.sh) 1.3 or newer,
|
|
21
|
-
on macOS
|
|
22
|
-
and Linux (since 0.3.11) pass a smoke test and an install run but have no
|
|
21
|
+
on macOS, Linux and Windows (Windows is new: tell us how it goes). Bun on macOS is the setup
|
|
22
|
+
in daily use; Node and Linux (since 0.3.11) pass a smoke test and an install run but have no
|
|
23
|
+
daily user yet. On Windows, install with npm, from PowerShell, cmd or Git Bash; what differs
|
|
24
|
+
there is in [QUICKSTART](docs/QUICKSTART.md#on-windows). Under WSL it works as on Linux.
|
|
23
25
|
|
|
24
26
|
```
|
|
25
27
|
npm install -g counterparts@latest
|
|
@@ -29,14 +31,15 @@ counterparts
|
|
|
29
31
|
With bun instead: `bun add -g counterparts`, then `counterparts`. Whichever runtime runs the
|
|
30
32
|
setup is the one Claude Code's hooks and memory tools are wired to. Or install it as a Claude
|
|
31
33
|
Code plugin: `/plugin marketplace add mlapeter/counterparts`, then
|
|
32
|
-
`/plugin install counterparts@counterparts`, then restart Claude Code.
|
|
34
|
+
`/plugin install counterparts@counterparts`, then restart Claude Code. The plugin sets
|
|
35
|
+
itself up on its first session, with no terminal step; `/counterparts:doctor` checks it.
|
|
33
36
|
|
|
34
|
-
|
|
35
|
-
Claude Code. Connecting adds hooks to `~/.claude/settings.json` (it backs
|
|
36
|
-
registers the memory tools, and adds one `deniedMcpServers` entry there
|
|
37
|
-
Counterparts Online connector never loads into Claude Code as a second memory.
|
|
38
|
-
settings from other tools are left alone. No API keys and no
|
|
39
|
-
|
|
37
|
+
With npm or bun, the first run asks two things, and you can skip either: your name, and
|
|
38
|
+
whether to connect Claude Code. Connecting adds hooks to `~/.claude/settings.json` (it backs
|
|
39
|
+
the file up first), registers the memory tools, and adds one `deniedMcpServers` entry there
|
|
40
|
+
so the hosted Counterparts Online connector never loads into Claude Code as a second memory.
|
|
41
|
+
Hooks and settings from other tools are left alone. No API keys and no account. Then restart
|
|
42
|
+
Claude Code and check it:
|
|
40
43
|
|
|
41
44
|
```
|
|
42
45
|
counterparts doctor
|
|
@@ -66,6 +69,11 @@ walkthrough is in [`docs/QUICKSTART.md`](docs/QUICKSTART.md).
|
|
|
66
69
|
- The text of a conversation is kept only until it's written up: since 0.3.21 it is deleted
|
|
67
70
|
3 days after that, or about two weeks after the conversation goes quiet, whichever comes
|
|
68
71
|
first, the next time Counterparts runs. It is never in a backup.
|
|
72
|
+
- What's stripped before anything is kept, in the memories and in that conversation text:
|
|
73
|
+
credentials in recognisable shapes (API keys, tokens, private keys, passwords in URLs, a
|
|
74
|
+
value after a name like `password=` or `api_key:`), and most passwords named in a sentence
|
|
75
|
+
("my wifi password is …", "the PIN is …"): the value goes, the sentence stays. Not every
|
|
76
|
+
secret has a shape, so don't paste things you wouldn't want kept.
|
|
69
77
|
- It doesn't read or change your CLAUDE.md files or Claude Code's own auto memory
|
|
70
78
|
(MEMORY.md), so they run side by side. A committed CLAUDE.md stays the place for rules
|
|
71
79
|
your team shares through git.
|
package/docs/QUICKSTART.md
CHANGED
|
@@ -2,20 +2,54 @@
|
|
|
2
2
|
|
|
3
3
|
## Install
|
|
4
4
|
|
|
5
|
-
You need [
|
|
6
|
-
on macOS
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
You need [Node](https://nodejs.org) 22.15 or newer, or [bun](https://bun.sh) 1.3 or newer,
|
|
6
|
+
on macOS, Linux and Windows (Windows is new: tell us how it goes). Bun on macOS is the setup
|
|
7
|
+
in daily use; Node, Linux and Windows pass a smoke test and an install run but have no daily
|
|
8
|
+
user yet. On Windows, read [On Windows](#on-windows) below first.
|
|
9
9
|
|
|
10
10
|
```
|
|
11
|
-
|
|
12
|
-
# then open a new terminal
|
|
13
|
-
bun add -g counterparts
|
|
11
|
+
npm install -g counterparts@latest
|
|
14
12
|
counterparts --version
|
|
15
13
|
```
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
`
|
|
15
|
+
Keep the `@latest`: a bare `npm install` can fetch an older version. With bun instead:
|
|
16
|
+
`bun add -g counterparts`; the rest is the same. Whichever runtime runs the setup is the one
|
|
17
|
+
Claude Code's hooks and memory tools are wired to.
|
|
18
|
+
|
|
19
|
+
If `counterparts --version` says `command not found`, your global bin folder isn't on your
|
|
20
|
+
PATH: for npm, add the folder `npm prefix -g` prints, plus `/bin`; for bun, add
|
|
21
|
+
`export PATH="$HOME/.bun/bin:$PATH"` to your shell profile.
|
|
22
|
+
|
|
23
|
+
Or install it as a Claude Code plugin: `/plugin marketplace add mlapeter/counterparts`, then
|
|
24
|
+
`/plugin install counterparts@counterparts`, then restart Claude Code. The plugin sets
|
|
25
|
+
itself up on its first session and puts no `counterparts` command on your PATH:
|
|
26
|
+
`/counterparts:doctor` checks it, and the rest of this page is for the npm or bun install.
|
|
27
|
+
|
|
28
|
+
### On Windows
|
|
29
|
+
|
|
30
|
+
Windows is new, and has few users yet: if something here goes wrong, tell us
|
|
31
|
+
([issues](https://github.com/mlapeter/counterparts/issues)). What differs from macOS and Linux:
|
|
32
|
+
|
|
33
|
+
- Install with **npm and Node** 22.15 or newer, from PowerShell, cmd or Git Bash. The commands on
|
|
34
|
+
this page are the same in all three.
|
|
35
|
+
- Your memory lives in `%USERPROFILE%\.counterparts\`, and `counterparts connect` writes to
|
|
36
|
+
`%USERPROFILE%\.claude\settings.json` and `%USERPROFILE%\.claude.json`, where Claude Code
|
|
37
|
+
keeps them on Windows.
|
|
38
|
+
- Claude Code runs the hooks in Git Bash when Git for Windows is installed, and in PowerShell
|
|
39
|
+
when it isn't. Both work. The hooks name `node` by name, so keep the Node you installed
|
|
40
|
+
with on your PATH; run `counterparts connect` again after moving to another Node.
|
|
41
|
+
- If PowerShell says running scripts is disabled on this system (Windows' default, and it
|
|
42
|
+
says the same for `npm`), type `counterparts.cmd` in place of `counterparts`, use cmd or
|
|
43
|
+
Git Bash, or allow scripts for your account once:
|
|
44
|
+
`Set-ExecutionPolicy -Scope CurrentUser RemoteSigned`. The hooks don't need this: they
|
|
45
|
+
start `node` itself.
|
|
46
|
+
- npm makes `counterparts` work in PowerShell and cmd with a small step that runs after the
|
|
47
|
+
install. If you install with `--ignore-scripts`, that step doesn't run, and the command
|
|
48
|
+
works only from Git Bash: run `npm install -g counterparts@latest` again without it.
|
|
49
|
+
- `counterparts uninstall` and `start-fresh` can't see which Counterparts processes are still
|
|
50
|
+
running on Windows: quit Claude Code first.
|
|
51
|
+
- In WSL, Counterparts works as it does on Linux: install it inside WSL, and run Claude Code
|
|
52
|
+
there too.
|
|
19
53
|
|
|
20
54
|
## Set it up
|
|
21
55
|
|
|
@@ -114,11 +148,11 @@ command opens an encrypted export yet: the README written beside it gives the fo
|
|
|
114
148
|
Close your Claude Code sessions, then:
|
|
115
149
|
|
|
116
150
|
```
|
|
117
|
-
|
|
151
|
+
npm install -g counterparts@latest
|
|
118
152
|
```
|
|
119
153
|
|
|
120
|
-
With
|
|
121
|
-
|
|
154
|
+
With bun, the same step is `bun add -g counterparts@latest`. Keep the `@latest`: a bare
|
|
155
|
+
`npm install` can fetch an older version.
|
|
122
156
|
|
|
123
157
|
Your memory isn't changed by an upgrade. Open sessions keep running the old version until
|
|
124
158
|
they restart.
|
package/docs/manual.md
CHANGED
|
@@ -13,6 +13,7 @@ A memory for an AI, in its own words, not a transcript: it writes with `remember
|
|
|
13
13
|
- Each session opens with a wake: who I am (the self page), where the work stands, what's coming up and still open, how yesterday went.
|
|
14
14
|
- In Claude Code, related memories come up as footnotes as the conversation goes. `recall` is the deliberate look, everywhere.
|
|
15
15
|
- It's theirs to see, export and delete. [local] It is one SQLite file on their computer, and Counterparts sends nothing about them anywhere (the details are on counterparts.ai/privacy). [hosted] It lives on Counterparts' server, one store per account; backups that leave the server are encrypted with a key for their account.
|
|
16
|
+
- What's stripped before anything is kept, in memories and in the raw conversation text: credentials in recognisable shapes (keys, tokens, private keys, passwords in URLs, a value written after a name like password= or api_key:), and most passwords named in a sentence ("my wifi password is …", "the PIN is …"), the value only. Not every secret has a shape: don't paste things you wouldn't want kept.
|
|
16
17
|
- A new memory may start with a few starter notes, titled "Told: …". They were given, not lived: they start weak, come after lived memories that match as well, are never part of the self, and can be corrected or let go like any memory.
|
|
17
18
|
|
|
18
19
|
## Everyday phrases
|
|
@@ -99,7 +100,7 @@ If something seems off (no wake, no night), check before guessing: `status`, and
|
|
|
99
100
|
- 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?".
|
|
100
101
|
- [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.
|
|
101
102
|
- [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
|
|
103
|
+
- [local] It runs on macOS, Linux and Windows (Windows is new: tell us how it goes). Bun on macOS is the setup in daily use; Node (22.15+), Linux and Windows pass a smoke test but have no daily user yet. On Windows it's installed with npm and Node; memory lives in the .counterparts folder in your user folder; Claude Code runs the hooks in Git Bash when Git for Windows is installed and in PowerShell when it isn't, and both work; quit Claude Code before uninstalling or starting fresh, which can't see running processes there. In WSL it works as on Linux. The sidebar mod hasn't been tried on Windows yet.
|
|
103
104
|
- [local] A plugin install has no counterparts command in the terminal: the person uses /counterparts:doctor, /counterparts:dashboard and /counterparts:uninstall instead.
|
|
104
105
|
- [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.
|
|
105
106
|
- [hosted] The account page lists the connected AIs, with when each was last used, and disconnects one.
|
package/docs/module-map.md
CHANGED
|
@@ -27,6 +27,10 @@ code and the `NOTES.md` / `INTERFACE-GAPS.md` next to it.*
|
|
|
27
27
|
| `dream/` | sleep replay + REM | Dreaming: once a day, if the owner says yes, a background agent (the same model) replays what was lived since the last dream beside what it resembles — merges, links, replays, a pattern, a flagged contradiction, a softened feeling, a core nomination — each recorded for undo, with a dream journal kept apart from lived memory — never a memory row, but since 2026-10-27 (D1) recalled by what it was about, labelled `[dream]`; an ordinary question stops reaching it unless it is recalled or retold (`recalled.ts`). The module holds the bookkeeping and the rules; the dreamer is the model. **Added 2026-09-26.** Since 2026-09-27 it also holds REFLECTION (`reflect.ts`), the waking self: usually right after a dream, lived, with its own record — an entry, the self page rewritten from the core, a morning share, feelings recorded later, and what a memory is about. |
|
|
28
28
|
| `fit/` | working memory's pointers | Fitting what a mechanism has into the room it has: a line for everything, the whole text for the most important, ids and a named lookup for the rest, a count of what waits. Plus `lineOf`, `derivedFrom`, parts, and the lookup ledger that measures whether receivers use the lookup. First users: the dream and the reflection. **Added 2026-09-28 (build B).** |
|
|
29
29
|
| *(`reconsolidation.ts`)* | reconsolidation + interference | Two memories that disagree: flagged (a dream, today), noticed at write time (the nearest few live memories come back with a stored one), and SETTLED — `changed` (both true at their time: one strength cut, labelled earlier), `corrected` (archived, readable by id), or `open` (both kept, shown together) — by a new memory's `updates` + `how`, a `remember` settle, a dream or reflection with a plain reason, or the owner's `counterparts settle`. Every settle is on a trail (who, how, why, when) and can be undone. A file beside `revision.ts`, whose ordinary-memory arm it is; its tables are the store's (schema v10), its labels recall's (`recall/standing.ts`). **Added 2026-09-29** as `contradictions.ts`; **renamed 2026-10-11** (Group 2: noticing and updating are one process; the tables keep their names). |
|
|
30
|
+
| *(`interference.ts`)* | interference (retroactive, for routine work) | A newer routine work event fades the older one on the same subject: each night (the cycle's `interfere` phase) an unsalient, never-used `about: work` status note naming a version in its headline is settled `changed` (×0.5) under the nearest later state in the same folder, through `reconsolidation.ts#supersede` (source `interference`, reason `superseded-by-newer`). Nothing the owner said, nothing felt, nothing open. Counted beside the prune on the `sleep.cycle` row. **Added 2026-11-07** (FD1 step 3). |
|
|
31
|
+
| *(`close-hint.ts`)* | — (a write's hint, not a mechanism) | When a stored `remember` or `session_end` entry says something was done, the open items from any folder whose subject it matches (the same version series, the same PR, or what their `settlesWhen` names) are listed in its result, at most three, for the writing model to close or leave. Nothing closes here. Counted as `open.close-hint.shown` / `open.close-hint.closed`. **Added 2026-11-07** (SO1 step 1b). |
|
|
32
|
+
| *(`owner-waits.ts`)* | — (the wake's backoff for what waits on the owner) | An open memory marked `asked`, or a handoff WK3 sank, is said at most once per wake as "Waiting on <owner>, ask when it fits", the most relevant to the folder's week first, in an attended session, and after the recall block on a person's turn that touches it; each raise is latched once per item per lived day, then it waits 3/7/14 lived days (at session start at least a week) and parks, still listed under `recall "still open"`. Meta `wake.owner.raised`, event `open.owner.raised`. **Added 2026-11-09** (SO1 step 4). |
|
|
33
|
+
| *(`open-close.ts`)* | — (closing what is done) | The night closes an open item a later release shows done: each night (the cycle's `close` phase) an open release step ("0.3.46 ready") in a folder closes when a later memory there says a higher patch of the series was released — `closeThread`'s write with `threadClosedBy` and a `thread.night.closed` row. Never a question to the owner, a check, or one the owner reopened. What might be done is listed `mayBeDone` under `recall "still open"`; the reflect tool's `reopen` puts one back. **Added 2026-11-07** (SO1 step 1). |
|
|
30
34
|
| *(`time.ts`)* | — (a clock, not a memory) | The one module that converts: a moment (UTC ms from `store.now()`) to a person's local date or clock line, "today" in a zone, and calendar dates as said (day, month, year, range). A file, not a module; a test keeps hand-built dates out of `src/`. **Added 2026-09-25 (`docs/time.md`).** |
|
|
31
35
|
| *(`feelings-wheel.ts`)* | — (a vocabulary) | The feelings wheel as a typed list: seven cores (happy, warm, calm, curious, sad, uneasy, angry), the groups and their words, default valence and intensity on every entry, blends, aliases, and the rule that re-filed the first wheel's feelings (v11). Read by `store/` to validate the `feelings` table. **Added 2026-09-25; v2 2026-09-30.** |
|
|
32
36
|
| *(`leaving.ts`)* | — (a table) | What counts as having left: every `archived_reason` the code writes, filed `replaced` (a live row carries it — a revision, a merge, a rebuilt journal copy), `let-go` or `removed`. The `status` census and the dashboard's archive words both read it, so they agree. **Added 2026-09-30.** |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "counterparts",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.53",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Long-term memory for Claude Code, written by Claude itself. Local MCP server and hooks; remembers you across sessions.",
|
|
6
6
|
"repository": {
|
|
@@ -88,6 +88,7 @@
|
|
|
88
88
|
"scripts": {
|
|
89
89
|
"test": "bun test",
|
|
90
90
|
"typecheck": "tsc --noEmit",
|
|
91
|
-
"test:node": "node --import ./src/adapters/node-hooks.mjs --test test/node-smoke.ts"
|
|
91
|
+
"test:node": "node --import ./src/adapters/node-hooks.mjs --test test/node-smoke.ts",
|
|
92
|
+
"postinstall": "node src/adapters/windows-shims.mjs || exit 0"
|
|
92
93
|
}
|
|
93
94
|
}
|
|
@@ -2996,3 +2996,46 @@ So the night reads the list (`passesOnNight`), and only the told lines read `ATT
|
|
|
2996
2996
|
none under `auto`, as it already got none under `ask`. An app a person really talks to through the Agent SDK reads as
|
|
2997
2997
|
headless too, unless the host says `ATTENDED=1`. Doctor's `night-headless` line says so after two days without a night; nothing
|
|
2998
2998
|
more was built.
|
|
2999
|
+
|
|
3000
|
+
## 2026-11-09 — Windows: how Claude Code runs our hooks and server there (Windows W1)
|
|
3001
|
+
|
|
3002
|
+
Step 0 of the Windows port, from Claude Code's own docs (code.claude.com/docs/en/hooks, /settings, /mcp-quickstart,
|
|
3003
|
+
/setup, /env-vars, /troubleshoot-install, read 2026-11-09). This is what decides what `connect` writes on win32.
|
|
3004
|
+
|
|
3005
|
+
- **Hooks (shell form, `command` with no `args`)**: "passed to a shell: `sh -c` on macOS and Linux, Git Bash on
|
|
3006
|
+
Windows, or PowerShell when Git Bash isn't installed." Git Bash is found at `C:\Program Files\Git` (or `(x86)`), then
|
|
3007
|
+
`git` on PATH, or named by `CLAUDE_CODE_GIT_BASH_PATH`. A hook may pin `"shell": "bash" | "powershell"`. Exec form
|
|
3008
|
+
(`command` + `args`) spawns with no shell and needs a real `.exe` (npm's `.cmd` shims can't be spawned that way).
|
|
3009
|
+
Git for Windows is OPTIONAL for Claude Code now; without it the Bash tool is PowerShell and so is every hook.
|
|
3010
|
+
- **MCP stdio servers**: started from `command` + `args` in `~/.claude.json`; the docs don't say whether through a shell
|
|
3011
|
+
(they no longer carry the old `cmd /c npx` advice). A real executable with arguments works either way.
|
|
3012
|
+
- **Where the files are**: `~/.claude` is `%USERPROFILE%\.claude`, `~/.claude.json` is `%USERPROFILE%\.claude.json`;
|
|
3013
|
+
`CLAUDE_CONFIG_DIR` moves both, as on macOS.
|
|
3014
|
+
- **`npm install -g`** puts three launchers per bin in `%APPDATA%\npm`: `x.cmd`, `x.ps1` and an extensionless sh script
|
|
3015
|
+
for Git Bash. npm writes them from the bin's FIRST LINE (`cmd-shim`), which for ours is `#!/bin/sh`, so the `.cmd` and
|
|
3016
|
+
`.ps1` ran `/bin/sh`, which cmd and PowerShell can't find (`src/adapters/windows-shims.mjs` now rewrites them to
|
|
3017
|
+
`node`; see `cli/NOTES.md`). The sh script works in Git Bash.
|
|
3018
|
+
|
|
3019
|
+
So the hook line has to run in BOTH Git Bash and PowerShell, and must not depend on our npm shims. What `connect` writes
|
|
3020
|
+
on win32 (`runtime.ts#hostInvocation`): `node --import "file:///C:/…/node-hooks.mjs" "C:/…/claude-code/bin/hook.ts"`.
|
|
3021
|
+
|
|
3022
|
+
- `node` BY NAME, when `node` on PATH resolves (links followed) to the very node running `connect`. The default Node
|
|
3023
|
+
is in `C:\Program Files\nodejs`, which needs quotes, and PowerShell needs `&` before a quoted first word, which bash
|
|
3024
|
+
refuses. Scar §2.18 (the host's PATH isn't the login shell's) is a macOS hazard; on Windows the host inherits the
|
|
3025
|
+
account's PATH. When `node` is another file (Volta's or nvm-windows' shim, another Node; W1 review), the path is
|
|
3026
|
+
written for the shell present (`runtime.ts#windowsHookWord`): unquoted when it has no space (both shells run it),
|
|
3027
|
+
quoted with Git Bash present, `& "…"` without it (`shellTokens` reads the `&` away). The last two run in that one
|
|
3028
|
+
shell only, so `connect` warns and doctor's Runtime line is amber: installing or removing Git for Windows later
|
|
3029
|
+
stops every hook until `connect` runs again.
|
|
3030
|
+
- `--import` as a `file:` URL: Node reads `C:\…\node-hooks.mjs` as a URL whose scheme is `c:`.
|
|
3031
|
+
- `/` in every path: no backslash for either shell to read as an escape, and Windows takes them.
|
|
3032
|
+
- The MCP registration is the same words as `command` + `args`: `node`, `--import`, the URL, `C:/…/serve.ts`.
|
|
3033
|
+
- POSIX lines are byte-for-byte what they were (`test/windows-port.test.ts` holds both).
|
|
3034
|
+
|
|
3035
|
+
Also on Windows: a detached child gets its own console window unless `windowsHide` (the worker, the night, its `claude
|
|
3036
|
+
-p`, the dashboard's opener, the plugin's first run); there are no process groups, so the night's watchdog ends its
|
|
3037
|
+
child with `taskkill /T /F`; and the night's `claude` may be npm's `claude.cmd`, which `runtime.ts#windowsLaunch` reads
|
|
3038
|
+
for its target (an `.exe`, or a `.js` given to `node`) rather than running it through cmd with the night's JSON and
|
|
3039
|
+
prompt as arguments. Proven in CI by `.github/workflows/windows.yml` (`tools/door/npm-door.mjs`), which installs Claude
|
|
3040
|
+
Code from npm so `claude` is the `.cmd`; a full night needs a Claude login a runner doesn't have, so the door checks the
|
|
3041
|
+
night starts and reaches `claude -p`.
|
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
* and never in `argv`, and the child's environment is the caller's to scrub
|
|
15
15
|
* (`night-run.ts#planNightChild`).
|
|
16
16
|
*/
|
|
17
|
-
import { spawn } from "node:child_process";
|
|
17
|
+
import { spawn, spawnSync } from "node:child_process";
|
|
18
18
|
|
|
19
19
|
import { withHostUmask } from "../private-umask.js";
|
|
20
|
+
import { windowsLaunch } from "../runtime.js";
|
|
20
21
|
import { armAwake } from "./awake.js";
|
|
21
22
|
import type { AwakeOptions } from "./awake.js";
|
|
22
23
|
|
|
@@ -132,13 +133,23 @@ export async function startChild(plan: ChildPlan, abort?: AbortSignal, awake?: A
|
|
|
132
133
|
try {
|
|
133
134
|
// Under the umask this process was started with (`private-umask.ts`):
|
|
134
135
|
// the child is another program, writing its own files.
|
|
135
|
-
|
|
136
|
+
// On Windows the host CLI may be npm's `claude.cmd`, which Node will not
|
|
137
|
+
// start without a shell: its target is read out of it (`runtime.ts#
|
|
138
|
+
// windowsLaunch`, W1). A name that does not resolve is spawned as given
|
|
139
|
+
// and fails as it always would have, by `error`.
|
|
140
|
+
const how =
|
|
141
|
+
process.platform === "win32"
|
|
142
|
+
? (windowsLaunch(plan.command, plan.args, plan.env) ?? { file: plan.command, args: [...plan.args] })
|
|
143
|
+
: { file: plan.command, args: [...plan.args] };
|
|
144
|
+
child = withHostUmask(() => spawn(how.file, how.args, {
|
|
136
145
|
// DETACHED ONLY SO THERE IS A PROCESS GROUP TO KILL. The caller still
|
|
137
146
|
// awaits this child — `unref` is deliberately not called — so a child
|
|
138
147
|
// whose outcome nobody can record is still impossible. What `detached`
|
|
139
148
|
// buys is that a host CLI which spawned helpers of its own cannot
|
|
140
149
|
// survive in them after the watchdog fires.
|
|
141
150
|
detached: true,
|
|
151
|
+
// No console window of its own on Windows (W1).
|
|
152
|
+
windowsHide: true,
|
|
142
153
|
// THE PROMPT GOES ON STDIN, not in `argv`: what a child is handed in a
|
|
143
154
|
// command line is readable by every process on the machine through
|
|
144
155
|
// `ps` (S2 review, NIT-2). `claude -p` with no positional prompt reads
|
|
@@ -260,6 +271,16 @@ function arm(fn: () => void, ms: number): ReturnType<typeof setTimeout> {
|
|
|
260
271
|
* otherwise survive in them.
|
|
261
272
|
*/
|
|
262
273
|
function signal(child: { pid?: number | undefined; kill: (s: NodeJS.Signals) => boolean }, sig: NodeJS.Signals): void {
|
|
274
|
+
// Windows has no process groups and no signals: `taskkill /T /F` ends the
|
|
275
|
+
// child and every process it started, which is what the group kill is for
|
|
276
|
+
// (W1). Both steps end it there; the second finds it gone.
|
|
277
|
+
if (process.platform === "win32" && child.pid !== undefined) {
|
|
278
|
+
try {
|
|
279
|
+
spawnSync("taskkill", ["/pid", String(child.pid), "/T", "/F"], { stdio: "ignore", windowsHide: true });
|
|
280
|
+
} catch {
|
|
281
|
+
/* no taskkill — the child alone, below */
|
|
282
|
+
}
|
|
283
|
+
}
|
|
263
284
|
try {
|
|
264
285
|
if (child.pid !== undefined) process.kill(-child.pid, sig);
|
|
265
286
|
} catch {
|