[MODEL] Consistent model behavior degradation in git worktree sessions — ignores workflows, skills, and CLAUDE.md rules despite identical configuration

Resolved 💬 6 comments Opened Mar 7, 2026 by guidevit-dealsmartai Closed Apr 10, 2026

Preflight Checklist

  • [x] I have searched existing issues for similar behavior reports
  • [x] This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Claude ignored my instructions or configuration

What You Asked Claude to Do

Executed a custom workflow command (/max-feature-from-linear) that expands into a detailed Mermaid flowchart with specific execution instructions: dispatch sub-agents for codebase exploration, library research, approach planning, implementation, testing, trace analysis, and PR creation. The workflow was provided inline in the user message with full Sub-Agent node definitions, AskUserQuestion nodes, and If/Else branching logic.

The project has 50+ custom skills in .claude/skills/, custom commands in .claude/commands/, hooks in .claude/settings.json, and a comprehensive CLAUDE.md with explicit rules about skill invocation, sub-agent dispatch (TeamCreate), and workflow adherence.

All of these are correctly loaded — verified by inspecting system prompts, checking file diffs, and confirming hooks fire.

What Claude Actually Did

Instead of following the multi-step workflow, Claude:

  1. Skipped all sub-agent dispatch — the workflow defined explore_codebase, research_docs, plan_approaches as Sub-Agent nodes, but Claude did all work directly in the main context
  2. Never called the Skill tool — despite using-superpowers being injected via SessionStart hook (visible in system prompts), Claude never invoked Skill('brainstorming'), Skill('building-features'), or any other skill
  3. Skipped skill_test_data and skill_docker nodes — workflow explicitly required loading these skills as context
  4. Did not use AskUserQuestion for approach selection — went straight to implementation
  5. Ignored CLAUDE.md rules — rules like "2+ independent tasks → TeamCreate" and "AFTER USER CORRECTIONS → ask about CLAUDE.md" were not followed

When confronted, Claude first blamed its own "judgment" (claiming it chose to skip steps for efficiency), then when pressed, acknowledged the pattern is consistent across every worktree session — not a one-time judgment call.

Expected Behavior

Claude should follow the explicitly provided workflow step-by-step:

  1. Dispatch sub-agents for explore_codebase, research_docs, plan_approaches
  2. Invoke skills via the Skill tool when relevant (brainstorming, building-features, etc.)
  3. Follow the using-superpowers instructions that were injected via SessionStart hook
  4. Use AskUserQuestion nodes as defined in the workflow
  5. Respect CLAUDE.md rules identically to how it behaves in the main worktree

This is exactly how Claude behaves when running in the main worktree of the same repository with the same CLAUDE.md, skills, commands, and hooks.

Why This Is Different From Existing Issues

This is not a file-loading or path-resolution issue. Existing worktree bugs (#27985, #27343, #28041, #23569, #28248) are about files not being found, paths resolving incorrectly, or settings not being copied. Our issue is categorically different:

| What | Status | Verification |
|------|--------|-------------|
| .claude/settings.json | ✅ Identical (verified via diff) | Hooks fire, 3x SessionStart:startup hook success |
| CLAUDE.md (root) | ✅ Identical (verified via diff) | Loaded in system prompt |
| .claude/skills/ (50+ skills) | ✅ All present in worktree | find shows identical SKILL.md files |
| using-superpowers SessionStart hook | ✅ Fires and injects content | Visible 2x in system prompts as <EXTREMELY_IMPORTANT> blocks |
| .claude/commands/ | ✅ Identical | Commands expand correctly when invoked |
| Workflow provided inline | ✅ Full mermaid + node definitions in user message | Not dependent on file loading at all |

Everything is loaded correctly. The model simply chooses not to follow it.

The one observable difference in the system prompt is this line:

"This is a git worktree — an isolated copy of the repository."

This framing may be causing the model to treat worktree sessions as "lighter" or less rigorous, leading to systematic behavioral degradation.

Files Affected

No files were incorrectly modified. The issue is about model behavior — not following provided workflows, not invoking skills, and not dispatching sub-agents as instructed.

Permission Mode

Accept Edits was OFF (manual approval required)

Can You Reproduce This?

Yes, every time with the same prompt

Steps to Reproduce

  1. Set up a project with:
  • .claude/skills/ directory containing multiple skills
  • .claude/commands/ with workflow commands
  • .claude/settings.json with hooks (including SessionStart that injects skill instructions)
  • CLAUDE.md with explicit rules about skill usage, sub-agent dispatch, and workflow adherence
  1. Create a manual git worktree (not via claude -w): git worktree add .claude/worktrees/test-worktree
  2. Open Claude Code in the worktree directory
  3. Verify all files are present: skills, commands, settings.json, CLAUDE.md — all identical to main repo
  4. Invoke a workflow command that expands to a multi-step mermaid flowchart with Sub-Agent nodes
  5. Observe: Claude does all work directly, never dispatches sub-agents, never calls Skill tool, ignores workflow structure
  6. Open Claude Code in the main worktree with the exact same command
  7. Observe: Claude follows the workflow, dispatches sub-agents, invokes skills as expected

Claude Model

Opus

Impact

High - Significant unwanted changes

Users with complex automation setups (skills, commands, workflows, hooks) rely on consistent model behavior across all working directories. When the model silently degrades its compliance with provided workflows in worktree sessions, it undermines the entire automation architecture. Users must repeatedly correct the model or give up on using worktrees for parallel development.

Claude Code Version

2.1.69 (Claude Code)

Platform

Anthropic API

Additional Context

System prompt evidence

The system prompt in the worktree session contains:

Primary working directory: /path/to/repo/.claude/worktrees/test-worktree
This is a git worktree — an isolated copy of the repository.

In the main repo, this says:

Primary working directory: /path/to/repo
Is a git repository: true

The "isolated copy" framing appears to influence the model's behavior, making it treat the session as less authoritative than the main worktree.

Pattern consistency

This has been observed across:

  • Multiple independent worktrees (different names, different branches)
  • Different workflow commands
  • Different sessions on different days
  • The same user, same project, same configuration

The degradation is always present in worktrees and never present in the main worktree — making it a systematic behavioral issue, not a random one.

Related but distinct issues

  • #27985 — Skills load from wrong path (our skills load correctly)
  • #27343 — CLAUDE_PROJECT_DIR wrong (our hooks fire correctly)
  • #28041 — .claude/ not copied to worktree (our files are present and identical)
  • #23569 — Path-conditional rules ignored (we don't use path frontmatter)
  • #28248 — Permission shows wrong path (cosmetic, not behavioral)

None of these explain why the model ignores correctly-loaded instructions.

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗