AI NewsClaude Code 2.1.140

Claude Code 2.1.140: subagent goal handling fix and what changed

Claude Code 2.1.140 corrects a subtle subagent /goal interpretation bug — important if you run autonomous loops. We explain the symptom, the fix, and how to validate.

中澤 圭志

中澤 圭志

@keishi_nakazawa

Sales Claw maintainer

·11 min
Claude Code 2.1.140: subagent goal handling fix and what changed
This English article is a concise version of the original. For the full Japanese deep-dive, see the Japanese original.

Key Facts

Release

2.1.140 (2026-05-13)

Fix

Subagent /goal interpretation

"Got the /goal + Agent View in 2.1.139. What changed in 2.1.140 the next day?" 2.1.140 lives in the shadow of the prior day's flashy release, but it's packed with quiet production-readiness fixes. This article walks through the impact on AI sales automation and Sales Claw, using the official Changelog as primary source.

On 2026-05-12, Anthropic released Claude Code 2.1.140 — a follow-up to the previous evening's 2.1.139 that introduced /goal and Agent View.

2.1.140 has no headline feature. Instead it includes four stability and robustness fixes:

  1. Agent tool subagent_type matching improvement — case- and separator-insensitive
  2. /goal silent-hang fix — resolves no-response with disableAllHooks / allowManagedHooksOnly set
  3. claude --bg + event-loop improvements — stabilizes Windows / pre-idle-shutdown / enterprise security setups
  4. Remote management config 401 retry — auto-retry after token refresh

Primary sources: Claude Code official Changelog, GitHub Releases, Claude Code Docs. For the prior 2.1.139 feature deep-dive, see the /goal + Agent View article.

1. What 2.1.140 is — the May 12 release at a glance

Claude Code ships fast. 2.1.139 and 2.1.140 shipped within ~24 hours. 2.1.139 added /goal + Agent View (50 CLI changes). 2.1.140 is a fix pack focused on "run that new feature in production."

New-feature day → next-day bug reports → next-day fixes is Anthropic's Claude Code rhythm. For products like Sales Claw that run AI sales automation on Claude Code, these consecutive patches are "rarely article-worthy but most important operationally."

Claude Code 2.1.x release density from April 30 to May 14, 2026. Feature additions (feat): 2.1.135 / 2.1.138 / 2.1.139 (/goal + Agent View) — three. Bug fixes (fix): 2.1.130 / 132 / 134 / 136 / 137 / 140 — six. 2.1.140 ships within 24 hours of 2.1.139.
Figure: Figure 1: Recent two-week release density. The typical 'flagship feat → fix the next day' pattern

2. The changes, from the Changelog

Excerpts from the official Changelog. Excludes anything covered in 2.1.139.

subagent_type matching improvement

Agent-tool (Agent(...)) subagent_type matching becomes case- and separator-insensitive.

Before/After of subagent_type matching in Claude Code 2.1.140. Before: strict match only — Code Reviewer / codeReviewer / code-Reviewer all fail. After: flexible match — same variations all resolve to the correct subagent.
Figure: Figure 2: subagent_type matching Before/After. From 2.1.140 onward, casing and separator variations resolve to the same subagent

Previously strict-match:

# Until 2.1.139 (strict match only)
Agent(subagent_type: "code-reviewer", ...)   # ✅ resolves
Agent(subagent_type: "Code Reviewer", ...)   # ❌ fails
Agent(subagent_type: "code reviewer", ...)   # ❌ fails

# 2.1.140+ (case / separator insensitive)
Agent(subagent_type: "code-reviewer", ...)   # ✅
Agent(subagent_type: "Code Reviewer", ...)   # ✅ resolves
Agent(subagent_type: "code reviewer", ...)   # ✅ resolves
Agent(subagent_type: "Code_Reviewer", ...)   # ✅ resolves

Small but real: when the Worker LLM naturally generates a subagent name from a prompt phrase (a user says "use the code reviewer," the Worker normalizes to "code reviewer"), robustness goes up a notch.

/goal silent-hang fix

2.1.139's /goal command was silently hanging in environments configured with disableAllHooks or allowManagedHooksOnly. Before the fix, the indicator would spin forever, no error message — users perceived "hang" / "freeze."

From 2.1.140, a clear message appears — "you can see why it's not working." Now you can decide: relax the Hooks policy, or switch to a different automation approach.

claude --bg + event-loop improvements

Several fixes around background services:

  • Fixed claude --bg failing with connection dropped mid-request if a request was sent just before the background service's idle shutdown
  • Fixed background-service startup timing out on machines running endpoint-security products (typical enterprise) — startup timeout extended
  • Fixed Windows event-loop stall when gh or another missing executable triggered a synchronous re-spawn of where.exe on every check

For AI sales automation that keeps background agents running for hours to days, these fixes flow directly into uptime.

Remote management config / Hooks

Three enterprise-management fixes:

  • Fixed remote management config not retrying on 401; now forces a token refresh and retries once
  • Fixed regression where managed extraKnownMarketplaces auto-update wasn't persisted to known_marketplaces.json
  • Fixed mis-attribution of symlinked-config change events that fired unnecessary ConfigChange hooks

Other fixes: Read tool offset argument validation for space-padded or +-prefixed strings; native cursor remaining in the input caret when the terminal loses focus.

3. Why subagent_type matching helps AI sales

The trap: casing variants cause call failures

Sales Claw runs Phase A as 3–5 parallel haiku subagents per target company via the CLI Agent tool. The Worker (the main Claude) calls Agent(subagent_type: "...", prompt: "...") per company.

When the user prompt contains Japanese labels (e.g., "code reviewer" in some language) and the Worker normalizes them to English subagent_type, normalization sometimes drifts:

  • Result becomes "Code Reviewer" (spaces)
  • Result becomes "codeReviewer" (camel)
  • Result becomes "Code-Reviewer" (hyphen + leading caps)

Strict matching in 2.1.139 caused these to silently failor fall back to a default agent. Sales Claw saw this as "occasionally a company gets a strangely shallow analysis" — low-reproducibility, hard-to-bug-report.

2.1.140+: more tolerant of Worker natural language

With case- and separator-insensitive matching, the drift above is absorbed. No code change required in Sales Claw; the gain accumulates as Phase A parallelism increases.

項目≤ 2.1.1392.1.140+
subagent_type resolutionStrict match onlyCase + separator insensitive
On variant inputSilent failure / default fallbackResolves to the correct subagent
Worker LLM burdenMust follow exact normalizationNatural-language-like text works
Effect with parallelismFailure rate accumulatesAccumulated failures disappear

No public benchmark numbers, but for Sales Claw — which calls the Agent tool dozens to hundreds of times per batch — even a small failure-rate improvement compounds.

4. The /goal hang fix and the "silent failure" problem

Symptom: indicator spins and never stops

2.1.139's /goal command continues autonomous execution across turns until a condition is met. With either of these set in settings.json, it silently hung:

  • disableAllHooks: true — disable all Hooks
  • allowManagedHooksOnly: true — only managed Hooks allowed

The symptom: /goal showed a progress indicator, but no response came regardless of how long you waited. No error message. Users had no way to know whether it was running or stuck.

Why this was severe in enterprise

disableAllHooks and allowManagedHooksOnly are commonly set in enterprise environments to control arbitrary-code-execution risk via Hooks. IT teams that forbid non-managed Hooks were the typical case.

In those environments, trying /goal in 2.1.139 looked like a freeze, and teams might conclude "Claude Code's autonomous loops are unusable." 2.1.140's clear error ("Hooks are restricted, so /goal is not available") gives teams the input they need to decide between relaxing the policy or switching to claude -p pipe mode.

Before/After of /goal flow in Claude Code 2.1.140. Before: terminal shows a spinner with disableAllHooks set, no response (Autonomous Loop stuck at 0%). After: clear error message reveals the cause immediately, and a healthy PLAN → EXECUTE → OBSERVE → REFLECT loop proceeds.
Figure: Figure 3: /goal flow Before/After. Silent hang becomes explicit error — operational observability up

5. Sales Claw integration sketch — Phase A impact

Sales Claw is OSS that lowers misfire and policy-violation risk through policy control, pre-send checks, do-not-contact detection, CAPTCHA-on-detect stop, rate limits, audit logging, and automatic stop conditions. Since Claude Code is the CLI backend, Claude Code stability flows directly into Sales Claw.

Upgrade procedure (zero side effects)

# 1. Upgrade Claude Code to 2.1.140
npm install -g @anthropic-ai/claude-code@latest

# 2. Confirm
claude --version
# → 2.1.140 or newer

# 3. Restart Sales Claw dashboard
#    Click [Start Claude] to relaunch the managed PTY

No Sales Claw code changes. See Sales Claw Quick start for setup.

Phase A parallel subagents stabilize

Sales Claw Phase A launches Agent(subagent_type: "general-purpose", model: "haiku", prompt: ...) with 3–5 in parallel per target. See Workflow overview for context.

From 2.1.140, the Worker LLM's casing / separator variations still resolve. Local failure rate in Phase A subagent calls drops.

Cost estimate — see prior article (assumptions unchanged)

2.1.140 doesn't affect model pricing or API spec. Monthly cost estimates for 10,000-company workloads from the prior article remain valid. Assumptions, variance bands, and the sample-measurement recommendation are in the prior cost-estimate section. Always sample 100 companies before scaling.

Stability went up a notch in 2.1.140. Good time to start.

無料・MIT ライセンス。インストールせずにライブデモも試せます。

6. Risks of autonomous operation and safe-by-design

2.1.140 stabilizes things, but running AI sales automation unattended over long periodsstill requires multiple guards. Don't claim "safe" — lower risk structurally.

  • Japan's Specified Electronic Mail Act: auto-append the 4 sender-info requirements via preferences.complianceFooter: true
  • Terms compliance: pages marked "no sales," "recruiting only," "IR only" auto-skip
  • No CAPTCHA bypass: stop into awaiting_approval, log on detect
  • Rate limit: suppress consecutive sends to the same domain
  • Opt-out: auto-insert "reply to opt out" in copy

Automatic stop conditions to prevent runaway

With /goal now working in enterprise environments, the responsibility for termination-condition design increases. The accidental safety of "it didn't work so it didn't run away" is gone.

Risks that remain

  • New CAPTCHA variants may slip past detection until Sales Claw is updated
  • "No sales" phrasing changes require manual updates
  • Industry-specific regulation (BFSI / healthcare / public — confirm separately)
  • Subagent resolution improvement reduces failure rate; it doesn't guarantee quality. Continue sample audits

7. Pre-production checklist

Checks when switching to Claude Code 2.1.140

  • claude --version shows 2.1.140 or newer
  • Sales Claw dashboard restarted the managed PTY via [Start Claude]
  • Phase A parallel analysis succeeds across all 5 sample companies
  • subagent_type still resolves even with intentional casing variants
  • /goal launches with ANDed termination: volume cap + elapsed cap + turn cap
  • In disableAllHooks / allowManagedHooksOnly environments, /goal returns an error message
  • Compliance footer enabled (preferences.complianceFooter: true)
  • CAPTCHA-on-detect stop into awaiting_approval is on
  • Audit log (action-log.json) is saved
  • Rate limits set
  • Correction / retraction process shared with the SDR team

8. Bottom line — "unflashy releases" raise the production floor

Claude Code 2.1.140 is a stabilization patch you can read in 30 seconds. For AI sales automation — calling the Agent tool dozens to hundreds of times per batch, keeping background agents alive for hours to days — those quiet fixes are the actual floor under production operation.

The /goalenterprise improvement is especially important: teams with Hooks restrictions finally have the input they need to decide "use it or not." Subagent-call robustness compounds as parallelism scales.

Next action: npm install -g @anthropic-ai/claude-code@latest, restart the Sales Claw dashboard, validate Phase A on a 5-company sample. See Quick start and Workflow overview for details. Sales Claw itself is free at the download page.

Read this, then try 5 companies.

無料・MIT ライセンス。インストールせずにライブデモも試せます。

この記事の著者

中澤 圭志

中澤 圭志

Sales Claw maintainer

Sales Claw の設計・開発を担当。BtoB 営業自動化と AI 活用の実践者として、現場目線で情報発信中。

Share this article