[Bug] Sub-agent incorrectly accesses parent directory instead of work tree directory

Resolved 💬 3 comments Opened Mar 13, 2026 by anantgupta129 Closed Mar 17, 2026

Preflight Checklist

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

What's Wrong?

Bug Description
So this is an issue when we are creating work tree using Claude. Whenever Claude spawns a sub agent now, at that time what happening is that subagent, let's say explore agent or something, it is accessing the code from previous directory. And this is a pain now because every time I have to give the permissions to read it from the different directory because it's a asking the code from parent directory instead of the work tree directory.

Environment Info

  • Platform: darwin
  • Terminal: WarpTerminal
  • Version: 2.1.72
  • Feedback ID: 53270167-2c45-4a81-b6a4-ea0f5d016323

What Should Happen?

Apparently when I'm in a work tree there when any subagent or anything has born it should access the files from there only instead of parent directories.

Error Messages/Logs

Steps to Reproduce

claude --worktree

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.72

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Warp

Additional Information

_No response_

View original on GitHub ↗

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