Problem
Claude Code web sessions (claude.ai/code) always start at the repository root. There is no way to configure a different working directory in the environment settings.
For monorepos where project-specific .claude/ configuration (hooks, skills, MCP servers, settings) lives in a subdirectory, this means:
.claude/settings.json in the subdirectory is never discovered
- SessionStart hooks never fire
- Skills, MCP servers, and other
.claude/ config are not loaded
What I tried
| Approach |
Result |
cd <subdir> in the setup script |
Does not persist — Claude resets working directory to repo root |
Use case
Our monorepo has this structure:
my-platform/ ← repo root (where web session starts)
apps/
my-app/ ← where we work, where .claude/ lives
.claude/
settings.json ← hooks, permissions, plugins
hooks/ ← SessionStart, PostToolUse, Stop hooks
skills/
commands/
frontend/
backend/
We built a SessionStart hook that bootstraps the full dev environment in web sessions. It works locally but is invisible to web sessions because they start at the repo root.
Proposed solution
Add a "Working directory" field (path relative to repo root) in the claude.ai/code environment configuration. When set, the session starts in that directory, discovering .claude/ config there.
Example: setting apps/my-app would make the session behave as if claude was launched from apps/my-app/.
Alternative: parent directory traversal
#12962 proposes that Claude Code traverse parent directories to find .claude/settings.json. If that were implemented with downward discovery as well (or if the web session supported walking into known subdirectories), it could also solve this problem — the repo-root session would discover and merge .claude/ config from apps/my-app/. This would be even better since it would fix both web sessions and any context where Claude starts from a parent directory.
Related issues
Problem
Claude Code web sessions (claude.ai/code) always start at the repository root. There is no way to configure a different working directory in the environment settings.
For monorepos where project-specific
.claude/configuration (hooks, skills, MCP servers, settings) lives in a subdirectory, this means:.claude/settings.jsonin the subdirectory is never discovered.claude/config are not loadedWhat I tried
cd <subdir>in the setup scriptUse case
Our monorepo has this structure:
We built a SessionStart hook that bootstraps the full dev environment in web sessions. It works locally but is invisible to web sessions because they start at the repo root.
Proposed solution
Add a "Working directory" field (path relative to repo root) in the claude.ai/code environment configuration. When set, the session starts in that directory, discovering
.claude/config there.Example: setting
apps/my-appwould make the session behave as ifclaudewas launched fromapps/my-app/.Alternative: parent directory traversal
#12962 proposes that Claude Code traverse parent directories to find
.claude/settings.json. If that were implemented with downward discovery as well (or if the web session supported walking into known subdirectories), it could also solve this problem — the repo-root session would discover and merge.claude/config fromapps/my-app/. This would be even better since it would fix both web sessions and any context where Claude starts from a parent directory.Related issues
.claudeconfig discovery in monorepos.claude/directory location