Add settings.json option to enable worktree mode by default (instead of `claude -w`)
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
I always use "claude -w" to run Claude Code in worktree mode, ensuring my working directory stays clean while Claude works in an isolated git worktree.
Currently, there is no way to set this as a default in settings.json. I have to remember to pass the -w flag every time I launch Claude Code. If I forget, Claude works directly in my main working tree which is not my preferred workflow.
Proposed Solution
Add a "worktree" boolean option to settings.json that enables worktree mode by default:
{
"worktree": true
}
This would be equivalent to always running "claude -w". The CLI flag could still override the setting (e.g., "claude --no-worktree" to disable it for a single session).
This follows the same pattern as other settings like "model" that allow persisting CLI flag defaults in the config file.
Alternative Solutions
Currently I use a shell alias to always pass the -w flag, but might forget sometimes or need to alias it which is an extra manual step.
Priority
Medium - Would be very helpful
Feature Category
Configuration and settings
Use Case Example
I configure my settings.json with my preferred model and permission mode. I then run "claude" from my project directory expecting worktree mode, but forget the -w flag. Claude starts editing files directly in my working tree, potentially conflicting with my uncommitted changes.
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗