Worktree path corrupted by hook stdout — JSON output concatenated into path

Resolved 💬 3 comments Opened Mar 28, 2026 by yonatangross Closed Apr 29, 2026

Bug Description

When spawning an agent with isolation: "worktree", the worktree path gets corrupted by hook stdout output being concatenated into the path instead of being consumed by CC.

Error

Error: Path "/Users/user/coding/project/{"continue":true,"suppressOutput":true}/{"continue":true,"suppressOutput":true}" does not exist

Expected Behavior

Hook stdout ({"continue":true,"suppressOutput":true}) should be consumed by CC's hook protocol, not appended to the worktree path.

Environment

  • CC: 2.1.86
  • OS: macOS Darwin 25.3.0
  • Plugin: OrchestKit (hooks return valid JSON via stdout per hook protocol)

Reproduction

  1. Install a plugin with hooks that return {"continue":true,"suppressOutput":true} on stdout
  2. Spawn an agent with isolation: "worktree"
  3. The worktree path includes the JSON hook output as directory components

Analysis

Two hooks fire during worktree creation and return valid JSON. CC appears to capture their stdout and concatenate it into the worktree path string instead of parsing it as hook responses.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗