claude-code - 💡(How to fix) Fix [REGRESSION] Mandatory worktree isolation breaks hardware-in-the-loop development — live PLC codebase analysis, debug and re-deploy cycle completely severed [4 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49147Fetched 2026-04-17 08:49:34
View on GitHub
Comments
4
Participants
3
Timeline
9
Reactions
0
Timeline (top)
labeled ×5commented ×4

Error Message

Error Messages/Logs

Note: No error messages are produced. The workflow silently breaks because the edits are written to the wrong location.

Root Cause

  1. Open Claude Code Desktop (v1.2773.0, Windows), Code tab
  2. Select a TwinCAT 3 PLC project git repository as the project folder
  3. Start a new session
  4. Ask Claude to make a change to a PLC source file (e.g. a *.TcPOU function block)
  5. Check the actual repository directory — the source file has not been modified
  6. Check .claude/worktrees/ — the modification was made there instead
  7. Attempt to build the project in TwinCAT XAE (Visual Studio 2019) — XAE sees no changes; build compiles the original unmodified source
  8. Deploy to target PLC controller — the running code reflects the original source, not Claude's edits
  9. Attempt live symbol monitoring via ADS-MCP — runtime state cannot be correlated against Claude's changes because they were never deployed
  10. The hardware debug and re-deploy cycle cannot proceed; there is no path to hardware validation before commit

Code Example

{ "worktrees": { "enabled": false } }

---
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

The April 14, 2026 Claude Code Desktop redesign introduced mandatory git worktree isolation for all Code tab sessions. Previously, the Code tab operated directly on the actual repository working directory. Now, all file edits go to .claude/worktrees/<random-name>/ instead.

This has completely broken an integrated hardware-in-the-loop development workflow used for industrial PLC automation projects on GitHub-hosted team repositories:

  • Claude Code (Code tab) would analyse and edit TwinCAT 3 PLC source files (*.TcPOU, *.TcGVL, *.tsproj) directly in the git working directory
  • TwinCAT XAE / Visual Studio would detect file changes in the same directory, build the project, and deploy to the target PLC controller via ADS
  • Claude would connect to the live running PLC via ADS-MCP (TwinCAT ADS Model Context Protocol server) to monitor live symbol values and correlate runtime behaviour against source code intent
  • Debugging and re-deployment would iterate until behaviour was correct on hardware
  • Only then would a git commit and push occur

With mandatory worktrees, all edits now go to .claude/worktrees/ — a path the TwinCAT XAE toolchain has no awareness of. XAE sees no changes, no build occurs, nothing is deployed to the PLC, and the ADS-MCP live monitoring is comparing PLC runtime state against code that has never been deployed. The entire workflow chain collapses at the first step.

What Should Happen?

The Code tab should provide a project-level option to operate directly on the actual repository working directory, as it did prior to the April 14, 2026 redesign — identical to the pre-redesign behaviour and to the default CLI behaviour without --worktree.

A minimal solution would be a setting in .claude/settings.json:

{ "worktrees": { "enabled": false } }

When disabled, Code tab sessions edit files in the real repo working directory. The existing multi-session worktree isolation remains the default and is unaffected for projects that do not opt out.

This is essential for any development domain where the working directory is the test environment: the IDE toolchain must see Claude's changes to build, deploy, and validate on physical hardware before a commit is appropriate. CI cannot substitute for this — there is no emulator or container for a physical PLC running a deterministic real-time OS.

Error Messages/Logs

Steps to Reproduce

  1. Open Claude Code Desktop (v1.2773.0, Windows), Code tab
  2. Select a TwinCAT 3 PLC project git repository as the project folder
  3. Start a new session
  4. Ask Claude to make a change to a PLC source file (e.g. a *.TcPOU function block)
  5. Check the actual repository directory — the source file has not been modified
  6. Check .claude/worktrees/ — the modification was made there instead
  7. Attempt to build the project in TwinCAT XAE (Visual Studio 2019) — XAE sees no changes; build compiles the original unmodified source
  8. Deploy to target PLC controller — the running code reflects the original source, not Claude's edits
  9. Attempt live symbol monitoring via ADS-MCP — runtime state cannot be correlated against Claude's changes because they were never deployed
  10. The hardware debug and re-deploy cycle cannot proceed; there is no path to hardware validation before commit

Note: No error messages are produced. The workflow silently breaks because the edits are written to the wrong location.

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

Prior to Claude Desktop v1.2581.0 (April 14, 2026)

Claude Code Version

1.2773.0 (Windows)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

Related to #31896. The ADS-MCP server (part of Anthropic's MCP ecosystem) was actively used within Code tab sessions for live PLC monitoring — the worktree change severs the link between Claude's edits and what ADS-MCP can validate against. Same regression affects all embedded toolchains with fixed project path references: Keil MDK, IAR, STM32CubeIDE, TIA Portal, Studio 5000, Codesys, Vivado, Quartus.

extent analysis

TL;DR

The most likely fix is to add a project-level option to operate directly on the actual repository working directory by setting "worktrees": { "enabled": false } in .claude/settings.json.

Guidance

  • To verify the issue, check if the edits made by Claude Code are being written to the .claude/worktrees/ directory instead of the actual repository working directory.
  • To mitigate the issue, try setting "worktrees": { "enabled": false } in .claude/settings.json to disable worktree isolation for the project.
  • If the above setting is not available, consider downgrading to a version prior to Claude Desktop v1.2581.0, which is known to work.
  • Test the workflow with the proposed fix by making changes to a PLC source file and checking if TwinCAT XAE detects the changes and builds the project correctly.

Example

{
  "worktrees": {
    "enabled": false
  }
}

This setting should be added to the .claude/settings.json file to disable worktree isolation for the project.

Notes

The proposed fix assumes that the issue is caused by the mandatory worktree isolation introduced in Claude Code Desktop v1.2581.0. If the issue persists after applying the fix, further investigation may be necessary.

Recommendation

Apply the workaround by setting "worktrees": { "enabled": false } in .claude/settings.json, as this is a known fix for the regression introduced in Claude Desktop v1.2581.0.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING