Summary
During thinktank runs, getDiff frequently fails with:
`fatal: not a git repository (or any of the parent directories): .git`
This happens because Claude Code agents sometimes cd into subdirectories or temp directories during execution, and when getDiff runs afterward, the current working directory is no longer the worktree.
Fix
getDiff and getDiffStats should always use the explicit worktree path as cwd, which they already do. But the issue may be that the worktree was removed by git or the OS during agent execution. Need to verify the worktree still exists before trying to diff.
Impact
Shows 0 files changed for agents that actually made changes. Reduces the effectiveness of convergence analysis.
Summary
During thinktank runs, getDiff frequently fails with:
`fatal: not a git repository (or any of the parent directories): .git`
This happens because Claude Code agents sometimes cd into subdirectories or temp directories during execution, and when getDiff runs afterward, the current working directory is no longer the worktree.
Fix
getDiff and getDiffStats should always use the explicit worktree path as cwd, which they already do. But the issue may be that the worktree was removed by git or the OS during agent execution. Need to verify the worktree still exists before trying to diff.
Impact
Shows 0 files changed for agents that actually made changes. Reduces the effectiveness of convergence analysis.