Skip to content

Say in vibe status when desktop tracking is broken, and repair the install on every command - #150

Merged
iamnotstatic merged 7 commits into
mainfrom
iamnotstatic/hook-health
Oct 29, 2026
Merged

iamnotstatic merged 7 commits into
mainfrom
iamnotstatic/hook-health

Conversation

@iamnotstatic

Copy link
Copy Markdown
Owner

Reopened from #148. #148 was merged into its base branch iamnotstatic/safe-hook-writes 14 seconds after that branch had already gone into main, so none of it reached main. This is the same branch with main merged in. It has to land before 0.16.0 is published, because the #149 release notes already describe it.

Merged with main, the full suite passes 228/228. The real ~/.claude, ~/.codex, ~/.cursor and ~/.zcode configs and ~/.zshrc were byte-identical before and after. The server typecheck is clean (no server changes).

Desktop tracking can break with no sign anywhere, because the editor runs the hook and keeps its output. On the maintainer's machine, Codex tracking was off for 8 days because ~/.codex/hooks.json no longer parsed, and nothing said so.

What changes

vibe status now repairs the install first. The repair used to run only at session start and in the terminal wrapper. A desktop-only user whose pinned Node was removed by an nvm upgrade never gets a working session-start hook, so the repair never reached them. vibe status (and bare vibe) is a command they do run.

Then it reports what the repair couldn't fix, one line per app, in the same style as the existing notices:

  ◆ claude code isn't being tracked · ~/.claude/settings.json isn't valid JSON, and the app ignores all of it until it's fixed
  ◆ cursor isn't being tracked · its hooks run ~/.nvm/versions/node/v20.11.0/bin/node, which no longer exists · run vibe hooks install

New src/hook-health.ts checks each app's config (Claude Code, Codex, Cursor, ZCode):

  • Unparseable file. vibe won't overwrite someone's settings file, so the fix is theirs to make, and the line says why it matters.
  • A vibe hook pinned to a Node or cli.js that no longer exists. The repair normally fixes this, so this line only shows when the repair couldn't.

What it doesn't report:

  • Another tool's hooks, even if they point at missing paths.
  • Anything for people who ran vibe uninstall.
  • The missing-path check on Windows, where the command we'd parse isn't the one that runs.

The strings live in render.ts. Each app's config path is now exported so the check reads the same files the installers write.

Verified

  • Rendered vibe status against a fake home seeded with what the maintainer's machine had: a torn Claude settings file and Codex hooks pinned to /old/nvm/node. The Codex hooks were repointed silently, and the Claude file was reported with the line above.
  • test/hook-health.test.mjs:
  • npm test: 206/206, and the real ~/.claude, ~/.codex, ~/.cursor, ~/.zcode configs and ~/.zshrc were byte-identical before and after. Server typecheck clean.

Not covered

ZCode hooks that are installed but switched off in ZCode's settings. ZCode leaves new hooks off until the user turns them on, and tracking is then off just as silently. Reporting it fairly means first knowing that the person actually uses ZCode, so it's left out here.

Also: repair on every command, and off checkouts

  • Every command repairs. vibe log, vibe share and vibe leaderboard now run the install repair too, like vibe status and bare vibe.
  • An installed vibe takes hooks back from a checkout or an npx cache. It does so even while those still run, because a checkout's hooks die with the worktree and an npx cache gets pruned. The maintainer's hooks pointed at an Orca worktree, which is how this was found.
  • "Installed" means the CLI path has node_modules/vibetime-cli/ in it and isn't under _npx/. That covers npm (nvm, Homebrew node, Windows), pnpm, yarn, bun and volta.
  • Never the other way round. A checkout or npx copy never takes hooks, and two installed copies (one per Node under nvm) leave each other's alone, so Codex isn't sent back to review.

test/repair-commands.test.mjs runs real CLI commands from copies of the build laid out the way npm installs them. The three behaviour tests (an installed vibe takes over from a checkout; an installed vibe takes back from npx; log and leaderboard repair) fail without the change. The two guards (a checkout never takes hooks; two installed copies leave each other alone) pass both ways. End to end on the combined release: hooks pinned to a live checkout, then bare vibe from an installed copy. All 19 pinned paths across the four apps moved, with no warnings, and the Codex hook kept its slot. Combined suite with #146, #147 and #149: 228/228.

…stall there too

An app config that no longer parses, or a vibe hook pinned to a Node or CLI
that is gone, turns desktop tracking off with no sign anywhere. vibe status
now runs the install repair first and then names what is still broken and
the one thing to do about it.
One definition of a vibe hook for the installers and the check, so a user's
own command containing __hook is never reported as ours. The test points
VIBE_API at a dead local port rather than the real API.
…nstalled vibe

vibe log, share and leaderboard now run the install repair like status and
bare vibe. A repair run by an installed vibe also takes over hooks pinned to
a git checkout or an npx cache, which die with the worktree or the cache
even while they still run. A checkout or npx copy never takes hooks, and two
installed copies (one per Node under nvm) leave each other's alone.
@iamnotstatic
iamnotstatic merged commit c448bea into main Oct 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant