/add-dir doesn't update sandbox path validation for existing shell session

Resolved 💬 3 comments Opened Dec 30, 2025 by mv2a Closed Feb 14, 2026

Description

When adding a new working directory mid-conversation using /add-dir, the sandbox's path validation doesn't update for the existing shell session. Commands continue to fail with "Path does not exist" errors even after the directory is added.

Steps to Reproduce

  1. Start a conversation in /path/to/project-a
  2. Move project-a to a new location (e.g., /path/to/monorepo/project-a)
  3. Use /add-dir /path/to/monorepo to add the new parent directory
  4. Try to run any bash command

Expected Behavior

After /add-dir, bash commands should work in the newly added directory.

Actual Behavior

Bash commands fail with:

Path "/path/to/project-a" does not exist

The sandbox continues to validate against the original working directory path, even though:

  • That path no longer exists
  • A new valid path was added via /add-dir

Workarounds

  • Start a new conversation in the correct directory
  • Use the Task tool to spawn subagents (they get fresh sandbox contexts)

Environment

  • Claude Code CLI
  • macOS

Additional Context

This commonly happens when reorganizing projects (e.g., moving repos into a monorepo structure). The shell session becomes unusable, requiring a new conversation to be started.

View original on GitHub ↗

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