Background agent Ctrl+S resolves to wrong directory when sibling directory is a prefix match
Open 💬 0 comments Opened Jun 8, 2026 by gleotescu1
When a background agent is launched from a directory whose name has a sibling that is a strict prefix of it, pressing Ctrl+S in the Agent view navigates to the shorter sibling instead of the correct working directory.
Steps to reproduce
- Have two sibling directories where one name is a prefix of the other, e.g.:
````
/home/user/projects/app
/home/user/projects/app_dashboard
cd /home/user/projects/app_dashboardclaude --bg- Open the Agent view in the UI
- Press Ctrl+S
Expected
Ctrl+S targets /home/user/projects/app_dashboard (the directory the agent was launched from).
Actual
Ctrl+S targets /home/user/projects/app (the shorter prefix-matching sibling).
Notes
- The agent's actual working directory is correct —
pwdinside the session returns the right path, and the Agent view header also shows the correct path. - The issue is only in the Ctrl+S path resolution.
- Likely cause: the path lookup uses a prefix or fuzzy match and returns the first/shortest hit rather than requiring an exact match.