[Bug] /batch command causes cross-session worktree contamination and data loss

Resolved 💬 2 comments Opened Mar 5, 2026 by jkaster Closed Apr 3, 2026

Bug Description
the new /batch command is a great concept with really, really bad execution. I had it completely destroy and confuse hours of work when it didn't properly isolate worktrees in one Claude Code session from another. I suggest modifying the worktree management to ensure that worktrees are locked to their Claude Code session ID and they never deviate to worktrees that don't match their session ID. And if the worktree gets corrupted that they don't just start making code changes from the default worktree but instead either stop or correctly reconstruct their own contextual worktree locked to the session ID.

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 2.1.69
  • Feedback ID: e46eccfd-d8ee-410b-a1e2-8d9d723a91fc

Errors

[{"error":"Error: File does not exist. Note: your current working directory is ....\n    at call (/$bunfs/root/src/entrypoints/cli.js:1457:5979)\n    at async Ja$ (/$bunfs/root/src/entrypoints/cli.js:3465:14916)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-05T23:16:10.972Z"},{"error":"Error: Request was aborted.\n    at hG_ (/$bunfs/root/src/entrypoints/cli.js:1128:66928)\n    at next (native:1:11)\n    at C57 (/$bunfs/root/src/entrypoints/cli.js:5878:6758)\n    at next (native:1:11)\n    at V57 (/$bunfs/root/src/entrypoints/cli.js:5883:9116)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-05T23:20:30.448Z"},{"error":"Error: Request was aborted.\n    at hG_ (/$bunfs/root/src/entrypoints/cli.js:1128:66928)\n    at next (native:1:11)\n    at C57 (/$bunfs/root/src/entrypoints/cli.js:5878:6758)\n    at next (native:1:11)\n    at V57 (/$bunfs/root/src/entrypoints/cli.js:5883:9116)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-05T23:45:54.314Z"}]

View original on GitHub ↗

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