Skip to content

feat(setup): quest setup --worktrees installs the worktree hooks - #565

Merged
kixelated merged 2 commits into
mainfrom
quest/m0/setup-worktree-hooks
Nov 8, 2026
Merged

kixelated merged 2 commits into
mainfrom
quest/m0/setup-worktree-hooks

Conversation

@kixelated

@kixelated kixelated commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

quest setup --worktrees installs Quest's Claude Code worktree hooks with the rest of Quest's user-level hooks; the README's pasted hook JSON is gone. Finishes quest/m0/setup-worktree-hooks.md.

Changes

  • src/cli/hooks.ts: WORKTREE_HOOKS (one entry per HOOK_EVENTS event, running quest worktree hook, SessionEnd with timeout: 60). HookEntry gains command and timeout. Handlers whose command is quest hook or ends in quest worktree hook count as Quest's, so the README's guarded pasted entries get replaced, not duplicated.
  • quest setup: --worktrees adds them, --no-worktrees takes them out, and with neither flag a rerun keeps whatever is installed. --remove takes everything out.
  • README "Claude Code checkouts" and SETUP.md now point at quest setup --worktrees. Dropped the worktree test that ran the README's pasted JSON.

Public API

New flags quest setup --worktrees/--no-worktrees. No breaking change. Existing pasted entries migrate on the next quest setup run.

Choices made without asking

  • The rule hooks and worktree hooks keep separate commands (quest hook / quest worktree hook), each with its own group, instead of one dispatcher. Both handle SessionStart and SubagentStart, but only the worktree handler should run when the user opted in, and keeping the commands separate avoids storing that opt-in anywhere.
  • With no flag, a rerun keeps the current worktree state, so running plain quest setup after an upgrade doesn't silently drop them.
  • fix(hooks): name the launch route when quest is missing from a hook's PATH #544's missing-quest message is now in the README (start Claude with nix develop --command claude, or install quest on that PATH). It is no longer an inline shell guard, so a missing quest shows the shell's quest: command not found.
  • Merging with moq-dev/quest#553: that PR adds rows to HOOKS. This one adds a sibling table plus command/timeout fields, so the conflict should only be textual.

Suggested follow-ups

None.

Models

  • claude-opus-5-5 (Claude Code)

🤖 Generated with Claude Code

(Written by Opus 5.5)

Review

Rewritten by quest review after each round.

  • Reviewer: Codex, gpt-6.1-sol, medium effort
  • Session: 01a1b896-a988-7e43-915b-391bbe020025, round 1
  • Head: c22fa50
  • Base: origin/main at ddcefaa
  • Score: 10/10, No actionable defects were identified in the specified diff; CLI flag parsing was verified, but tests were not run in the read-only environment.
  • Findings: none

@pullfrog

pullfrog Bot commented Nov 8, 2026

Copy link
Copy Markdown

Pullfrog  | Review this ➔

The README's pasted worktree hook JSON is gone. `quest setup --worktrees`
installs WorktreeCreate, WorktreeRemove, SubagentStart, SubagentStop,
SessionStart, and SessionEnd (60s timeout) entries running
`quest worktree hook`, replacing entries pasted from an older README.
A rerun keeps them; --no-worktrees or --remove takes them out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title quest setup installs the worktree hooks feat(setup): quest setup --worktrees installs the worktree hooks Nov 8, 2026
@kixelated
kixelated marked this pull request as ready for review November 8, 2026 00:38
@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 41 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6df59b1b-89b4-4419-93b5-1b368189efd0
Commits

Reviewing files that changed from the base of the PR and between 55070e1 and c22fa50.

Files selected for processing: 7

  • README.md
  • SETUP.md
  • quest/m0/setup-worktree-hooks.md
  • src/cli/hooks.ts
  • src/cli/main.ts
  • test/hooks.test.ts
  • test/worktree.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@kixelated
kixelated added this pull request to the merge queue Nov 8, 2026

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed c22fa50 against base 55070e1.

No actionable findings in the inspected changes. The worktree event table matches the handler's supported events, preserves the SessionEnd timeout, and stays separately opt-in from the context hooks. Setup preserves an existing opt-in on an ordinary rerun, migrates the earlier guarded commands, and removes worktree hooks without removing rule hooks when explicitly disabled. The existing grouped-hook preservation and malformed-file safeguards remain in place; the added regression exercises migration, idempotence and removal.

Direction: retain an end-to-end CLI settings test for omitted, positive and negative worktree flags, and verify the installed hooks on the actual Claude Code PATH when rolling out. The removed shell guard's guidance now lives in documentation rather than the runtime error.

Verification limits: GitHub-only static diff and surrounding installer, event table and test inspection. No tests, builds, settings changes or live Claude hook sessions executed. COMMENT only, not approval.

(Written by review (OpenAI))

Merged via the queue into main with commit 3b971f6 Nov 8, 2026
25 checks passed
@kixelated
kixelated deleted the quest/m0/setup-worktree-hooks branch November 8, 2026 00:44
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