Skip to content
Claude Code v2.1.198: Background Agents Now Commit, Push, and Open Draft PRs
DeploymentJuly 2, 20269 min read

Claude Code v2.1.198: Background Agents Now Commit, Push, and Open Draft PRs

Claude Code v2.1.198 auto-commits from background agents, opens draft PRs, and adds Notification hooks. Full breakdown for builders shipping agent workflows.

Claude Code v2.1.198, shipped July 1, 2026 with 32 total changes, closes the final gap in the background agent workflow. Agents in git worktrees now auto-commit, push the branch, and open a GitHub draft PR when they finish -- no prompt, no pause. Two new Notification hook events let you wire Slack or desktop alerts to agent completions and blocked sessions.

I have been running background agents against isolated worktrees since they shipped. The flow had one obvious hole: the agent finished editing, then sat waiting for me to run git commit and push manually. v2.1.198 removes that step entirely. Here is what changed, how to configure the Notification hooks, and what the Explore agent model upgrade actually costs you in tokens.

What shipped in Claude Code v2.1.198?

v2.1.198 landed July 1, 2026 with 32 total changes. The highlights: background agents now auto-commit, push, and open a draft PR in worktrees; the Explore agent upgraded from Haiku to inheriting the main session model (capped at Opus 4.8); Claude in Chrome reached general availability; and two new Notification hook events -- agent_needs_input and agent_completed -- shipped for the background agent lifecycle.

This version builds on v2.1.197 (June 30), which made Claude Sonnet 5 the default model across all sessions. Starting with v2.1.198, Sonnet 5 is what Explore uses unless you pin something else, and background agent sessions inherit whatever model the parent session is running.

Two quieter changes worth noting: subagents and context compaction now inherit the session's extended thinking configuration, so delegated tasks get the same reasoning depth as the main agent; and the new /dataviz skill ships with an executable color palette validator for chart and dashboard work. Sources: claudeupdates.dev, DevelopersIO.

Free Newsletter

Get the daily AI agent signal in your inbox.

One email, every morning. The builds, tools, and frontier research that matter — no fluff, no AI hype cycle noise.

Subscribe free

How do background agents handle the full PR loop now?

Before v2.1.198, a background agent in a git worktree stopped after editing and waited for you to commit and push by hand. v2.1.198 automates the full sequence: the agent detects it has finished code work, commits the changes, pushes the branch, and opens a GitHub draft PR -- all without any user prompt. The draft flag is the safety boundary; merge authority stays with humans.

The draft constraint matters. The PR is not marked ready-to-merge. It is a draft: no reviewer gets notified, no merge button is active, and CI runs its checks before any human looks at the diff. Anthropic is drawing a deliberate line here -- the agent handles authorship and transport, you handle the review and merge decision. This is the right boundary for agentic coding workflows right now.

What changed in my actual workflow: I used to run a background agent, go work on something else for 20 minutes, come back to find edits sitting in the worktree, then spend two more minutes running git add, git commit, git push, and gh pr create --draft. That friction was small per task but compounded across 5-10 parallel agents in a day. v2.1.198 removes it entirely. The agent finishes when the draft PR is open, not when the edits exist on disk.

This also changes how you run parallel agent sessions. With the old flow, spawning 5 agents against 5 different tasks meant 5 separate manual commit-push-PR sequences when they all finished within a few minutes of each other. With v2.1.198, all 5 create their own draft PRs autonomously. You get 5 Notification hook events, and your GitHub repo shows 5 draft PRs ready for review. That is a meaningfully different throughput ceiling for solo operators running agent-heavy workflows.

The workflow: run claude agents, start a background session, give it a task with a clear branch name and completion criteria, and move on. When agent_completed fires, a draft PR is waiting in your GitHub repo. You open it, review the diff, and merge -- or leave comments and let the agent continue.

How do you wire Notification hooks for agent_needs_input and agent_completed?

v2.1.198 adds two background agent lifecycle events to the Claude Code Notification hook: agent_needs_input fires when an agent hits a decision it cannot resolve alone -- a merge conflict, missing credential, or scope ambiguity; agent_completed fires when an agent finishes its task and the draft PR is open. Both pipe through the existing hook configuration in settings.json.

Here is a minimal Slack setup. Create an incoming webhook at api.slack.com/apps, then add this block to your ~/.claude/settings.json:

{
  "hooks": {
    "Notification": [
      {
        "matcher": "agent_completed",
        "hooks": [
          {
            "type": "command",
            "command": "curl -s -X POST "$SLACK_WEBHOOK_URL" -H 'Content-type: application/json' -d "{\"text\": \"Agent finished: $CLAUDE_NOTIFICATION_MESSAGE\"}""
          }
        ]
      },
      {
        "matcher": "agent_needs_input",
        "hooks": [
          {
            "type": "command",
            "command": "curl -s -X POST "$SLACK_URGENT_WEBHOOK" -H 'Content-type: application/json' -d "{\"text\": \"Agent blocked -- needs input: $CLAUDE_NOTIFICATION_MESSAGE\"}""
          }
        ]
      }
    ]
  }
}

Set SLACK_WEBHOOK_URL and SLACK_URGENT_WEBHOOK in your shell environment. The two events warrant different severity levels: agent_completed is an FYI (work is staged, nothing is blocking), agent_needs_input means the agent is paused and waiting for you. I route completions to a low-noise monitoring channel and input requests to a high-priority channel with phone notifications enabled. Full hook docs: code.claude.com/docs/en/agent-sdk/hooks.

Want this built for your business?

Venti Scale builds AI automation systems for businesses that want results without the learning curve. One operator, AI-powered, full marketing stack.

See What We Build

What does the Explore agent model upgrade actually cost?

The Explore agent previously ran on Haiku regardless of your session model -- Anthropic's fastest and cheapest option. v2.1.198 changes that: Explore now inherits the main session model, capped at Opus 4.8. Run Sonnet 5 as your main model and Explore runs on Sonnet 5. Pin Opus 4.8 and Explore can use Opus. Haiku is no longer the floor for Explore searches.

The cost difference is real. Claude Sonnet 5 intro pricing (through August 31, 2026) is $2.00 input / $10.00 output per million tokens, with standard pricing of $3.00 / $15.00 per million tokens after that. Claude Haiku 4.5 runs at $0.80 / $4.00 per million tokens. Explore runs targeted search operations -- not long reasoning chains -- so the token volume per call is modest. But if you run heavy Explore sweeps across large codebases, the cost delta adds up and is worth monitoring for the first week after upgrading.

What you get in return: meaningfully better code comprehension. Claude Sonnet 5 hit 85.2% on SWE-bench Verified at launch on June 30, 2026, per Anthropic's announcement. Haiku-level searches in repos with complex module graphs, heavy abstraction, or non-obvious naming patterns routinely missed relevant files and returned shallow results. Sonnet 5's structural code reasoning is considerably stronger, which translates to fewer dead ends when Explore is looking for specific patterns across large codebases.

What does Claude in Chrome GA mean for browser automation?

Claude in Chrome reached general availability in v2.1.198. The integration lets Claude Code drive a real Chrome browser -- not a headless test environment -- to test web apps, capture console logs, fill forms, and extract page data. GA means Anthropic is committing to a production support envelope; the beta stability caveat is gone.

I have been using the beta for automated QA: Claude Code runs through a defined set of UI steps, captures any JavaScript console errors, and returns a structured report. The main beta failure mode was session instability -- the browser connection would drop mid-run, the agent would error, and the whole run had to restart. GA means those stability issues are addressed to production standards.

The combination that makes this interesting: Chrome GA plus the background agent PR loop. An agent can now edit code in a worktree, commit the change, open a draft PR, and immediately load the live preview URL in a real Chrome session to run a smoke test -- before any human looks at the diff. The agent does the write-test cycle; you review the PR after it has already validated against a real browser. Source: freeai.help.

FAQ

Do I need to configure anything to get the auto-commit behavior in v2.1.198?

No configuration required. If you are on v2.1.198 or later and using claude agents with a git worktree that has a GitHub remote, background agents auto-commit and open a draft PR when they finish code work. Verify your version with claude --version and confirm the worktree branch has push access to the remote. Update with npm install -g @anthropic-ai/claude-code@latest.

Can background agents merge pull requests or only open them as drafts?

Background agents open draft PRs only -- they cannot merge. The draft state prevents auto-merge and blocks reviewer assignment. Your branch protection rules, required CI checks, and status checks all remain in force. A human must explicitly promote the draft to ready-for-review and then approve the merge. That boundary is deliberate in v2.1.198 and is not configurable.

How do I control which model a background agent session uses?

Background agents inherit the model from the parent session. Start your main session with claude --model claude-sonnet-5 and background agents launched from it use Sonnet 5. To pin Opus: claude --model claude-opus-4-8. The Explore agent follows the same inheritance rule, capped at Opus 4.8 regardless of what the main session is pinned to above that ceiling.

What is the difference between agent_needs_input and agent_completed?

agent_completed fires when an agent finishes its work and the draft PR is open -- it is an FYI that work is staged for your review. agent_needs_input fires when an agent hits a blocker it cannot resolve alone: a merge conflict, missing credential, or ambiguous instruction. The agent is paused and cannot continue until you respond. Route these to different channels with different urgency levels -- one for monitoring, one for paging.

Want this built for your business?

Venti Scale builds AI automation systems for businesses that want results without the learning curve. One operator, AI-powered, full marketing stack.

See What We Build
AI Agents First

The daily signal from the frontier of AI agents.

Join builders, founders, and researchers getting the sharpest one-email read on what's actually shipping in AI — every morning.

No spam — unsubscribe anytime