Feature request: native defaultWorkingDirectory / cwd setting in settings.json
Summary
Long-running projects in fixed directories regularly hit a friction pattern: a substantial fraction of all Bash tool calls end up prefixed with cd "/full/path/to/project" && <cmd> because shell state doesn't persist across Bash calls and Claude can't safely assume the cwd is the project root.
In one project we measured this across 30 days / 1,113 Bash calls — 458 of them (41%) cd-prefixed. Daily rate has increased over time as the project deepens.
Ask
Support a defaultWorkingDirectory (or similarly-named) directive in .claude/settings.json / .claude/settings.local.json that becomes the default cwd for all Bash tool invocations in that session.
Should be:
- Inheritable to subagents (with override per-call possible)
- Project-scoped (
.claude/settings.local.json) preferred for project-specific cwds - User-scoped (
~/.claude/settings.json) also OK as a fallback default
Workarounds tried and rejected
- PreToolUse hook on Bash that mutates the command — runs after Claude generates the command, so we'd be rewriting the command string in flight. Hacky, and could confuse subagents that legitimately want different cwds.
- Discipline note ("prefer absolute paths over
cd") — tried twice across two monthly workflow reviews in our project. Doesn't take. Discipline doesn't hold against real ergonomic friction.
Workaround we're accepting
Just accepting the token-cost friction. It's not breakage, just inefficiency. But a native setting would compound nicely across long-lived projects in fixed directories.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗