Skip to content

Turbocharge Claude Code, Cursor, Codex, Gemini & every coding agent: faster, cheaper, with contextual understanding specific to your codebase.

Merge remote-tracking branch 'origin/main' into fix/consumer-cli-resolution

Shrish Dwivedif6220a2f0873
diff --cc src/claude/hooks.ts
index df868058,1da86cd3..55bfeb85
--- a/src/claude/hooks.ts
+++ b/src/claude/hooks.ts
@@@ -2,9 -2,8 +2,9 @@@ import { readFileSync, existsSync } fro
import { execFileSync, spawn } from 'node:child_process';
import { join, basename } from 'node:path';
import { readWiring } from './stats.js';
- import { formatBlastRadius, formatRetrieval, formatOrientation } from './format.js';
+ import { formatBlastRadius, formatRetrieval, retrievalTokensSaved, formatOrientation } from './format.js';
import { patchStats, readStats, acquireLock, readSession, writeSession } from './state.js';
+import { graftCliPath, claudeScriptPath } from './paths.js';
function readStdin(): any {
const seam = process.env.GRAFT_TEST_STDIN;
@@@ -65,6 -71,11 +65,11 @@@ export async function main(event: strin
}
if (event === 'stop') {
- // Auto-sync needs graft's own build (sync-run.js). Only graft's self-hosted
- // repo has it; in any other repo skip rather than spawn a missing script and
- // get wedged on syncing:true (those repos regen via their own build/CI).
- const syncRun = join(dir, 'dist', 'claude', 'sync-run.js');
++ // sync-run.js ships next to this module inside the package, so it resolves in
++ // any repo that installs graft (not just graft's own). Defensive existsSync:
++ // if the package is somehow incomplete, skip rather than wedge on syncing:true.
++ const syncRun = claudeScriptPath('sync-run.js');
+ if (!existsSync(syncRun)) return;
const stats = readStats(dir);
if (stats?.dirty && acquireLock(dir)) {
patchStats(dir, { syncing: true });