CLAUDE_CODE_LAZY_WORKTREE
Updated by Alex Sorokoletov
CLAUDE_CODE_LAZY_WORKTREE is a Claude Desktop host variable; while it is set, a Desktop session does not offer to commit and push your pull request as you. Default: unset; in the CLI and IDE extensions it has no effect. The question it hides reads "Commit your changes and push them to your pull request, as you?". Values: any value, an empty one included, counts as set. Added between v2.1.326 and v2.1.331 and still present in v2.1.332. It is not in the official reference.
| Status | Present in v2.1.332 |
|---|---|
| Added | Added between v2.1.326 and v2.1.331 |
| Default | unset; in the CLI and IDE extensions it has no effect. The question it hides reads "Commit your changes and push them to your pull request, as you?" |
| Values | any value, an empty one included, counts as set |
| Category | Other |
| Official docs | Not listed |
| Checked against | v2.1.332 |
How to set it
For one session, export it in the shell that starts Claude Code:
export CLAUDE_CODE_LAZY_WORKTREE=<value>
claudeTo apply it to every session, add it to the env object of a settings file:
// ~/.claude/settings.json
{
"env": {
"CLAUDE_CODE_LAZY_WORKTREE": "<value>"
}
}Related variables
CLAUDE_CODE_HOST_WORKTREE: Declares the git worktree the host is operating in; the path is validated against the current working directory.CLAUDE_CODE_HOST_WORKTREE_FENCE: Declares the boundary (fence) path for the host worktree; it is validated so it does not extend wider than the declared worktree.CLAUDE_CODE_LAZY_ENV_GETTERSANTHROPIC_BETAS: Comma-separated beta feature headers.ANTHROPIC_CUSTOM_HEADERS: Custom HTTP headers (newline-separated Key: Value).ANTHROPIC_FEDERATION_RULE_IDANTHROPIC_ORGANIZATION_IDANTHROPIC_WORKSPACE_ID
Frequently asked questions
What does CLAUDE_CODE_LAZY_WORKTREE do?
Is a Claude Desktop host variable; while it is set, a Desktop session does not offer to commit and push your pull request as you.
What is the default value of CLAUDE_CODE_LAZY_WORKTREE?
Unset; in the CLI and IDE extensions it has no effect. The question it hides reads "Commit your changes and push them to your pull request, as you?".
What values does CLAUDE_CODE_LAZY_WORKTREE accept?
Any value, an empty one included, counts as set.
Which Claude Code version has CLAUDE_CODE_LAZY_WORKTREE?
Added between v2.1.326 and v2.1.331 and still present in v2.1.332.
How do I set CLAUDE_CODE_LAZY_WORKTREE?
Export it before starting Claude Code (export CLAUDE_CODE_LAZY_WORKTREE=value), or add it to the "env" object in ~/.claude/settings.json to apply it to every session.
All variables, searchable: Claude Code environment variables.