
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_nakazawaSales Claw maintainer

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:
- Agent tool
subagent_typematching improvement — case- and separator-insensitive /goalsilent-hang fix — resolves no-response withdisableAllHooks/allowManagedHooksOnlysetclaude --bg+ event-loop improvements — stabilizes Windows / pre-idle-shutdown / enterprise security setups- 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."

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.

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", ...) # ✅ resolvesSmall 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 --bgfailing withconnection dropped mid-requestif 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
ghor another missing executable triggered a synchronous re-spawn ofwhere.exeon 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
extraKnownMarketplacesauto-update wasn't persisted toknown_marketplaces.json - Fixed mis-attribution of symlinked-config change events that fired unnecessary
ConfigChangehooks
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.139 | 2.1.140+ |
|---|---|---|
| subagent_type resolution | Strict match only | Case + separator insensitive |
| On variant input | Silent failure / default fallback | Resolves to the correct subagent |
| Worker LLM burden | Must follow exact normalization | Natural-language-like text works |
| Effect with parallelism | Failure rate accumulates | Accumulated 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 HooksallowManagedHooksOnly: 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.

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 PTYNo 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.
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.
Legal / compliance
- 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 more
すべての記事
AIニュース12 分
AIニュースOpenAI Codex Became "the Colleague Who Runs Through the Night" — Goal Mode GA, Locked Computer Use, Appshots, and Plugin Marketplace Explained for Non-Experts
14 分
AIニュースClaude Code 2.1.143: Plugin dependency enforcement + PowerShell default-on + /goal × background race fix — closing the 96-hour 5-release streak
16 分
