Anthropic Releases Claude Code v2.1.318 with Mod Effort Controls and Gateway IAM Attribution
What changed
Anthropic released Claude Code v2.1.318, bringing granular cost and execution controls to extension mods, expanding gateway identity features, and fixing multiple process lifecycle and configuration locking bugs.
Extension Mods and Upstream Routing
- Subagent effort controls: Developers can now specify an
effortparameter inside a mod’s$.model.forkconfig. This allows side jobs to run atloweffort regardless of the main session’s effort setting, with the API response reporting the effort level used. - Gateway IAM attribution: Upstream
mantlegateways handling Claude app traffic now supportassume_role. This enables AWS role assumption across different accounts and allows per-developer cost attribution. - Mod approval tracking: The runtime now logs user answers when Claude Code prompts to enable mods written during an active session.
Authentication and Expiration Telemetry
- Token expiration fields: Added
loginExpiresAttoclaude auth statusandcredential_expires_attoclaude -pJSON output. - Expiration warnings:
claude -ptext output now prints a one-line warning tostderrstarting 10 days before a stored claude.ai sign-in expires. - Auth lock and file fixes: Resolved silent configuration drops on shared network home directories during
/logout,claude auth logout, and setting updates. Fixed an issue where signing into an account on another terminal or host marked existing sessions on the same shared home asNot logged in.
Reliability and Bug Fixes
- Session continuation: Fixed a regression introduced in v2.1.314 where
--continuelost prior conversation history after exhausting retries on a malformed tool call. (For context on earlier environment and runner changes, see coverage of v2.1.311 and v2.1.295). - Process lifecycle and binary cleanup: Fixed
spawn ENOENTerrors on background daemons, self-hosted runners, andclaude remote-controlhosts caused by version cleanup deleting active binaries. Fixed background cleanup treating processes owned by other users (such assudo claude) as dead. - MCP server management:
claude mcp addandremovenow wait for config locks or exit with status code 1. Stdio MCP servers that exit during initial version probing are no longer re-probed on every start, and servers that crash within 3 seconds of startup are pinned to the legacy handshake for 7 days. - Cloud and runner execution: Fixed shell commands executing in the startup folder instead of the requested target directory following cloud session restarts. Environment variables written to
CLAUDE_ENV_FILEbySetuphooks now correctly pass to the Bash tool in cloud environments. - Mac resource usage: Resolved an issue where macOS sessions running numerous Bash commands stalled due to unbounded memory growth.
Why it matters
For teams deploying Claude Code across enterprise infrastructure, assume_role support on mantle gateways simplifies multi-account AWS architectures and provides clean cost attribution back to individual developer accounts.
The addition of effort parameters to $.model.fork offers precise cost control over secondary tasks. Heavy reasoning sessions can now spawn quick sub-tasks configured at low effort, avoiding unnecessary token consumption for trivial side jobs.
Fixes around file locks, daemon binary deletion, and shared home directory behavior stabilize automated pipelines and multi-tenant setups where network storage or background daemons previously caused silent failures or dropped credentials.
Limitations
While claude mcp add and remove commands now wait for file locks or exit with code 1, a server save can still be overwritten if another process writes a new configuration immediately after the lock is released.
What to do next
- Upgrade Claude Code: Update your CLI installation to v2.1.318 via your standard package manager.
- Audit Subagent Mods: Update custom subagent definitions to pass
effort: lowinside$.model.forkfor lightweight background steps. - Monitor Credential Expiry: Update automated scripts running
claude -pto parsecredential_expires_atfrom the JSON response to automate re-authentication. - Configure AWS Gateways: If using
mantleupstreams, configureassume_rolesettings to begin tracking per-developer AWS spending.
Sources
Share Article
If this article helped you, please share it with others!