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.
Released: March 2026
Claude Code 2.1.82-2.1.83 brings reactive hook events, background agent stability, auto-memory management, transcript navigation, and security hardening. These releases focus on reliability and developer experience polish.
Fires when the working directory changes. Enables reactive environment management:
{
"hooks": {
"CwdChanged": [{
"type": "command",
"command": "direnv allow 2>/dev/null || true"
}]
}
}
Use cases:
Fires when files change on disk. Enables hot-reload patterns:
{
"hooks": {
"FileChanged": [{
"type": "command",
"command": "echo 'File changed: $CLAUDE_FILE_PATH'"
}]
}
}
Before: Background agents became invisible after context compaction, causing duplicate spawns and orphaned work.
After: Background agents now survive compaction correctly. Their status is preserved and they report completion as expected.
Impact: Safe to use run_in_background: true with Agent tool without worrying about lost agents.
The TaskOutput tool is deprecated. Instead, use the Read tool on the task’s output file path:
# Before (deprecated)
TaskOutput(taskId: "abc123")
# After (recommended)
Read(file_path: "/path/from/task/output")
The task’s output file path is returned when the task completes.
Auto-memory files (MEMORY.md) are now automatically capped at:
Lines beyond 200 are truncated. This prevents memory bloat from degrading context quality.
Best practice: Keep memory entries concise. One line per entry in the index. Store detail in separate files referenced by the index.
Navigate conversation history with built-in search:
Full screen clear and redraw. Use when the terminal UI goes blank or corrupted – replaces the need to restart the session.
export CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1
Strips API credentials from all subprocesses (Bash commands, hooks, MCP stdio servers). Prevents accidental credential leakage through subprocess environment inheritance.
export CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS=5000
Extends the SessionEnd hook timeout from the default 1.5 seconds to 5 seconds. Useful for hooks that need to save state, push metrics, or clean up resources.
{
"sandbox": {
"failIfUnavailable": true
}
}
Exit with error when the sandbox can’t start, instead of silently running unsandboxed. Recommended for CI/CD environments where sandboxing is a security requirement.
Drop-in directory for modular policy fragments. Files are merged alphabetically, enabling:
.claude/
managed-settings.d/
00-team-base.json
10-project-overrides.json
20-personal.json
Prevents claude-cli:// protocol handler registration. Useful in headless or CI environments.
Agents can declare an initial prompt in their frontmatter to auto-submit the first turn:
---
description: Run daily health checks
initialPrompt: "Run the health check suite and report results"
---
This enables fully autonomous agent workflows triggered by hooks or cron jobs.
Worktree names containing forward slashes (/) caused hangs in previous versions. This is now fixed – but avoid slashes in worktree names for backward compatibility.
| Variable | Purpose | Default |
|---|---|---|
CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS |
SessionEnd hook timeout | 1500ms |
CLAUDE_CODE_SUBPROCESS_ENV_SCRUB |
Strip credentials from subprocesses | off |
CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK |
Disable non-streaming fallback | off |
TaskOutput usage and switch to Read on the task output pathCLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 to .bashrc for securityPrevious: Chapter 59 — Community Repo Research Patterns Next: Chapter 61 — Stack Audit & Maintenance Patterns