Summary
Creating a local worktree child session without a kickoff correctly runs the configured Git post-checkout hook.
Creating the same session with a kickoff prompt does not run the hook, and the child agent starts in an incompletely initialized worktree.
Steps to reproduce
- Configure a Git
post-checkout hook that:
- writes an entry to a log;
- creates a file or symlink in the worktree.
- Create a worktree child session without a kickoff.
- Confirm that the hook ran and created the expected resource.
- Create another worktree child session with an automatic kickoff prompt.
- Confirm that:
- no hook-log entry exists;
- the expected resource is missing;
- the child agent has already started.
Expected behavior
Idle and kickoff-enabled child sessions should use the same worktree initialization process. Git hooks should finish before the kickoff agent starts.
Actual behavior
The hook runs for idle child sessions but not for kickoff-enabled sessions.
The affected worktree still has the correct commit and Git hook configuration, but hook-created repository resources are absent.
Impact
Kickoff agents can fail immediately when repository setup relies on Git hooks—for example, to provide shared instructions, skills, configuration, or tool wrappers.
Suggested fix
Create and fully initialize the worktree before starting the kickoff agent:
- Create and check out the worktree.
- Run configured Git hooks.
- Wait for initialization to complete.
- Start the child agent and deliver the kickoff prompt.
Hook failures should be reported as workspace-creation failures.
Workaround
Create the child session without a kickoff, wait for hook initialization, and send the task prompt afterward.
This workaround may lose kickoff-specific model, reasoning-effort, or mode selection.
Summary
Creating a local worktree child session without a kickoff correctly runs the configured Git
post-checkouthook.Creating the same session with a kickoff prompt does not run the hook, and the child agent starts in an incompletely initialized worktree.
Steps to reproduce
post-checkouthook that:Expected behavior
Idle and kickoff-enabled child sessions should use the same worktree initialization process. Git hooks should finish before the kickoff agent starts.
Actual behavior
The hook runs for idle child sessions but not for kickoff-enabled sessions.
The affected worktree still has the correct commit and Git hook configuration, but hook-created repository resources are absent.
Impact
Kickoff agents can fail immediately when repository setup relies on Git hooks—for example, to provide shared instructions, skills, configuration, or tool wrappers.
Suggested fix
Create and fully initialize the worktree before starting the kickoff agent:
Hook failures should be reported as workspace-creation failures.
Workaround
Create the child session without a kickoff, wait for hook initialization, and send the task prompt afterward.
This workaround may lose kickoff-specific model, reasoning-effort, or mode selection.