Add a setting to disable background agents' auto-commit / auto-push / auto-PR (v2.1.198)

Status Open
Maintainer reply ✓ Yes — bcherny
Activity 3 comments · opened Jul 2, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Feature request

v2.1.198 (July 1, 2026) introduced auto PR creation for background agents: per the release notes, a background agent that finishes code work in a worktree now auto-commits, auto-pushes, and auto-opens a draft PR — as a default behavior.

Problem: some of us run propose-only workflows, where agents produce changes but a human reviews, commits, and opens every PR. With this behavior on by default, a background agent finishing its work can push branches and open draft PRs on origin without the human in the loop. I could not find a settings key, /config option, or any documented way to turn it off (checked the settings docs and the v2.1.198 changelog/release notes).

Ask (either would work):

  1. A configuration key to disable the behavior — e.g. backgroundAgents.autoCreatePr: false, ideally with separate knobs for auto-commit / auto-push / auto-PR — settable in settings.json and via /config; or
  2. Have background agents respect existing permission deny rules (e.g. Bash(git push:*)) so the behavior can be blocked with the current permission system.

Why it matters: pushing branches and opening PRs is outward-facing. For workflows where the human is the only one allowed to publish, a default-on publish step needs an off switch.

Environment: Claude Code v2.1.198, macOS (darwin).

View original on GitHub ↗

3 Comments

catchmeee2002 · 1 month ago

+1 from a solo developer perspective.

I run a single-person game dev project with background jobs. The auto-PR behavior introduced in v2.1.198 creates pure friction:

  1. Zombie PRs accumulate — I don't review PRs on my own project. Every background job now leaves a draft PR I have to manually close.
  2. Merge conflicts — The worktree branch diverges from local master (which often has unpushed commits). Auto-opened PRs can't fast-forward merge, requiring manual conflict resolution for what should have been a direct commit.
  3. Breaks existing workflows — My project uses a builder-loop system with its own merge-and-cleanup pipeline. The auto-PR step conflicts with that pipeline's commit flow.

The previous behavior (background job commits to worktree branch, user merges when ready) was already safe enough. Auto-pushing to origin and opening PRs without consent is overreach for solo workflows.

Minimum viable fix: a settings.json key like backgroundAgents.autoCreatePr: false. Separate knobs for auto-commit / auto-push / auto-PR would be ideal as suggested in the issue description.

Environment: Claude Code latest, Linux (debian), solo developer.

joebcc · 1 month ago

+1 — hit this today. A background job was asked to do something purely local (rewrite 3 commit messages via git rebase), and because it isolated the work in a worktree, it auto-pushed the result to origin without ever being asked — no review step, no heads-up, just a live push to a branch I didn't expect touched. Not great to clutter the teams git history with zombie branches.

Worth noting: setting permissions.deny rules for git push/gh pr create doesn't reliably help here either, since it's unconfirmed whether background sessions actually respect them — which is effectively option 2 in this request. The only working workaround right now is worktree.bgIsolation: "none", which disables worktree isolation entirely just to get "ask before publish" back — trading away one safety net for the other. A dedicated toggle (or making background sessions honor existing deny rules) would let us keep both.

bcherny collaborator · 14 days ago

Partial update: in a recent release the behavior changed so background sessions only open a draft PR when the task calls for one, and your own git instructions take precedence. If your CLAUDE.md (or the task prompt) says you handle committing and pushing yourself, Claude leaves git to you and just reports where the work lives.

Docs: https://code.claude.com/docs/en/agent-view
Release notes: https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md

A hard settings key / deny-rule enforcement isn't there yet, so leaving this open for that part.

🤖 Generated with Claude Code