claude-code-sessions 0.16.1__tar.gz → 0.16.2__tar.gz
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.
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/PKG-INFO +25 -13
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/README.md +25 -13
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/claude_code_sessions.egg-info/PKG-INFO +25 -13
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/claude_code_sessions.py +40 -25
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/claude_code_sessions_gui.py +10 -9
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_anonymize.py +7 -7
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_plan_move.py +63 -6
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_recover.py +413 -400
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_undo.py +312 -298
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/LICENSE +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/claude_code_sessions.egg-info/SOURCES.txt +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/claude_code_sessions.egg-info/dependency_links.txt +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/claude_code_sessions.egg-info/entry_points.txt +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/claude_code_sessions.egg-info/top_level.txt +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/pyproject.toml +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/setup.cfg +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_alignment.py +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_cli.py +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_commands.py +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_containment.py +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_converge.py +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_discovery.py +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_duplicate_transcripts.py +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_encoding.py +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_engine.py +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_golden.py +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_gui_models.py +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_helpers.py +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_journal.py +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_retitle.py +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_rows.py +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_scaffold.py +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_sync.py +0 -0
- {claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/tests/test_transcripts.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: claude-code-sessions
|
|
3
|
-
Version: 0.16.
|
|
3
|
+
Version: 0.16.2
|
|
4
4
|
Summary: Unofficial tool for Claude Code sessions on disk: make a session visible under your other Claude account on the same machine, or move one between project folders. Command line or GUI. Journaled, reversible, fails closed.
|
|
5
5
|
Author: Craig Stoller
|
|
6
6
|
License: MIT
|
|
@@ -124,13 +124,14 @@ of the standard library, but packaged separately on some Linux distributions
|
|
|
124
124
|
replaces the old "Claude session sync" shortcut with the new name; a taskbar pin to the
|
|
125
125
|
old name is yours to re-pin.
|
|
126
126
|
|
|
127
|
-
## Optional: let
|
|
127
|
+
## Optional: let the browser stay open
|
|
128
128
|
|
|
129
|
-
The desktop app ships a helper for its
|
|
130
|
-
guard counts it and you have to close
|
|
131
|
-
excluded - but **the helper auto-updates every few days**
|
|
132
|
-
measured), and each update correctly fails closed, so the
|
|
133
|
-
be closed again until someone re-runs the ~12-minute
|
|
129
|
+
The desktop app ships a helper for its browser extension that Chrome or Edge launches and
|
|
130
|
+
that can outlive the app, so the guard counts it and you have to close that browser too. A
|
|
131
|
+
measured build of that helper is excluded - but **the helper auto-updates every few days**
|
|
132
|
+
(three builds in eight days, as measured), and each update correctly fails closed, so the
|
|
133
|
+
exclusion lapses and the browser has to be closed again until someone re-runs the ~12-minute
|
|
134
|
+
measurement in
|
|
134
135
|
`tools/native-host-measurement/`.
|
|
135
136
|
|
|
136
137
|
If that trade isn't worth it to you, there is an opt-in: trust **any** helper at the app's
|
|
@@ -142,7 +143,7 @@ claude-code-sessions trust-signed-helper --on # enable it
|
|
|
142
143
|
claude-code-sessions trust-signed-helper --off # back to the default
|
|
143
144
|
```
|
|
144
145
|
|
|
145
|
-
In the window it is the **"Let
|
|
146
|
+
In the window it is the **"Let browsers stay open"** checkbox, which explains the trade before
|
|
146
147
|
enabling anything. Either way it is one marker file - `~/.claude-code-journal/trust-signed-helper` -
|
|
147
148
|
so deleting that file also revokes it.
|
|
148
149
|
|
|
@@ -175,9 +176,10 @@ files agree - or, if you know which account the desktop app is signed into, asse
|
|
|
175
176
|
full). Signing into the desktop app does **not** refresh `~/.claude.json`. A refused
|
|
176
177
|
`sync --apply` (desktop app running) refuses **before anything is journaled** - no lock file,
|
|
177
178
|
no op directory - so there's nothing left behind for `doctor` to flag or `recover` to clean up;
|
|
178
|
-
just close the app and re-run. One measured wrinkle: the desktop ships a helper for its
|
|
179
|
-
extension (`chrome-native-host.exe`)
|
|
180
|
-
if a refusal names that process, fully exit
|
|
179
|
+
just close the app and re-run. One measured wrinkle: the desktop ships a helper for its browser
|
|
180
|
+
extension (`chrome-native-host.exe`), launched by Chrome or Edge, that can outlive the app
|
|
181
|
+
itself, and the guard counts it - if a refusal names that process, fully exit that browser too
|
|
182
|
+
(the refusal always names what it saw).
|
|
181
183
|
|
|
182
184
|
## Usage
|
|
183
185
|
|
|
@@ -192,7 +194,7 @@ alone cannot tell you which copy answered:
|
|
|
192
194
|
```
|
|
193
195
|
$ ccs --version
|
|
194
196
|
claude-code-sessions 0.10.0
|
|
195
|
-
running from: C:\Users
|
|
197
|
+
running from: C:\Users\<name>\AppData\Local\pipx\...\claude_code_sessions.py
|
|
196
198
|
```
|
|
197
199
|
|
|
198
200
|
**`list`** - inventory sessions, optionally filtered by a search term:
|
|
@@ -264,7 +266,7 @@ at. The app must be closed either way, and `undo` puts the old pointer back.
|
|
|
264
266
|
**`new-row`** - create a sidebar row for a conversation that has none:
|
|
265
267
|
|
|
266
268
|
```
|
|
267
|
-
ccs new-row --to
|
|
269
|
+
ccs new-row --to a1b2c3d4-e5f6-4a7b-8c9d-e0f1a2b3c4d5
|
|
268
270
|
```
|
|
269
271
|
|
|
270
272
|
`repoint` moves an existing row and `sync` copies one between accounts; neither can
|
|
@@ -980,6 +982,16 @@ window into `journaled`/`completed`/`rolled_back`.
|
|
|
980
982
|
what a desktop session leaves behind when it enters a second worktree and is later
|
|
981
983
|
resumed in the one its sidebar row remembers: the copy in the second worktree stops
|
|
982
984
|
growing. It was seen twice on one machine in October.
|
|
985
|
+
- **0.16.2 puts the fake cast everywhere, and the helper note on every refusal.** Examples and
|
|
986
|
+
fixtures across the repository, from the README to the tests and the check scripts, now use
|
|
987
|
+
the project's fake cast rather than values read off the maintainer's own machine: account and
|
|
988
|
+
store identifiers, an address, a Windows user path, a sidebar title and a session id. Nothing
|
|
989
|
+
about what the tool reads, writes or refuses changed, and every test still exercises what it
|
|
990
|
+
did. Also, from the browser-helper work: the note that explains a counted helper now appears
|
|
991
|
+
on `move`, `undo` and `recover` refusals, not only on converge and sync; when the signed-helper
|
|
992
|
+
opt-in is on and a helper still counts, the note says why; and the opt-in's wording, in this
|
|
993
|
+
README, the window's checkbox and the command's help, says Chrome or Edge, since either can
|
|
994
|
+
launch the helper. Three constants left unused since the August anti-fabrication fix are gone.
|
|
983
995
|
- Platform rows above move from "unverified" to "verified" as contributors confirm the store
|
|
984
996
|
paths and behavior on their own machines.
|
|
985
997
|
|
|
@@ -94,13 +94,14 @@ of the standard library, but packaged separately on some Linux distributions
|
|
|
94
94
|
replaces the old "Claude session sync" shortcut with the new name; a taskbar pin to the
|
|
95
95
|
old name is yours to re-pin.
|
|
96
96
|
|
|
97
|
-
## Optional: let
|
|
98
|
-
|
|
99
|
-
The desktop app ships a helper for its
|
|
100
|
-
guard counts it and you have to close
|
|
101
|
-
excluded - but **the helper auto-updates every few days**
|
|
102
|
-
measured), and each update correctly fails closed, so the
|
|
103
|
-
be closed again until someone re-runs the ~12-minute
|
|
97
|
+
## Optional: let the browser stay open
|
|
98
|
+
|
|
99
|
+
The desktop app ships a helper for its browser extension that Chrome or Edge launches and
|
|
100
|
+
that can outlive the app, so the guard counts it and you have to close that browser too. A
|
|
101
|
+
measured build of that helper is excluded - but **the helper auto-updates every few days**
|
|
102
|
+
(three builds in eight days, as measured), and each update correctly fails closed, so the
|
|
103
|
+
exclusion lapses and the browser has to be closed again until someone re-runs the ~12-minute
|
|
104
|
+
measurement in
|
|
104
105
|
`tools/native-host-measurement/`.
|
|
105
106
|
|
|
106
107
|
If that trade isn't worth it to you, there is an opt-in: trust **any** helper at the app's
|
|
@@ -112,7 +113,7 @@ claude-code-sessions trust-signed-helper --on # enable it
|
|
|
112
113
|
claude-code-sessions trust-signed-helper --off # back to the default
|
|
113
114
|
```
|
|
114
115
|
|
|
115
|
-
In the window it is the **"Let
|
|
116
|
+
In the window it is the **"Let browsers stay open"** checkbox, which explains the trade before
|
|
116
117
|
enabling anything. Either way it is one marker file - `~/.claude-code-journal/trust-signed-helper` -
|
|
117
118
|
so deleting that file also revokes it.
|
|
118
119
|
|
|
@@ -145,9 +146,10 @@ files agree - or, if you know which account the desktop app is signed into, asse
|
|
|
145
146
|
full). Signing into the desktop app does **not** refresh `~/.claude.json`. A refused
|
|
146
147
|
`sync --apply` (desktop app running) refuses **before anything is journaled** - no lock file,
|
|
147
148
|
no op directory - so there's nothing left behind for `doctor` to flag or `recover` to clean up;
|
|
148
|
-
just close the app and re-run. One measured wrinkle: the desktop ships a helper for its
|
|
149
|
-
extension (`chrome-native-host.exe`)
|
|
150
|
-
if a refusal names that process, fully exit
|
|
149
|
+
just close the app and re-run. One measured wrinkle: the desktop ships a helper for its browser
|
|
150
|
+
extension (`chrome-native-host.exe`), launched by Chrome or Edge, that can outlive the app
|
|
151
|
+
itself, and the guard counts it - if a refusal names that process, fully exit that browser too
|
|
152
|
+
(the refusal always names what it saw).
|
|
151
153
|
|
|
152
154
|
## Usage
|
|
153
155
|
|
|
@@ -162,7 +164,7 @@ alone cannot tell you which copy answered:
|
|
|
162
164
|
```
|
|
163
165
|
$ ccs --version
|
|
164
166
|
claude-code-sessions 0.10.0
|
|
165
|
-
running from: C:\Users
|
|
167
|
+
running from: C:\Users\<name>\AppData\Local\pipx\...\claude_code_sessions.py
|
|
166
168
|
```
|
|
167
169
|
|
|
168
170
|
**`list`** - inventory sessions, optionally filtered by a search term:
|
|
@@ -234,7 +236,7 @@ at. The app must be closed either way, and `undo` puts the old pointer back.
|
|
|
234
236
|
**`new-row`** - create a sidebar row for a conversation that has none:
|
|
235
237
|
|
|
236
238
|
```
|
|
237
|
-
ccs new-row --to
|
|
239
|
+
ccs new-row --to a1b2c3d4-e5f6-4a7b-8c9d-e0f1a2b3c4d5
|
|
238
240
|
```
|
|
239
241
|
|
|
240
242
|
`repoint` moves an existing row and `sync` copies one between accounts; neither can
|
|
@@ -950,6 +952,16 @@ window into `journaled`/`completed`/`rolled_back`.
|
|
|
950
952
|
what a desktop session leaves behind when it enters a second worktree and is later
|
|
951
953
|
resumed in the one its sidebar row remembers: the copy in the second worktree stops
|
|
952
954
|
growing. It was seen twice on one machine in October.
|
|
955
|
+
- **0.16.2 puts the fake cast everywhere, and the helper note on every refusal.** Examples and
|
|
956
|
+
fixtures across the repository, from the README to the tests and the check scripts, now use
|
|
957
|
+
the project's fake cast rather than values read off the maintainer's own machine: account and
|
|
958
|
+
store identifiers, an address, a Windows user path, a sidebar title and a session id. Nothing
|
|
959
|
+
about what the tool reads, writes or refuses changed, and every test still exercises what it
|
|
960
|
+
did. Also, from the browser-helper work: the note that explains a counted helper now appears
|
|
961
|
+
on `move`, `undo` and `recover` refusals, not only on converge and sync; when the signed-helper
|
|
962
|
+
opt-in is on and a helper still counts, the note says why; and the opt-in's wording, in this
|
|
963
|
+
README, the window's checkbox and the command's help, says Chrome or Edge, since either can
|
|
964
|
+
launch the helper. Three constants left unused since the August anti-fabrication fix are gone.
|
|
953
965
|
- Platform rows above move from "unverified" to "verified" as contributors confirm the store
|
|
954
966
|
paths and behavior on their own machines.
|
|
955
967
|
|
{claude_code_sessions-0.16.1 → claude_code_sessions-0.16.2}/claude_code_sessions.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: claude-code-sessions
|
|
3
|
-
Version: 0.16.
|
|
3
|
+
Version: 0.16.2
|
|
4
4
|
Summary: Unofficial tool for Claude Code sessions on disk: make a session visible under your other Claude account on the same machine, or move one between project folders. Command line or GUI. Journaled, reversible, fails closed.
|
|
5
5
|
Author: Craig Stoller
|
|
6
6
|
License: MIT
|
|
@@ -124,13 +124,14 @@ of the standard library, but packaged separately on some Linux distributions
|
|
|
124
124
|
replaces the old "Claude session sync" shortcut with the new name; a taskbar pin to the
|
|
125
125
|
old name is yours to re-pin.
|
|
126
126
|
|
|
127
|
-
## Optional: let
|
|
127
|
+
## Optional: let the browser stay open
|
|
128
128
|
|
|
129
|
-
The desktop app ships a helper for its
|
|
130
|
-
guard counts it and you have to close
|
|
131
|
-
excluded - but **the helper auto-updates every few days**
|
|
132
|
-
measured), and each update correctly fails closed, so the
|
|
133
|
-
be closed again until someone re-runs the ~12-minute
|
|
129
|
+
The desktop app ships a helper for its browser extension that Chrome or Edge launches and
|
|
130
|
+
that can outlive the app, so the guard counts it and you have to close that browser too. A
|
|
131
|
+
measured build of that helper is excluded - but **the helper auto-updates every few days**
|
|
132
|
+
(three builds in eight days, as measured), and each update correctly fails closed, so the
|
|
133
|
+
exclusion lapses and the browser has to be closed again until someone re-runs the ~12-minute
|
|
134
|
+
measurement in
|
|
134
135
|
`tools/native-host-measurement/`.
|
|
135
136
|
|
|
136
137
|
If that trade isn't worth it to you, there is an opt-in: trust **any** helper at the app's
|
|
@@ -142,7 +143,7 @@ claude-code-sessions trust-signed-helper --on # enable it
|
|
|
142
143
|
claude-code-sessions trust-signed-helper --off # back to the default
|
|
143
144
|
```
|
|
144
145
|
|
|
145
|
-
In the window it is the **"Let
|
|
146
|
+
In the window it is the **"Let browsers stay open"** checkbox, which explains the trade before
|
|
146
147
|
enabling anything. Either way it is one marker file - `~/.claude-code-journal/trust-signed-helper` -
|
|
147
148
|
so deleting that file also revokes it.
|
|
148
149
|
|
|
@@ -175,9 +176,10 @@ files agree - or, if you know which account the desktop app is signed into, asse
|
|
|
175
176
|
full). Signing into the desktop app does **not** refresh `~/.claude.json`. A refused
|
|
176
177
|
`sync --apply` (desktop app running) refuses **before anything is journaled** - no lock file,
|
|
177
178
|
no op directory - so there's nothing left behind for `doctor` to flag or `recover` to clean up;
|
|
178
|
-
just close the app and re-run. One measured wrinkle: the desktop ships a helper for its
|
|
179
|
-
extension (`chrome-native-host.exe`)
|
|
180
|
-
if a refusal names that process, fully exit
|
|
179
|
+
just close the app and re-run. One measured wrinkle: the desktop ships a helper for its browser
|
|
180
|
+
extension (`chrome-native-host.exe`), launched by Chrome or Edge, that can outlive the app
|
|
181
|
+
itself, and the guard counts it - if a refusal names that process, fully exit that browser too
|
|
182
|
+
(the refusal always names what it saw).
|
|
181
183
|
|
|
182
184
|
## Usage
|
|
183
185
|
|
|
@@ -192,7 +194,7 @@ alone cannot tell you which copy answered:
|
|
|
192
194
|
```
|
|
193
195
|
$ ccs --version
|
|
194
196
|
claude-code-sessions 0.10.0
|
|
195
|
-
running from: C:\Users
|
|
197
|
+
running from: C:\Users\<name>\AppData\Local\pipx\...\claude_code_sessions.py
|
|
196
198
|
```
|
|
197
199
|
|
|
198
200
|
**`list`** - inventory sessions, optionally filtered by a search term:
|
|
@@ -264,7 +266,7 @@ at. The app must be closed either way, and `undo` puts the old pointer back.
|
|
|
264
266
|
**`new-row`** - create a sidebar row for a conversation that has none:
|
|
265
267
|
|
|
266
268
|
```
|
|
267
|
-
ccs new-row --to
|
|
269
|
+
ccs new-row --to a1b2c3d4-e5f6-4a7b-8c9d-e0f1a2b3c4d5
|
|
268
270
|
```
|
|
269
271
|
|
|
270
272
|
`repoint` moves an existing row and `sync` copies one between accounts; neither can
|
|
@@ -980,6 +982,16 @@ window into `journaled`/`completed`/`rolled_back`.
|
|
|
980
982
|
what a desktop session leaves behind when it enters a second worktree and is later
|
|
981
983
|
resumed in the one its sidebar row remembers: the copy in the second worktree stops
|
|
982
984
|
growing. It was seen twice on one machine in October.
|
|
985
|
+
- **0.16.2 puts the fake cast everywhere, and the helper note on every refusal.** Examples and
|
|
986
|
+
fixtures across the repository, from the README to the tests and the check scripts, now use
|
|
987
|
+
the project's fake cast rather than values read off the maintainer's own machine: account and
|
|
988
|
+
store identifiers, an address, a Windows user path, a sidebar title and a session id. Nothing
|
|
989
|
+
about what the tool reads, writes or refuses changed, and every test still exercises what it
|
|
990
|
+
did. Also, from the browser-helper work: the note that explains a counted helper now appears
|
|
991
|
+
on `move`, `undo` and `recover` refusals, not only on converge and sync; when the signed-helper
|
|
992
|
+
opt-in is on and a helper still counts, the note says why; and the opt-in's wording, in this
|
|
993
|
+
README, the window's checkbox and the command's help, says Chrome or Edge, since either can
|
|
994
|
+
launch the helper. Three constants left unused since the August anti-fabrication fix are gone.
|
|
983
995
|
- Platform rows above move from "unverified" to "verified" as contributors confirm the store
|
|
984
996
|
paths and behavior on their own machines.
|
|
985
997
|
|
|
@@ -22,7 +22,7 @@ import sys
|
|
|
22
22
|
# only answer worth printing. A hardcoded duplicate in pyproject could disagree
|
|
23
23
|
# with the module after a partial bump, and the disagreement would surface as a
|
|
24
24
|
# user reporting a bug against a version they were not running.
|
|
25
|
-
__version__ = "0.16.
|
|
25
|
+
__version__ = "0.16.2"
|
|
26
26
|
|
|
27
27
|
SCHEME_CURRENT = r"[^A-Za-z0-9]" # app >= ~2026-07-12: underscores also become '-'
|
|
28
28
|
SCHEME_LEGACY = r"[^A-Za-z0-9_]" # before: underscores survived
|
|
@@ -868,17 +868,15 @@ def _is_cli_process(text):
|
|
|
868
868
|
# host, and why it still counts" and its 2026-08-07 amendment - including the
|
|
869
869
|
# standing caveat that this is ONE clean trial.
|
|
870
870
|
#
|
|
871
|
-
# The binding is the
|
|
872
|
-
# because the helper auto-updates
|
|
873
|
-
# investigation (744187C7... -> 711AD7E7...,
|
|
874
|
-
# path-only exclusion would therefore silently
|
|
875
|
-
# measured. On any mismatch - different hash,
|
|
876
|
-
#
|
|
877
|
-
# case is the previous behaviour and never
|
|
871
|
+
# The binding is the helper's location derived from the store roots (see
|
|
872
|
+
# _expected_helper_paths) AND the binary's hash, because the helper auto-updates
|
|
873
|
+
# in place: it changed under this very investigation (744187C7... -> 711AD7E7...,
|
|
874
|
+
# same path, same byte length). A path-only exclusion would therefore silently
|
|
875
|
+
# inherit trust for code nobody measured. On any mismatch - different hash,
|
|
876
|
+
# unreadable file, a path that is not the derived location - the helper COUNTS
|
|
877
|
+
# exactly as it did before, so the worst case is the previous behaviour and never
|
|
878
|
+
# worse.
|
|
878
879
|
_HELPER_SHA256 = "711ad7e7dec73aa58187479f5f99b13480df93ab1306bd171a61027d84fa81f1"
|
|
879
|
-
_HELPER_PKG_ANCHOR = "\\packages\\claude_"
|
|
880
|
-
_HELPER_DIR_ANCHOR = "\\localcache\\roaming\\claude\\chromenativehost\\"
|
|
881
|
-
_HELPER_EXE = "\\chrome-native-host.exe"
|
|
882
880
|
|
|
883
881
|
|
|
884
882
|
def _expected_helper_paths(env):
|
|
@@ -1135,6 +1133,18 @@ def helper_hash_note(running, env):
|
|
|
1135
1133
|
"default because it rests on evidence you have not examined. Turn "
|
|
1136
1134
|
"it on with:\n"
|
|
1137
1135
|
" claude-code-sessions trust-signed-helper --on")
|
|
1136
|
+
# Note-only, like the rest: claude_running has already decided, and
|
|
1137
|
+
# this line only says why the opt-in did not excuse the helper.
|
|
1138
|
+
elif state == "unreadable":
|
|
1139
|
+
note += (
|
|
1140
|
+
"\nThe signed-helper opt-in is on but did not excuse it: a helper "
|
|
1141
|
+
"that cannot be read never qualifies, because its bytes cannot be "
|
|
1142
|
+
"shown to be the file whose signature was checked.")
|
|
1143
|
+
else:
|
|
1144
|
+
note += (
|
|
1145
|
+
"\nThe signed-helper opt-in is on but did not excuse it: its "
|
|
1146
|
+
"signature was not confirmed as valid and by Anthropic, PBC "
|
|
1147
|
+
"(unsigned, signed by someone else, or the check could not run).")
|
|
1138
1148
|
return note
|
|
1139
1149
|
# Ruled 2026-10-17: the next layout move must announce itself. This only
|
|
1140
1150
|
# advises - the process keeps counting either way.
|
|
@@ -1318,8 +1328,9 @@ def plan_move(env, session_id, target, flags):
|
|
|
1318
1328
|
# 6. guards
|
|
1319
1329
|
running = claude_running(env)
|
|
1320
1330
|
if running:
|
|
1321
|
-
raise Refusal("Claude appears to be running ({0}). Close the app, then retry."
|
|
1322
|
-
.format(", ".join(sorted(set(running))[:3])
|
|
1331
|
+
raise Refusal("Claude appears to be running ({0}). Close the app, then retry.{1}"
|
|
1332
|
+
.format(", ".join(sorted(set(running))[:3]),
|
|
1333
|
+
helper_hash_note(running, env)))
|
|
1323
1334
|
age = env.now() - os.path.getmtime(source)
|
|
1324
1335
|
if age < MTIME_GUARD_SECONDS and not flags.force:
|
|
1325
1336
|
raise Refusal("transcript was written {0:.0f} seconds ago - this session may be "
|
|
@@ -1948,8 +1959,10 @@ def run_undo(env, prior_op):
|
|
|
1948
1959
|
"""
|
|
1949
1960
|
acquire_lock(env, "undo-" + prior_op.manifest["op_id"])
|
|
1950
1961
|
try:
|
|
1951
|
-
|
|
1952
|
-
|
|
1962
|
+
running = claude_running(env)
|
|
1963
|
+
if running:
|
|
1964
|
+
raise Refusal("Claude appears to be running; close the app before undoing.{0}"
|
|
1965
|
+
.format(helper_hash_note(running, env)))
|
|
1953
1966
|
manifest = plan_undo(env, prior_op)
|
|
1954
1967
|
op = new_op(env, manifest)
|
|
1955
1968
|
final = execute_op(env, op)
|
|
@@ -2846,7 +2859,9 @@ def _finish_committed(env, op):
|
|
|
2846
2859
|
running = claude_running(env)
|
|
2847
2860
|
if running:
|
|
2848
2861
|
raise Refusal("cannot finish op {0}: Claude appears to be running ({1}). "
|
|
2849
|
-
"Close it, then retry recover.".format(
|
|
2862
|
+
"Close it, then retry recover.{2}".format(
|
|
2863
|
+
m["op_id"], ", ".join(sorted(set(running))[:3]),
|
|
2864
|
+
helper_hash_note(running, env)))
|
|
2850
2865
|
|
|
2851
2866
|
if m.get("sidecar_source") and os.path.isdir(m["sidecar_source"]):
|
|
2852
2867
|
# I6(b): same C1 guard as execute_op's own commit step - a file
|
|
@@ -2980,8 +2995,8 @@ def _anon_pairs(env):
|
|
|
2980
2995
|
c = (r.cwd or "").strip()
|
|
2981
2996
|
if len(c) >= _ANON_MIN:
|
|
2982
2997
|
# WHOLE paths only. Mapping the basename too seemed thorough and
|
|
2983
|
-
# was actively harmful: "
|
|
2984
|
-
# the line pass rewrote '
|
|
2998
|
+
# was actively harmful: "alice" and "Projects" are basenames, so
|
|
2999
|
+
# the line pass rewrote 'alice@example.com' into nonsense.
|
|
2985
3000
|
# Over-matching corrupts the report; the structured pass below is
|
|
2986
3001
|
# what actually guarantees coverage.
|
|
2987
3002
|
seen.setdefault(c, _anon_label("project", c))
|
|
@@ -3986,7 +4001,7 @@ def cmd_doctor(env, ns):
|
|
|
3986
4001
|
"(op {1}, {2})".format(v["title"], v["op_id"], v["store_label"]))
|
|
3987
4002
|
# say_ids, not say. redact() shortens a uuid-shaped id to eight
|
|
3988
4003
|
# characters, and these lines hand the user a command to type back -
|
|
3989
|
-
# `new-row --to
|
|
4004
|
+
# `new-row --to a1b2c3d4…` is not a command. Same reason the ranked
|
|
3990
4005
|
# orphan block above uses say_ids; this branch was written with say and
|
|
3991
4006
|
# never noticed, because every test id here is 32 digits with no hyphens
|
|
3992
4007
|
# and the uuid pattern does not match one.
|
|
@@ -4187,7 +4202,7 @@ def build_parser():
|
|
|
4187
4202
|
|
|
4188
4203
|
sp = sub.add_parser(
|
|
4189
4204
|
"trust-signed-helper",
|
|
4190
|
-
help="let Chrome stay open by trusting the signed
|
|
4205
|
+
help="let Chrome or Edge stay open by trusting the signed helper (opt-in)")
|
|
4191
4206
|
grp = sp.add_mutually_exclusive_group()
|
|
4192
4207
|
grp.add_argument("--on", action="store_true", help="enable it")
|
|
4193
4208
|
grp.add_argument("--off", action="store_true", help="disable it (the default)")
|
|
@@ -4543,14 +4558,14 @@ def cmd_trust_signed_helper(env, ns):
|
|
|
4543
4558
|
os.makedirs(os.path.dirname(path), exist_ok=True)
|
|
4544
4559
|
with open(path, "w", encoding="utf-8") as fh:
|
|
4545
4560
|
fh.write("Created by 'claude-code-sessions trust-signed-helper --on'.\n"
|
|
4546
|
-
"While this file exists, a Chrome helper at the app's
|
|
4547
|
-
"package path that Windows reports as validly signed by\n"
|
|
4561
|
+
"While this file exists, a Chrome or Edge helper at the app's\n"
|
|
4562
|
+
"own package path that Windows reports as validly signed by\n"
|
|
4548
4563
|
"Anthropic, PBC does not block mutations, even when its bytes\n"
|
|
4549
4564
|
"are not the build this tool measured. Delete it to revoke.\n"
|
|
4550
4565
|
"See docs/internals.md, RULING 7.\n")
|
|
4551
4566
|
except OSError as exc:
|
|
4552
4567
|
raise Refusal("could not enable it: {0}".format(exc))
|
|
4553
|
-
print("Signed-helper trust is ON. Chrome may stay open; the desktop app "
|
|
4568
|
+
print("Signed-helper trust is ON. Chrome or Edge may stay open; the desktop app "
|
|
4554
4569
|
"still has to be closed.")
|
|
4555
4570
|
print("It is weaker than the default: trust moves from the exact measured "
|
|
4556
4571
|
"bytes to the publisher, so a future Anthropic build that started "
|
|
@@ -4565,7 +4580,7 @@ def cmd_trust_signed_helper(env, ns):
|
|
|
4565
4580
|
except OSError as exc:
|
|
4566
4581
|
raise Refusal("could not disable it: {0}".format(exc))
|
|
4567
4582
|
print("Signed-helper trust is OFF (the default). Only the measured build "
|
|
4568
|
-
"is excluded, so Chrome has to be closed whenever the helper has "
|
|
4583
|
+
"is excluded, so Chrome or Edge has to be closed whenever the helper has "
|
|
4569
4584
|
"updated.")
|
|
4570
4585
|
return 0
|
|
4571
4586
|
on = signed_helper_trust_enabled(env)
|
|
@@ -6656,7 +6671,7 @@ def _placeholder_title(facts):
|
|
|
6656
6671
|
day = time.strftime("%Y-%m-%d", time.gmtime((facts["last_ms"] or 0) / 1000.0))
|
|
6657
6672
|
# Split on BOTH separators, never os.path.basename. The cwd comes out of a
|
|
6658
6673
|
# transcript, not off this filesystem, so a store synced from Windows can
|
|
6659
|
-
# hand a POSIX machine `C:\Users\
|
|
6674
|
+
# hand a POSIX machine `C:\Users\alice\Projects\Personal` - where basename
|
|
6660
6675
|
# finds no `/`, returns the whole string, and the "placeholder" becomes an
|
|
6661
6676
|
# absolute path. The test below pins a Windows cwd precisely so this stays
|
|
6662
6677
|
# correct when the suite runs on macOS or Linux.
|
|
@@ -1418,7 +1418,7 @@ class SyncApp:
|
|
|
1418
1418
|
# the marker file; the shipped default (off) is untouched.
|
|
1419
1419
|
self.trust_var = tk.BooleanVar(value=ccs.signed_helper_trust_enabled(self.env))
|
|
1420
1420
|
self.trust_chk = ttk.Checkbutton(
|
|
1421
|
-
winbar, text="Let
|
|
1421
|
+
winbar, text="Let browsers stay open", variable=self.trust_var,
|
|
1422
1422
|
command=self.on_toggle_trust)
|
|
1423
1423
|
self.trust_chk.pack(side="left", expand=True)
|
|
1424
1424
|
# (window, cancel) of a modal Toplevel of this window's own (the
|
|
@@ -2563,7 +2563,7 @@ class SyncApp:
|
|
|
2563
2563
|
"""(org_token, whole_line) for each candidate in a 'name one with --to'
|
|
2564
2564
|
refusal. Candidate lines look like:
|
|
2565
2565
|
|
|
2566
|
-
|
|
2566
|
+
bbbb2222/dddd4444 (286 rows) ~\\...\\bbbb2222...\\dddd4444...
|
|
2567
2567
|
|
|
2568
2568
|
The whole line becomes the button text, so the row count and any
|
|
2569
2569
|
[shares your signed-in org] tag travel with it - those are exactly what
|
|
@@ -2600,7 +2600,7 @@ class SyncApp:
|
|
|
2600
2600
|
|
|
2601
2601
|
The pair is resolved against the real store list rather than saved as-is,
|
|
2602
2602
|
because BOTH halves are 8-character prefixes and neither is guaranteed
|
|
2603
|
-
unique: saving a bare org id is what broke here - "
|
|
2603
|
+
unique: saving a bare org id is what broke here - "cccc3333" identified
|
|
2604
2604
|
one store until a third account appeared, then matched two and every plan
|
|
2605
2605
|
refused with a disabled Apply and no way forward in the window. A full
|
|
2606
2606
|
path is unique by construction.
|
|
@@ -2666,10 +2666,11 @@ class SyncApp:
|
|
|
2666
2666
|
"""
|
|
2667
2667
|
want = self.trust_var.get()
|
|
2668
2668
|
if want and not messagebox.askokcancel(
|
|
2669
|
-
"Let
|
|
2670
|
-
"The desktop app's
|
|
2671
|
-
"the exact build this tool measured - and it
|
|
2672
|
-
"days, which is why
|
|
2669
|
+
"Let browsers stay open?", default="cancel", message=
|
|
2670
|
+
"The desktop app's browser helper, launched by Chrome or Edge, normally "
|
|
2671
|
+
"blocks writes unless it is the exact build this tool measured - and it "
|
|
2672
|
+
"auto-updates every few days, which is why the browser keeps having to "
|
|
2673
|
+
"be closed.\n\n"
|
|
2673
2674
|
"Turning this on trusts ANY helper at the app's own path that Windows "
|
|
2674
2675
|
"reports as validly signed by Anthropic, PBC.\n\n"
|
|
2675
2676
|
"It is weaker than the default: a future Anthropic build that started "
|
|
@@ -2693,8 +2694,8 @@ class SyncApp:
|
|
|
2693
2694
|
messagebox.showerror("Could not change the setting", str(exc))
|
|
2694
2695
|
actual = ccs.signed_helper_trust_enabled(self.env)
|
|
2695
2696
|
self.trust_var.set(actual)
|
|
2696
|
-
self.status.set("
|
|
2697
|
-
if actual else "
|
|
2697
|
+
self.status.set("Browsers may stay open (the desktop app still cannot)"
|
|
2698
|
+
if actual else "Browsers must be closed again (the default)")
|
|
2698
2699
|
self.detail.set("")
|
|
2699
2700
|
|
|
2700
2701
|
def _clear_filter(self):
|
|
@@ -82,17 +82,17 @@ def test_an_email_is_not_chewed_up_by_path_matching(
|
|
|
82
82
|
"""The second bug.
|
|
83
83
|
|
|
84
84
|
Directory BASENAMES were in the substitution table, so short generic ones
|
|
85
|
-
matched inside unrelated text and rewrote `
|
|
85
|
+
matched inside unrelated text and rewrote `alice@example.com` into
|
|
86
86
|
`<project-b83d>@<project-7aa2>`. Over-matching corrupts the report while
|
|
87
87
|
still looking like it worked.
|
|
88
88
|
"""
|
|
89
89
|
env = mkenv(tmp_path)
|
|
90
|
-
write_transcript(env, "C--Users-
|
|
90
|
+
write_transcript(env, "C--Users-alice-work", "s-1", [{"cwd": "C:\\Users\\alice\\work"}])
|
|
91
91
|
write_row(env, 0, "acct", "org", "local_1",
|
|
92
|
-
{"sessionId": "local_1", "cliSessionId": "s-1", "cwd": "C:\\Users\\
|
|
92
|
+
{"sessionId": "local_1", "cliSessionId": "s-1", "cwd": "C:\\Users\\alice\\work",
|
|
93
93
|
"title": "Something", "lastActivityAt": 9})
|
|
94
94
|
ct._ANONYMIZE = True
|
|
95
|
-
assert ct.anonymize(env, "
|
|
95
|
+
assert ct.anonymize(env, "alice@example.com") == "alice@example.com"
|
|
96
96
|
assert ct.anonymize(env, "the work directory") == "the work directory"
|
|
97
97
|
|
|
98
98
|
|
|
@@ -102,10 +102,10 @@ def test_dict_keys_are_anonymised_not_just_values(mkenv, tmp_path):
|
|
|
102
102
|
values left it in the key, one line below where it had been replaced."""
|
|
103
103
|
env = mkenv(tmp_path)
|
|
104
104
|
ct._ANONYMIZE = True
|
|
105
|
-
rep = {"per_account": {"
|
|
106
|
-
"titles": {"Board complaint finalisation": {"
|
|
105
|
+
rep = {"per_account": {"alice@example.com": 3},
|
|
106
|
+
"titles": {"Board complaint finalisation": {"alice@example.com": ["s-1"]}}}
|
|
107
107
|
out = ct.anonymize_report(env, rep)
|
|
108
|
-
assert "
|
|
108
|
+
assert "alice@example.com" not in json.dumps(out)
|
|
109
109
|
assert list(out["per_account"])[0].startswith("<account-")
|
|
110
110
|
|
|
111
111
|
|
|
@@ -223,6 +223,18 @@ def test_process_guard_ignores_self_and_own_tool(setup):
|
|
|
223
223
|
assert ct.plan_move(env, SID, target, flags())["mode"] == "desktop"
|
|
224
224
|
|
|
225
225
|
|
|
226
|
+
def test_process_guard_refusal_carries_the_helper_note(setup):
|
|
227
|
+
# converge and sync refusals explained a counted helper; move's did not. A
|
|
228
|
+
# helper at a location nothing recognises needs no file on disk, so it is
|
|
229
|
+
# the simplest entry that makes helper_hash_note say something.
|
|
230
|
+
env, t, target = setup
|
|
231
|
+
helper = "c:\\somewhere\\claude-elsewhere\\chrome-native-host.exe"
|
|
232
|
+
env.process_lister = lambda: [(99999, "claude.exe"), (99998, helper)]
|
|
233
|
+
with pytest.raises(ct.Refusal) as exc:
|
|
234
|
+
ct.plan_move(env, SID, target, flags())
|
|
235
|
+
assert "not at a location this version recognises" in str(exc.value)
|
|
236
|
+
|
|
237
|
+
|
|
226
238
|
def test_mtime_guard_force(setup):
|
|
227
239
|
env, t, target = setup
|
|
228
240
|
env.now = lambda: os.path.getmtime(t) + 60 # transcript written 1 min "ago"
|
|
@@ -704,6 +716,51 @@ class TestClaudeRunningNarrowing:
|
|
|
704
716
|
assert "Chrome or Edge" in note
|
|
705
717
|
assert "Closing Chrome" not in note
|
|
706
718
|
|
|
719
|
+
# The opt-in is ON and a recognised helper still counts. The note says why,
|
|
720
|
+
# and only says: claude_running decides exactly as RULINGS 6 and 7 do.
|
|
721
|
+
|
|
722
|
+
@pytest.mark.parametrize("subject", [
|
|
723
|
+
None, # unsigned, or no check
|
|
724
|
+
'CN="Not Anthropic, PBC", O="Not Anthropic, PBC", C=US', # someone else
|
|
725
|
+
])
|
|
726
|
+
def test_opted_in_helper_failing_the_signature_check_is_explained(
|
|
727
|
+
self, mkenv, tmp_path, measured_hash, monkeypatch, subject):
|
|
728
|
+
env = mkenv(tmp_path)
|
|
729
|
+
exe = self._versioned_helper(env, tmp_path, content=b"a-newer-build")
|
|
730
|
+
self._opt_in_and_sign(env, monkeypatch)
|
|
731
|
+
monkeypatch.setattr(ct, "_authenticode_publisher", lambda path: subject)
|
|
732
|
+
env.process_lister = lambda: [(99999, exe)]
|
|
733
|
+
assert ct.claude_running(env) == [exe]
|
|
734
|
+
note = ct.helper_hash_note([exe], env)
|
|
735
|
+
assert "opt-in is on" in note
|
|
736
|
+
assert "signature was not confirmed" in note
|
|
737
|
+
assert "trust-signed-helper --on" not in note
|
|
738
|
+
|
|
739
|
+
def test_opted_in_unreadable_helper_is_explained(
|
|
740
|
+
self, mkenv, tmp_path, measured_hash, monkeypatch):
|
|
741
|
+
env = mkenv(tmp_path)
|
|
742
|
+
root = self._packaged_root(env, tmp_path)
|
|
743
|
+
exe = os.path.join(os.path.dirname(os.path.dirname(root)),
|
|
744
|
+
"Claude-NativeHost", "2.42304.0",
|
|
745
|
+
"chrome-native-host.exe")
|
|
746
|
+
os.makedirs(exe)
|
|
747
|
+
self._opt_in_and_sign(env, monkeypatch)
|
|
748
|
+
env.process_lister = lambda: [(99999, exe)]
|
|
749
|
+
assert ct.claude_running(env) == [exe]
|
|
750
|
+
note = ct.helper_hash_note([exe], env)
|
|
751
|
+
assert "opt-in is on" in note
|
|
752
|
+
assert "never qualifies" in note
|
|
753
|
+
assert "signature was not confirmed" not in note
|
|
754
|
+
assert "trust-signed-helper --on" not in note
|
|
755
|
+
|
|
756
|
+
def test_opted_out_helper_note_does_not_claim_the_opt_in(
|
|
757
|
+
self, mkenv, tmp_path, measured_hash):
|
|
758
|
+
env = mkenv(tmp_path)
|
|
759
|
+
exe = self._versioned_helper(env, tmp_path, content=b"a-newer-build")
|
|
760
|
+
note = ct.helper_hash_note([exe], env)
|
|
761
|
+
assert "trust-signed-helper --on" in note
|
|
762
|
+
assert "opt-in is on" not in note
|
|
763
|
+
|
|
707
764
|
# ------------------------- cross-org tagging in "which store did you mean"
|
|
708
765
|
|
|
709
766
|
def test_cross_org_candidate_is_tagged(self, tmp_path):
|
|
@@ -714,14 +771,14 @@ class TestClaudeRunningNarrowing:
|
|
|
714
771
|
(tmp_path / "a").mkdir()
|
|
715
772
|
(tmp_path / "b").mkdir()
|
|
716
773
|
listing = ct._candidate_listing(
|
|
717
|
-
[("
|
|
718
|
-
("
|
|
719
|
-
live_org="
|
|
774
|
+
[("aaaa1111" + "0" * 24, "dddd4444" + "0" * 24, str(tmp_path / "a")),
|
|
775
|
+
("aaaa1111" + "0" * 24, "cccc3333" + "0" * 24, str(tmp_path / "b"))],
|
|
776
|
+
live_org="dddd4444" + "0" * 24)
|
|
720
777
|
rows = listing.splitlines()
|
|
721
778
|
cross_at = [i for i, l in enumerate(rows)
|
|
722
|
-
if l.startswith("
|
|
779
|
+
if l.startswith(" aaaa1111/dddd4444")]
|
|
723
780
|
own_at = [i for i, l in enumerate(rows)
|
|
724
|
-
if l.startswith("
|
|
781
|
+
if l.startswith(" aaaa1111/cccc3333")]
|
|
725
782
|
assert cross_at and own_at
|
|
726
783
|
# the marker is its own line directly UNDER the cross candidate: a
|
|
727
784
|
# trailing suffix landed past column 155 and wrapped off-screen
|
|
@@ -758,7 +815,7 @@ class TestClaudeRunningNarrowing:
|
|
|
758
815
|
# org to compare against; they must not imply one.
|
|
759
816
|
(tmp_path / "a").mkdir()
|
|
760
817
|
listing = ct._candidate_listing(
|
|
761
|
-
[("
|
|
818
|
+
[("aaaa1111" + "0" * 24, "dddd4444" + "0" * 24, str(tmp_path / "a"))])
|
|
762
819
|
assert "[shares your signed-in org]" not in listing
|
|
763
820
|
|
|
764
821
|
def test_forward_slash_cli_path_is_still_the_cli(self, mkenv, tmp_path):
|