Skip to content

ai: support worktrees in claude code#872

Merged
ovitrif merged 2 commits intomasterfrom
ai/worktreeinclude
Mar 29, 2026
Merged

ai: support worktrees in claude code#872
ovitrif merged 2 commits intomasterfrom
ai/worktreeinclude

Conversation

@ovitrif
Copy link
Copy Markdown
Collaborator

@ovitrif ovitrif commented Mar 27, 2026

This PR adds a .worktreeinclude file so Claude Code's claude -w worktree feature automatically copies build-critical gitignored files (signing keys, Firebase configs, local properties, Claude Code settings) into new worktrees.

Description

Defines gitignore-syntax patterns covering all gitignored files required for building and working with the project:

  • local.properties (SDK path, GitHub credentials)
  • keystore.* / *.keystore (signing configs and keystore binaries)
  • google-services.json (Firebase, all flavors)
  • *.local.* (Claude Code settings)
  • tools/fcm-tester/service-account.json
  • .idea/ (IDE settings — verified all paths use $PROJECT_DIR$, no hardcoded absolute paths)
  • .ai/ (local agent memory caches, PR notes, debug artifacts)

This replaces the need to manually maintain multiple repo copies (bitkit-android-2, -3) for parallel work.

Preview

N/A — config file only, no UI changes.

QA Notes

Test Plan

  • 1. Verify the file is tracked and patterns are correct
    • Run git ls-files --others --ignored --exclude-standard and confirm all critical files are listed
  • 2. Test worktree creation
    • Run claude -w from the repo root
    • Verify the new worktree contains copies of:
      • .claude/settings.local.json
      • app/google-services.json
      • app/src/mainnetRelease/google-services.json
      • app/bitkit.keystore
      • app/internal.keystore
      • local.properties
      • keystore.properties
      • keystore.internal.properties
      • .ai
      • .idea
  • 3. Verify worktree can build
    • In the new worktree, run ./gradlew compileDevDebugKotlin
  • 3. Verify worktree can build release binaries
    • In the new worktree, run ./gradlew bundleMainnetRelease assembleMainnetRelease

@claude

This comment has been minimized.

@ovitrif ovitrif requested review from ben-kaufman and jvsena42 March 27, 2026 15:45
@ovitrif ovitrif added this to the 2.2.0 milestone Mar 27, 2026
@ovitrif ovitrif enabled auto-merge March 27, 2026 15:45
@ovitrif ovitrif self-assigned this Mar 27, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ovitrif ovitrif force-pushed the ai/worktreeinclude branch from fb3627f to 0e9bd65 Compare March 28, 2026 19:47
@claude

This comment has been minimized.

@ovitrif
Copy link
Copy Markdown
Collaborator Author

ovitrif commented Mar 28, 2026

✅ PR verified — Ovi's Local Claude Code CLI

Created a test worktree via EnterWorktree (Claude Code's built-in worktree tool) at .claude/worktrees/qa-test-worktreeinclude and verified all QA items:

1. File patterns — PASS
All 10 critical gitignored file groups confirmed present via git ls-files --others --ignored --exclude-standard.

2. Worktree file copying — PASS
All files/directories verified to exist in the worktree:

  • local.properties
  • keystore.properties
  • keystore.internal.properties
  • app/bitkit.keystore
  • app/internal.keystore
  • app/google-services.json
  • app/src/mainnetRelease/google-services.json
  • .claude/settings.local.json
  • .ai/ (41 files) ✓
  • .idea/ (56 files) ✓

3. Dev debug build — PASS
./gradlew compileDevDebugKotlin — BUILD SUCCESSFUL in 1m 42s (21 tasks: 5 executed, 16 from cache)

4. Mainnet release build — PASS
./gradlew bundleMainnetRelease assembleMainnetRelease — BUILD SUCCESSFUL in 2m (69 tasks: 36 executed, 33 from cache)

Worktree cleaned up after verification.

Copy link
Copy Markdown
Contributor

@ben-kaufman ben-kaufman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well, but should add .claude/worktrees to .gitignore so these don't get added to git.

@ovitrif
Copy link
Copy Markdown
Collaborator Author

ovitrif commented Mar 29, 2026

Works well, but should add .claude/worktrees to .gitignore so these don't get added to git.

Good call. Technically git already handles this — each worktree directory gets a .git file that tells the parent repo to exclude it from its own tracking, so git status from the main repo won't show worktree contents as untracked. But adding .claude/worktrees to .gitignore is cheap insurance against edge cases (leftover files after cleanup, tools that don't respect git's worktree detection, etc.).

Added in c837d35.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@claude
Copy link
Copy Markdown
Contributor

claude bot commented Mar 29, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@ovitrif ovitrif requested a review from ben-kaufman March 29, 2026 21:44
@ovitrif ovitrif merged commit aaed973 into master Mar 29, 2026
11 checks passed
@ovitrif ovitrif deleted the ai/worktreeinclude branch March 29, 2026 21:45
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.

3 participants