Skip to content

fix(git): create global gitignore to suppress Claude Code worktree artifacts#89

Merged
ChipWolf merged 1 commit into
mainfrom
wolf/nervous-proskuriakova-4478dd
May 21, 2026
Merged

fix(git): create global gitignore to suppress Claude Code worktree artifacts#89
ChipWolf merged 1 commit into
mainfrom
wolf/nervous-proskuriakova-4478dd

Conversation

@ChipWolf
Copy link
Copy Markdown
Owner

Summary

  • Creates ~/.gitignore (via chezmoi home/dot_gitignore) to globally ignore dev/null/ directories and .claude/settings.local.json
  • Fixes the recurring "Archive session with uncommitted changes?" modal in Claude Desktop that lists 4 git-lfs hook stubs (post-checkout, post-commit, post-merge, pre-push) under dev/null/

Root cause

Claude Code sets core.hooksPath to a relative dev/null when creating worktrees on Windows. git lfs install interprets this as ./dev/null/, creates the directory, and drops its hook stubs there. These appear as untracked files, triggering the archive warning on every session close.

The gitconfig already sets core.excludesFile = ~/.gitignore but that file never existed, so the excludes pattern had nowhere to live.

Test plan

  • chezmoi apply deploys ~/.gitignore
  • Open and archive a Claude Code session; no "uncommitted changes" modal appears
  • Existing repos are unaffected (the dev/null/ pattern only matches the literal directory name)

🤖 Generated with Claude Code

…tifacts

Claude Code sets core.hooksPath to a relative "dev/null" on Windows,
causing git-lfs to mkdir and drop hook stubs in ./dev/null/. The archive
modal then warns about 4 uncommitted changes on every session close.

The gitconfig already references ~/.gitignore as core.excludesFile but
the file never existed. Create it with a dev/null/ entry so the stubs
are globally ignored.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ChipWolf ChipWolf merged commit 6ebface into main May 21, 2026
13 checks passed
@ChipWolf ChipWolf deleted the wolf/nervous-proskuriakova-4478dd branch May 21, 2026 08:18
@github-actions github-actions Bot mentioned this pull request May 20, 2026
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.

1 participant