Claude always runs commands from repo root instead of correct working directory

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I’ve noticed that when using Claude inside Cursor, it doesn’t detect the correct working directory for commands. Instead, it always defaults to the repo root.

Example:
In a monorepo with apps/mobile/, if I ask Claude to run:
npx expo start

Claude behavior: Runs it from / (repo root), Expo fails.

GPT behavior: Correctly runs it from apps/mobile/ when I’m editing files there.

Why it matters:
This makes Claude almost unusable for projects with nested app folders (Expo, Turborepo, pnpm workspaces, etc.), because running from root breaks configs and state. GPT doesn’t have this issue, so it seems model-specific.

Workarounds tried:
Manually prefixing cd apps/mobile && … → works, but adds friction.

Opening the package.json inside apps/mobile before prompting → doesn’t always help.
Would love to see Claude inherit the same working-directory handling as GPT.

Steps to Reproduce

Steps to Reproduce:

Open a monorepo project (e.g. with structure apps/mobile/).
In Cursor, open a file inside apps/mobile/ (e.g. App.js or package.json).

Ask Claude: npx expo start
Observe the terminal output.

Expected Behavior

Claude should respect the current working directory context (same as GPT does), so commands execute from the right subfolder.

Operating System

Linux

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.5.11
VSCode Version: 1.99.3
Commit: 2f2737de9aa376933d975ae30290447c910fdf40
Date: 2025-09-05T03:48:32.332Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Linux x64 6.14.0-29-generic

For AI issues: which model did you use?

Model Name: Sonnet 4

Does this stop you from using Cursor

No - Cursor works, but with this issue

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.