Skip to content

using-git-worktrees: Project-local .worktrees/ causes duplicate CLAUDE.md loading #279

Closed as not planned

Description

@jasonkuhrt

Problem

The using-git-worktrees skill recommends .worktrees/ inside the project:

https://github.com/obra/superpowers/blob/main/skills/using-git-worktrees/SKILL.md#L28

Claude Code walks up the directory tree loading all CLAUDE.md files. When a worktree lives inside the parent repo, both get loaded:

Working directory: ~/projects/myproject/.worktrees/my-feature-branch/

/memory output:

  4. ~/projects/myproject/.claude/CLAUDE.md     ← parent repo
  5. .claude/CLAUDE.md                          ← worktree

This causes conflicting rules when the worktree branch has diverged from the parent.

Suggested fix

  1. Document this as expected behavior, or
  2. Recommend sibling directories (~/.config/superpowers/worktrees/) as default to avoid parent traversal

Environment

  • Claude Code 2.1.9
  • Superpowers 4.0.3

Activity

  1. pySilver commented on Jan 22, 2026

    @pySilver

    @jasonkuhrt I've tried to check this issue myself. My feature branch is checked into the project directory, under .worktrees. I've asked something specific about that branch and I don't see CLAUDE.md to be read twice. I am not sure (quick search does not confirm that) but maybe CLAUDE.md is ignored in directories that are placed under .gitignore?

  2. added
    bug
    claude-code
    on Feb 5, 2026
  3. added a commit that references this issue on Mar 6, 2026
    b274fe5
  4. added
    worktrees
    on Mar 23, 2026
  5. added
    stale
    documentation
    on May 11, 2026
  6. arittr commented on May 11, 2026

    @arittr
    Collaborator

    Thanks for the report. We’re closing this because the current worktree guidance intentionally favors project-local .worktrees/, and later discussion did not confirm that Claude Code still double-loads parent/worktree instructions in a way we can reproduce and fix here.

    If this still reproduces on a current Claude Code release, please open a fresh issue with the exact directory layout, .gitignore state, /memory output, and Claude Code version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclaude-codedocumentationstaleworktrees

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions