The complete guide to Claude Code setup (Opus 4.6, Sonnet 4.6, Haiku 4.5). 1M token context window. 100+ hours saved. 25 hook events. Agent teams and task management. Production-tested patterns for skills, hooks, and MCP integration.
Five releases over one week (March 15-21, 2026) brought scripting improvements, a new hook event, plugin ecosystem maturation, and continued performance gains. This chapter covers each version with practical details.
The --bare flag strips Claude Code down to its essentials for scripted -p (prompt) calls. It skips hooks, LSP initialization, plugin sync, and skill directory walks – everything that adds latency but provides no value in non-interactive pipelines.
# Fast scripted call — no hooks, no plugins, no skill walks
claude -p "Summarize this file" --bare < input.txt
Requirements and constraints:
ANTHROPIC_API_KEY environment variable (no OAuth)When to use: CI pipelines, shell scripts, batch processing, any non-interactive automation where startup speed matters more than IDE integration.
MCP servers can now forward tool approval prompts to your phone via the --channels flag. When Claude needs permission to run a tool and you are away from your terminal, the approval request routes to a mobile notification channel.
claude --channels
This feature graduated from research preview (introduced in 2.1.80) to general availability.
Fixed an issue where multiple concurrent Claude Code sessions would trigger redundant OAuth re-authentication flows. Sessions now share authentication state correctly.
MCP tool calls now collapse into a single “Queried {server}” line in the conversation display instead of showing each individual tool invocation. This reduces visual noise when MCP servers make multiple internal calls.
Line-by-line response streaming is disabled on Windows and WSL due to terminal rendering issues. Responses appear in blocks instead. This is a temporary measure while terminal compatibility is investigated.
Statusline scripts now receive a rate_limits field containing usage data for the 5-hour and 7-day billing windows. This lets custom statusline displays show remaining capacity.
{
"rate_limits": {
"5h": { "used": 42, "limit": 100 },
"7d": { "used": 310, "limit": 1000 }
}
}
Skills and slash commands can now declare an effort level in their YAML frontmatter. When a skill is invoked, Claude automatically adjusts its reasoning effort to match.
---
name: quick-check
effort: low
---
| Effort | Use Case |
|---|---|
low |
Simple lookups, formatting tasks |
medium |
Standard development work |
high |
Architecture decisions, complex debugging |
Plugins can now declare source: 'settings' to indicate they come from a curated marketplace rather than a local directory. This is groundwork for the plugin discovery ecosystem.
Fixed a bug where --resume would drop results from tools that ran in parallel. Previously, resuming a session that had concurrent tool calls could lose some of their outputs.
Initial research preview of the --channels permission relay (see 2.1.81 for GA release).
A new authentication flow for environments where browser-based OAuth is not available. The --console flag prints a URL and waits for you to paste an authorization code back into the terminal.
claude auth login --console
This is particularly useful for remote servers, Docker containers, and CI environments where opening a browser is not possible. Uses API billing rather than interactive billing.
A new toggle in /config displays how long each turn (user message to complete response) took. Useful for identifying slow turns caused by large tool outputs or complex reasoning.
/config → Show turn duration → On
Enables remote control of Claude Code from VS Code’s command palette. VS Code extensions can send prompts and receive responses programmatically.
VS Code now shows AI-generated titles for Claude Code sessions in the sidebar instead of generic “Session 1, Session 2” labels. Titles are based on the first substantive exchange.
A new hook event that fires when Claude Code stops due to an API error (rate limit, network failure, authentication error). This complements the existing Stop event which fires on normal completion.
{
"hooks": {
"StopFailure": [
{
"hooks": [
{
"type": "command",
"command": "echo \"$(date): API failure\" >> /tmp/claude-failures.log"
}
]
}
]
}
}
Hook event comparison:
| Event | Fires When | Use Case |
|---|---|---|
Stop |
Normal completion | Session summaries, cleanup |
StopFailure |
API error or crash | Error logging, alerting, retry scripts |
SessionEnd |
Session closes | Final cleanup regardless of cause |
Plugins now have access to a persistent state directory via the ${CLAUDE_PLUGIN_DATA} environment variable. This directory survives across sessions, giving plugins a place to store configuration, caches, and state.
# In a plugin hook script
STATE_FILE="${CLAUDE_PLUGIN_DATA}/my-plugin-state.json"
Plugin agents can now declare effort, maxTurns, and disallowedTools in their YAML frontmatter:
---
name: my-agent
effort: high
maxTurns: 10
disallowedTools:
- Bash
- Write
---
| Field | Effect |
|---|---|
effort |
Sets reasoning effort level for the agent |
maxTurns |
Limits how many turns the agent can take |
disallowedTools |
Prevents the agent from using specified tools |
Responses now stream line by line instead of waiting for complete paragraphs. This provides faster visual feedback, especially for long responses. (Note: disabled on Windows/WSL in 2.1.81.)
Fixed issues where git operations inside the sandbox environment would fail due to missing configuration. The sandbox now properly inherits git user settings.
A visible warning now appears when sandbox dependencies (bubblewrap, socat) are missing. Previously, the sandbox would silently fall back to unsandboxed execution.
The default maximum output for Opus 4.6 increased from 32k to 64k tokens, with an upper bound of 128k tokens. This means longer uninterrupted responses, larger code generations, and fewer truncation events.
| Setting | Before | After |
|---|---|---|
| Default max output | 32k tokens | 64k tokens |
| Upper bound | 64k tokens | 128k tokens |
A new sandbox configuration option that permits read access to specific paths while keeping write access restricted:
{
"sandbox": {
"allowRead": [
"/etc/ssl/certs",
"/usr/share/ca-certificates"
]
}
}
This is useful when tools need to read system certificates or shared configuration files but should not modify them.
Copy the Nth-latest response to clipboard. /copy 1 copies the most recent response, /copy 2 copies the one before that, and so on.
/copy 3 # Copies the third-most-recent response
Renamed from /fork. Creates a branch point in the conversation – you can explore a direction and return to the branch point if it does not work out.
/branch # Create a branch point
/branch list # List available branches
/branch switch 2 # Switch to branch 2
The SendMessage tool (used for inter-agent communication) now automatically resumes stopped agents. Previously, sending a message to a stopped agent would silently fail. The resume parameter has been removed from the Agent tool since auto-resume handles this case.
| Metric | Improvement |
|---|---|
| macOS startup | ~60ms faster |
--resume speed |
45% faster |
--resume memory |
~100-150MB less |
| Auto-updater | Fixed memory leak |
| “Always Allow” | Fixed for compound bash commands |
Startup savings on macOS, 45% faster resume with 100-150MB less memory, auto-updater memory leak fix, and the --bare flag for scripted calls that skips all non-essential initialization.
Plugin agents gained effort, maxTurns, and disallowedTools frontmatter. Skills and slash commands gained effort frontmatter. SendMessage now auto-resumes stopped agents, removing a common source of silent failures in multi-agent workflows.
Persistent state via ${CLAUDE_PLUGIN_DATA}, settings-based plugin sources, and the --channels permission relay give plugins more capabilities and better distribution mechanisms.
The StopFailure event fills the gap between Stop (normal) and SessionEnd (always). You can now distinguish between “Claude finished successfully” and “Claude crashed” in your hook scripts.
The allowRead sandbox setting provides granular read permissions. Sandbox git issues are fixed. Missing sandbox dependencies now produce visible warnings instead of silent fallbacks.
Key new settings from this chapter:
{
"hooks": {
"StopFailure": [
{
"hooks": [
{
"type": "command",
"command": "echo \"$(date): failure\" >> /tmp/claude-failures.log"
}
]
}
]
},
"sandbox": {
"allowRead": [
"/etc/ssl/certs"
]
}
}
Plugin agent frontmatter:
---
name: my-agent
effort: high
maxTurns: 10
disallowedTools:
- Bash
---
Skill effort frontmatter:
---
name: quick-lookup
effort: low
---
CLI flags:
claude -p "prompt" --bare # Scripted mode, no hooks/plugins/skills
claude --channels # Permission relay to mobile
claude auth login --console # Auth without browser
See Also: