Repository navigation
Description
Describe the bug
When using the using-git-worktrees skill, I've found it useful to add a global gitignore for .worktrees so I don't have to update every project's gitignore. Even though I have this, the skill tries to add it to the local gitignore and commit it
The .worktrees/ directory needs to be added to .gitignore first to prevent accidentally committing worktree contents.
To Reproduce
Steps to reproduce the behavior:
- Configure global gitignore
[core]
excludesfile = ~/.gitignore
- Add
.worktrees/to ~/.gitignore - Activate using-git-worktrees and chose .worktrees
- See agent point out needing to gitignore it
Expected behavior
I'd expect the skill to notice it is already gitignored before trying to do it. There is git check-ignore for example:
❯ git check-ignore -v .worktrees/
/Users/josh.nichols/.gitignore:10:.worktrees/ .worktrees/
Logs
Agent (claude-sonnet-4-5-20250929)
I'm using the using-git-worktrees skill to set up an isolated workspace for implementing the rv backend.
Agent (claude-sonnet-4-5-20250929)
Tool use: Bash Check for existing worktree directories
ls -d .worktrees 2>/dev/null || ls -d worktrees 2>/dev/null || echo "NONE"
Result:
NONE
Agent (claude-sonnet-4-5-20250929)
Tool use: Bash Check CLAUDE.md for worktree preference
grep -i "worktree.*director" CLAUDE.md 2>/dev/null || echo "NO_PREFERENCE"
Result:
NO_PREFERENCE
Agent (claude-sonnet-4-5-20250929)
No worktree directory found. Where should I create worktrees?
.worktrees/(project-local, hidden)~/.config/superpowers/worktrees/mise/(global location)
Which would you prefer?
User
.worktrees
Agent (claude-sonnet-4-5-20250929)
Perfect! I'll use .worktrees/ for the isolated workspace.
Agent (claude-sonnet-4-5-20250929)
Tool use: Bash Check if .worktrees/ is in .gitignore
grep -q "^\.worktrees/$" .gitignore && echo "FOUND" || echo "NOT_FOUND"
Result:
NOT_FOUND
Agent (claude-sonnet-4-5-20250929)
The .worktrees/ directory needs to be added to .gitignore first to prevent accidentally committing worktree contents.
Agent (claude-sonnet-4-5-20250929)
Tool use: Read ./.gitignore
Result:
1→.DS_Store
2→/dist/
3→/node_modules/
4→package-lock.json
5→.mise.lock
6→/mise.local.toml
7→/perf-workspace
8→
9→*.log
10→*.profraw
11→*.lcov
12→flamegraph.svg
13→cargo-flamegraph.trace
14→
15→**/snapshots/*.snap.new
16→
17→# Generated by Cargo
18→# will have compiled files and executables
19→/target
20→# These are backup files generated by rustfmt
21→**/*.rs.bk
22→
23→# Snapcraft
24→*.snap
25→
26→# alpine
27→.ash_history
28→.abuild
29→/aports
30→
31→megalinter-reports/
32→.dev/
33→
34→.vscode/
35→testResults.xml
36→.mise/
37→comment.md
38→
39→.claude/settings.local.json
40→
Agent (claude-sonnet-4-5-20250929)
Tool use: Edit
Result:
The file /Users/josh.nichols/workspace/mise/.gitignore has been updated. Here's the result of running `cat -n` on a snippet of the edited file:
35→testResults.xml
36→.mise/
37→comment.md
38→
39→.claude/settings.local.json
40→
41→.worktrees/
42→
Agent (claude-sonnet-4-5-20250929)
Tool use: Bash Commit .gitignore change
git add .gitignore && git commit -m "chore: add .worktrees/ to .gitignore"
Error:
The user doesn't want to proceed with this tool use. The tool use was rejected (eg. if it was a file edit, the new_string was NOT written to the file). The user provided the following reason for the rejection: it's globally i
Additional context
Add any other context about the problem here.
Activity
fix: use git check-ignore for worktree gitignore verification
mycarrysun commentedon Dec 10, 2025
I just added a PR that should fix this by using
git check-ignorerather than relying on any certain file pathfix: use git check-ignore for worktree gitignore verification (#160)
fix: use git check-ignore for worktree gitignore verification (obra#160)
fix: use git check-ignore for worktree gitignore verification (obra#160)
fix: use git check-ignore for worktree gitignore verification (obra#160)
fix: use git check-ignore for worktree gitignore verification (obra#160)
fix: use git check-ignore for worktree gitignore verification (obra#160)
fix: use git check-ignore for worktree gitignore verification (obra#160)
fix(review): reviewer cleanup demands a healthy, complete PR listing
fix: use git check-ignore for worktree gitignore verification (obra#160)
finishing-a-development-branch: a stacked PR names the delete-branch-…