Skip to content

Ignore ephemeral per-agent worktree dirs under .claude/worktrees/ - #742

Closed
missingbulb wants to merge 1 commit into
mainfrom
claude/charming-einstein-nr3eqq
Closed

Ignore ephemeral per-agent worktree dirs under .claude/worktrees/#742
missingbulb wants to merge 1 commit into
mainfrom
claude/charming-einstein-nr3eqq

Conversation

@missingbulb

Copy link
Copy Markdown
Owner

Summary

  • The Claude Code harness materializes a nested git checkout per isolation:"worktree" subagent under .claude/worktrees/agent-<id>/ — this repo's .gitignore had no entry for it, so those dirs showed up as untracked repo content on every Stop check.
  • Added /.claude/worktrees/ to .gitignore. Nested git checkouts aren't sane content to git add anyway (each carries its own .git).

This came out of a scheduled Claudinite-executor session that dispatched several subagents with worktree isolation to run independently; the untracked-worktree false positive blocked the session's Stop hook until fixed.

Test plan

  • git status --short shows a clean tree with the worktree dirs present but now ignored.
  • N/A — .gitignore-only change, no code path to test.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
https://claude.ai/code/session_018975YrYb81uQmAvG315fTE


Generated by Claude Code

The harness materializes a nested git checkout per isolation:"worktree"
subagent there; it was showing up as untracked repo content on Stop.

Refs #744

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018975YrYb81uQmAvG315fTE

Copy link
Copy Markdown
Owner Author

Closing at the owner's request during an open-PR sweep.

This and #723 were the same one-line fix — adding the harness-created .claude/worktrees/ to .gitignore — filed independently by two sessions. Both are being closed, so the fix is not landing from either: main's .gitignore still has no .claude/worktrees/ entry, and untracked per-agent worktree dirs will keep surfacing as repo content on Stop checks until something covers it.

Branch claude/charming-einstein-nr3eqq is left on the remote, so this is recoverable by reopening rather than re-deriving.


Generated by Claude Code

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.

2 participants