Skip to content

Commit 0ddb443

Browse files
pascalwhoopclaude
andcommitted
fix: discover dot-named Claude project dirs; use uv run in pre-commit hook
Two fixes: 1. _project_dir_matches_repo: Claude CLI encodes project paths by replacing both '/' and '.' with hyphens (e.g. reconnct.us → reconnct-us), but convx only replaced slashes. Sessions in repos with dots in their name (like reconnct.us) were silently skipped (discovered=0). Now also checks encoded.replace('.', '-'). 2. hooks install: generated pre-commit hook now uses `uv run convx sync` instead of bare `convx`, which fails when convx isn't on PATH in the hook shell environment. Also updated the existing hook in this repo. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2c42964 commit 0ddb443

17 files changed

Lines changed: 1327 additions & 21 deletions

File tree

.claude/settings.local.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"permissions": {
33
"allow": [
4-
"WebFetch(domain:registry.npmjs.org)"
4+
"WebFetch(domain:registry.npmjs.org)",
5+
"Bash(uv run:*)"
56
]
67
}
78
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ history/
101101
codex/
102102
macbook-pro/
103103
Code/
104-
everycure/
104+
my-project/
105105
prototypes/
106106
matrix-heatmap-test/
107107
2026-02-15-1155-conversation-backup-plan.md

history/pascal/claude/2026-02-24-1952-can-you-remove-the-reference-sin-the-codebase-etc-to--every/.index.json

Lines changed: 542 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# Conversation be69b3ef-e623-4a5a-8d49-da0c8d66914b
2+
3+
- Source: `claude`
4+
- User: `pascal`
5+
- System: `Pascals-MBP.local`
6+
- Started: `2026-02-24T19:52:44.936Z`
7+
- CWD: `/Users/pascal/Code/business/convx`
8+
9+
## User
10+
11+
_`2026-02-24T19:52:44.936Z`_
12+
13+
[SANITIZED]
14+
15+
## Agent
16+
17+
_`2026-02-24T19:52:57.906Z`_
18+
19+
Here are the references found (excluding history folders):
20+
21+
**README.md**
22+
[SANITIZED]
23+
24+
**tests/test_sanitize.py**
25+
- Lines 19-20, 25-26, 31-32, 43-44, 49, 69, 72: used as the example keyword/text throughout the sanitize tests
26+
27+
The `history/` folder references are in exported session transcripts — I'll skip those per your instructions.
28+
29+
Let me look at those two files and clean them up.
30+
31+
## Agent
32+
33+
_`2026-02-24T19:53:01.400Z`_
34+
35+
Now I'll replace all the references with generic placeholder names:
36+
37+
## Agent
38+
39+
_`2026-02-24T19:53:05.277Z`_
40+
41+
[SANITIZED]
42+
43+
## Agent
44+
45+
_`2026-02-24T19:53:16.326Z`_
46+
47+
Let me verify no references remain outside the history folder:
48+
49+
## Agent
50+
51+
_`2026-02-24T19:53:21.540Z`_
52+
53+
All remaining references are in the `history/` folder only, which you asked to ignore. Done. Here's a summary of what was changed:
54+
55+
[SANITIZED]
56+
57+
[SANITIZED]
58+
59+
## User
60+
61+
_`2026-02-24T19:53:37.380Z`_
62+
63+
what is present in history folder then?
64+
65+
## Agent
66+
67+
_`2026-02-24T19:53:50.156Z`_
68+
69+
82 files total — these are your own exported AI conversation transcripts, organized as:
70+
71+
```
72+
history/
73+
pascal/
74+
claude/ # 28 files — Claude Code sessions (index.md + agent-*.md + .index.json per session)
75+
codex/ # 6 files — Codex sessions (.md + .json pairs)
76+
cursor/ # 48 files — Cursor sessions (.md + hidden .json pairs)
77+
```
78+
79+
[SANITIZED]
80+
81+
[SANITIZED]
82+
83+
## User
84+
85+
_`2026-02-24T19:54:02.068Z`_
86+
87+
I thought the `sanitize` feature should have removed those why didn't it get caught
88+
89+
## Agent
90+
91+
_`2026-02-24T19:54:06.076Z`_
92+
93+
Good question. Let me check if a sanitize config actually exists in this repo and what keywords are in it.
94+
95+
## Agent
96+
97+
_`2026-02-24T19:54:14.072Z`_
98+
99+
So the keywords ARE configured. The issue is almost certainly timing — those sessions were exported *before* `sanitize.toml` was created (or before those keywords were added to it), and the idempotency system skipped re-exporting them on subsequent runs because the source files hadn't changed.
100+
101+
Let me verify by checking the engine's sanitize logic:
102+
103+
## Agent
104+
105+
_`2026-02-24T19:54:22.043Z`_
106+
107+
Confirmed. The flow at line 143 is:
108+
109+
```
110+
if not force_overwrite and prior.get("fingerprint") == fingerprint:
111+
skip ← those old sessions hit this branch
112+
```
113+
114+
The sanitize keywords are only applied during export (lines 175–214). Since those two Cursor sessions were exported before the keywords were added, and their source files haven't changed since, the fingerprint check skips them every time.
115+
116+
The fix is to run with `--overwrite` to force re-export:
117+
118+
```bash
119+
convx sync --overwrite
120+
# or
121+
convx backup --output-path <path> --overwrite
122+
```
123+
124+
That bypasses the fingerprint check and re-runs sanitization on all sessions including the old ones.
125+
126+
## User
127+
128+
_`2026-02-24T19:54:36.495Z`_
129+
130+
can you overwrite run those once for the sync? then check what is still there and manually sed those lines
131+
132+
## Agent
133+
134+
_`2026-02-24T19:55:20.253Z`_
135+
136+
Still 5 matches remaining. The codex session was likely filtered by cwd, and the cursor session may have a bug where the sanitize didn't catch it. Let me read and fix them manually.
137+
138+
## Agent
139+
140+
_`2026-02-24T19:55:30.911Z`_
141+
142+
Now I'll fix them. The `.md` files get line replacements, then the `.json` blobs get sed'd since they're single-line.
143+
144+
## Agent
145+
146+
_`2026-02-24T19:55:39.246Z`_
147+
148+
Now the JSON blobs (single-line files, so use sed):
149+
150+
## Agent
151+
152+
_`2026-02-24T19:55:45.566Z`_
153+
154+
Now verify nothing remains:
155+
156+
## Agent
157+
158+
_`2026-02-24T19:55:51.256Z`_
159+
160+
Clean. All references are gone from the entire repo.
161+
162+
Now, the reason the `--overwrite` sync didn't catch those two: the codex session was filtered out (its cwd didn't match the convx project directory, so it was never re-processed). The cursor session is a bit more puzzling — it was "updated" but the references survived, which suggests a potential bug worth looking at. Want me to investigate why the sanitize didn't fire on that cursor session?
163+
164+
## User
165+
166+
_`2026-02-24T19:56:11.630Z`_
167+
168+
yeah
169+
170+
## Agent
171+
172+
_`2026-02-24T19:56:52.180Z`_
173+
174+
Now I can see exactly what happened. Let me check what cursor sessions are actually discoverable from source right now:
175+
176+
## Agent
177+
178+
_`2026-02-24T19:57:22.787Z`_
179+
180+
Found the root cause. The index entry has `updated_at: 2026-02-20` — it wasn't touched by the `--overwrite` run at all. The source is a SQLite entry in Cursor's `state.vscdb`:
181+
182+
```
183+
/Users/pascal/Library/Application Support/Cursor/User/globalStorage/state.vscdb::composer::33d69723-0655-4184-ba3b-fc06dd6b6afd
184+
```
185+
186+
Cursor has since deleted that composer session from the DB. So `discover_files` never emits it, `--overwrite` never sees it, and the exported files sit untouched forever.
187+
188+
**The bug:** `--overwrite` is described as "re-export all sessions ignoring cached fingerprints", but it only applies to sessions still discoverable from source. If the source is gone (Cursor purged old composers), the exported artifacts are orphaned and immune to re-sanitization.
189+
190+
The same problem affects the codex session — it was filtered by cwd, not missing from source, but the effect is the same: `--overwrite` can't reach it.
191+
192+
**The fix** would be a second pass in the sync logic (or a separate command like `convx resanitize`) that directly applies `sanitize_lines` to already-exported `.md` and `.json` files — no source needed. It would scan the history directory, run `sanitize_lines` over each file's current content, and write it back. Want me to implement that?

history/pascal/claude/2026-02-28-1751-can-you-find-out-why-the-convx-export-never-exports-anything/.index.json

Lines changed: 284 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Conversation e15ac1ef-1c8d-4284-af0a-53bb51d61175
2+
3+
- Source: `claude`
4+
- User: `pascal`
5+
- System: `Pascals-MBP.local`
6+
- Started: `2026-02-28T17:51:49.116Z`
7+
- CWD: `/Users/pascal/Code/business/convx`
8+
9+
## User
10+
11+
_`2026-02-28T17:51:49.116Z`_
12+
13+
can you find out why the convx export never exports anything in this directory for me RN?
14+
/Users/pascal/Code/business/reconnct.us
15+
16+
## Agent
17+
18+
_`2026-02-28T17:52:03.543Z`_
19+
20+
Now let me check the Claude adapter and look at the `reconnct.us` directory:
21+
22+
## Agent
23+
24+
_`2026-02-28T17:52:11.752Z`_
25+
26+
Good, `reconnct.us` has `.git`. Now let me check what Claude project directory name maps to it:
27+
28+
## Agent
29+
30+
_`2026-02-28T17:52:33.444Z`_
31+
32+
Found it. The issue is clear. Claude encodes the path `/Users/pascal/Code/business/reconnct.us` as `-Users-pascal-Code-business-reconnct-us` (converting `.` to `-`), but `_encode_path` in the adapter only replaces `/` with `-`, leaving the dot as-is. So the match fails.
33+
34+
- Expected encoded name: `-Users-pascal-Code-business-reconnct.us` (what the code produces)
35+
- Actual Claude dir name: `-Users-pascal-Code-business-reconnct-us` (dot replaced with hyphen)
36+
37+
Let me check the tests and then fix it:
38+
39+
## Agent
40+
41+
_`2026-02-28T17:52:44.337Z`_
42+
43+
The bug is in `_project_dir_matches_repo`. Claude's CLI replaces `.` (dot) with `-` when encoding paths for project directory names, but `_encode_path` only replaces `/`. So `reconnct.us` becomes `reconnct.us` in the expected name but `reconnct-us` in the actual directory.
44+
45+
Fix:
46+
47+
## Agent
48+
49+
_`2026-02-28T17:53:11.029Z`_
50+
51+
Now let me add a test for this case:
52+
53+
## Agent
54+
55+
_`2026-02-28T17:53:21.243Z`_
56+
57+
Now I have enough context. Let me add a test for the dot-in-dirname case:

0 commit comments

Comments
 (0)