Skip to content

Worktrees for debugging #186

Closed as not planned
Closed as not planned

Description

@erikpr1994

I started recently using Superpowers, and I find it very powerful. The only issue I have is that, most of the time, Claude works on its own without creating a worktree, and I have to manually mention that it should create one to work on something, mostly when using systematic debugging.

Thanks!

Activity

  1. coderabbitai commented on Dec 23, 2025

    @coderabbitai

    📝 CodeRabbit Plan Mode

    Generate an implementation plan and prompts that you can use with your favorite coding agent.

    • Create Plan
    Examples

    🔗 Similar Issues

    Possible Duplicates

    Related Issues

    👤 Suggested Assignees

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord or schedule a call!

  2. obra commented on Dec 24, 2025

    @obra
    Owner

    Traditionally, auto-creation of worktrees happens as part of the brainstorming and planning process. I can see the argument for doing it during a debugging session when the debugging isn't part of an implementation plan, but I'm having a little trouble putting into words the exact right way to explain that to Claude. Thoughts?

  3. changed the title [-]Doubt: When a worktree is created?[/-] [+]Worktrees for debugging[/+] on Dec 24, 2025
  4. erikpr1994 commented on Dec 24, 2025

    @erikpr1994
    Author

    I have right now something like:

    Auto-Worktree Behavior

    Rule: Claude must create a worktree before modifying any file.

    Conversation starts → No worktree (exploration, questions, reading code)
                       ↓
    About to modify file(s) → Check: Already in worktree?
                       ↓
                  ┌────┴────┐
                  │         │
                 YES        NO
                  │         │
                  ↓         ↓
              Proceed    Invoke `superpowers:using-git-worktrees`
              with       Create worktree → Copy env files → Then modify
              edits
    

    Detection: Check if current working directory path contains /.worktrees/.

    # Example: When in worktree, cwd is:
    # /Users/.../peak-health/.worktrees/feat-name  ← contains /.worktrees/
    pwd | grep -q '/.worktrees/' && echo "In worktree" || echo "In main"
    
    And it works fairly well, also for sure it can be improved
  5. pySilver commented on Jan 20, 2026

    @pySilver

    @erikpr1994 where did you place that rule?

  6. added
    question
    claude-code
    on Feb 5, 2026
  7. added a commit that references this issue on Mar 10, 2026
    22353ae
  8. obra commented on Mar 10, 2026

    @obra
    Owner

    Closing as stale. As of v5.0, you can add instructions to your CLAUDE.md to customize when worktrees are created (e.g., "always create a worktree before modifying files"). If this is still a pain point, feel free to reopen.

    — Claude Opus 4.6, Claude Code 2.1.72

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

    claude-codequestion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions