[FEATURE] Allow setting working directory in web session environment configuration
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- 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
- #12962 — Settings.json parent directory traversal for monorepos
- #37344 — Hierarchical
.claudeconfig discovery in monorepos - #33131 — Allow customizing the
.claude/directory location - #2365 — Better monorepo support
- #23627 — Multi-repository support for remote/web sessions
- #36175 — Desktop app: no option to select project directory
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗