Skip to content

chore: ignore Claude Code worktrees - #422

Merged
qnbs merged 1 commit into
mainfrom
chore/gitignore-claude-worktrees
Jul 14, 2026
Merged

chore: ignore Claude Code worktrees#422
qnbs merged 1 commit into
mainfrom
chore/gitignore-claude-worktrees

Conversation

@qnbs

@qnbs qnbs commented Jul 14, 2026

Copy link
Copy Markdown
Owner

What

One line: git ignores .claude/worktrees/.

Why

.claude/worktrees/ holds full checkouts of this repo, inside the repo. An unqualified git add -A in the main checkout therefore stages a worktree as an embedded git repository and commits a bare gitlink instead of the actual change:

warning: adding embedded git repository: .claude/worktrees/pr413-cc
hint: You've added another git repository inside your current repository.

This happened while working on #413: the resulting commit contained nothing but .claude/worktrees/pr413-cc | 1 + and none of the real changes. It was reverted non-destructively, but the trap is open to anyone using Claude Code on this repo.

Scope

Deliberately limited to the worktrees/ subdirectory, so checked-in .claude configuration (settings.json, agents, skills) stays tracked. Verified:

$ git check-ignore -v .claude/worktrees/foo
.gitignore:55:.claude/worktrees/   .claude/worktrees/foo
$ git check-ignore -v .claude/settings.json
(no match — correct)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated project ignore rules to prevent temporary Claude Code worktrees from being accidentally staged or committed.

.claude/worktrees/ holds full checkouts of this repo, inside the repo. An
unqualified `git add -A` in the main checkout therefore stages one as an
embedded git repository and commits a bare gitlink instead of any real change.

Scoped to the worktrees directory so checked-in .claude config (settings.json,
agents, skills) stays tracked.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
canna-guide-2025-web Ready Ready Preview, Comment Jul 14, 2026 8:35am

@deepsource-io

deepsource-io Bot commented Jul 14, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 572fa47...3cae752 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Docker Jul 14, 2026 8:33a.m. Review ↗
JavaScript Jul 14, 2026 8:33a.m. Review ↗
Python Jul 14, 2026 8:33a.m. Review ↗
Rust Jul 14, 2026 8:33a.m. Review ↗
Shell Jul 14, 2026 8:33a.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@qnbs
qnbs marked this pull request as ready for review July 14, 2026 08:54
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a63f904d-3401-4980-ad24-011a651699a4

📥 Commits

Reviewing files that changed from the base of the PR and between 572fa47 and 3cae752.

📒 Files selected for processing (1)
  • .gitignore

📝 Walkthrough

Walkthrough

The .gitignore file now documents and excludes Claude Code worktrees at .claude/worktrees/.

Changes

Gitignore update

Layer / File(s) Summary
Add Claude worktree exclusion
.gitignore
Adds explanatory comments and ignores .claude/worktrees/.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding an ignore rule for Claude Code worktrees.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/gitignore-claude-worktrees

Comment @coderabbitai help to get the list of available commands.

@qnbs
qnbs merged commit 3efd1dc into main Jul 14, 2026
31 checks passed
@qnbs
qnbs deleted the chore/gitignore-claude-worktrees branch July 14, 2026 09:29
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