codegraph icon indicating copy to clipboard operation
codegraph copied to clipboard

Stop hook error: Failed with non-blocking status code: error: unknown command 'sync-if-dirty'

Open gcanosa opened this issue 5 months ago • 3 comments

On Claude Code I am getting this error too often after a plan is applied as last step.

⏺ Ran 2 stop hooks ⎿  codegraph sync-if-dirty ⎿  ${CLAUDE_PLUGIN_ROOT}/scripts/session-stop.sh ⎿  Stop hook error: Failed with non-blocking status code: error: unknown command 'sync-if-dirty'

gcanosa avatar Jun 05 '26 10:06 gcanosa

Fix

treytracedit-lab avatar Jun 05 '26 13:06 treytracedit-lab

This means you are running a newer version of codegraph where 'sync-if-dirty' has been removed. Run codegraph install again to fix it.

zanets avatar Jun 09 '26 16:06 zanets

Thanks for the report — this is fixed, and you can clear it in one step.

What happened: pre-0.8 builds wrote a Stop → codegraph sync-if-dirty hook into Claude Code's settings. That subcommand was later removed, so on newer binaries the leftover hook fires codegraph sync-if-dirty and Commander rejects it with unknown command 'sync-if-dirty' at the end of a turn. The graph itself is fine — it's purely the stale hook entry.

The fix: since v0.9.0 the installer self-heals this — codegraph install surgically strips the stale mark-dirty/sync-if-dirty auto-sync hooks (leaving your other hooks untouched). It just needs to run once on an affected machine.

To clear it now:

codegraph install

(or codegraph upgrade, which also self-heals). After that the Stop hook error is gone.

If it still shows up after re-running codegraph install, please reopen and paste the hooks block from your Claude settings (~/.claude/settings.json or the project .claude/settings.json) so I can see what's referencing it — but in every case we've seen, a single re-install does it.

Closing as resolved by the installer self-heal in v0.9.0 (you're welcome to reopen).

colbymchenry avatar Jun 22 '26 15:06 colbymchenry