A visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
docs: sync to Claude Code v2.1.160
Luong NGUYENd7ab99f224c8
diff --git a/01-slash-commands/README.md b/01-slash-commands/README.mdindex d3f007f..20bc3a1 100644--- a/01-slash-commands/README.md+++ b/01-slash-commands/README.md@@ -627,8 +627,8 @@ If both exist with the same name, the **skill takes precedence**. Remove one or----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/slash-commands- https://code.claude.com/docs/en/interactive-modediff --git a/02-memory/README.md b/02-memory/README.mdindex 05d6b34..64291c3 100644--- a/02-memory/README.md+++ b/02-memory/README.md@@ -1198,8 +1198,8 @@ For the most up-to-date information, refer to the official Claude Code documenta- [Official Memory Docs](https://code.claude.com/docs/en/memory) - Anthropic documentation----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/memory- https://code.claude.com/docs/en/settingsdiff --git a/03-skills/README.md b/03-skills/README.mdindex 7ff7e99..021932c 100644--- a/03-skills/README.md+++ b/03-skills/README.md@@ -858,8 +858,8 @@ Once you start building skills seriously, two things become essential: a library- [Hooks Guide](../06-hooks/) - Event-driven automation----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/skills- https://code.claude.com/docs/en/settingsdiff --git a/04-subagents/README.md b/04-subagents/README.mdindex e55ece2..786804b 100644--- a/04-subagents/README.md+++ b/04-subagents/README.md@@ -1238,8 +1238,8 @@ See the OpenTelemetry section in [Advanced Features → Telemetry](../09-advance----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/sub-agents- https://code.claude.com/docs/en/agent-teamsdiff --git a/05-mcp/README.md b/05-mcp/README.mdindex f2ece3e..837cbca 100644--- a/05-mcp/README.md+++ b/05-mcp/README.md@@ -1168,8 +1168,8 @@ export GITHUB_TOKEN="your_token"----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/mcp- https://code.claude.com/docs/en/changelogdiff --git a/06-hooks/README.md b/06-hooks/README.mdindex bb6d4fb..2970a2a 100644--- a/06-hooks/README.md+++ b/06-hooks/README.md@@ -1449,8 +1449,8 @@ Edit `~/.claude/settings.json` or `.claude/settings.json` with the hook configur----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/hooks- https://code.claude.com/docs/en/changelogdiff --git a/07-plugins/README.md b/07-plugins/README.mdindex c217c9d..a4c1a5a 100644--- a/07-plugins/README.md+++ b/07-plugins/README.md@@ -58,6 +58,8 @@ sequenceDiagramTools-->>Claude: Plugin installed ✅```+> **No marketplace required (v2.1.157+)**: Plugins placed in `.claude/skills` directories now auto-load without a marketplace. Scaffold a new one with `claude plugin init <name>`.+## Plugin Types & Distribution| Type | Scope | Shared | Authority | Examples |@@ -1105,8 +1107,8 @@ The following Claude Code features work together with plugins:----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/plugins- https://code.claude.com/docs/en/plugin-marketplaces@@ -1118,4 +1120,5 @@ The following Claude Code features work together with plugins:- https://github.com/anthropics/claude-code/releases/tag/v2.1.141- https://github.com/anthropics/claude-code/releases/tag/v2.1.142- https://github.com/anthropics/claude-code/releases/tag/v2.1.143+- https://code.claude.com/docs/en/cli-reference**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.8, Claude Haiku 4.5diff --git a/07-plugins/devops-automation/README.md b/07-plugins/devops-automation/README.mdindex aaa5368..e4b54ef 100644--- a/07-plugins/devops-automation/README.md+++ b/07-plugins/devops-automation/README.md@@ -108,8 +108,8 @@ Result:----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/plugins- https://github.com/anthropics/claude-code/releases/tag/v2.1.131diff --git a/07-plugins/documentation/README.md b/07-plugins/documentation/README.mdindex 7202438..90672d9 100644--- a/07-plugins/documentation/README.md+++ b/07-plugins/documentation/README.md@@ -120,8 +120,8 @@ export GITHUB_TOKEN="your_github_token"----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/plugins- https://github.com/anthropics/claude-code/releases/tag/v2.1.131diff --git a/07-plugins/pr-review/README.md b/07-plugins/pr-review/README.mdindex 986bce8..bebf2cb 100644--- a/07-plugins/pr-review/README.md+++ b/07-plugins/pr-review/README.md@@ -92,8 +92,8 @@ Result:----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/plugins- https://github.com/anthropics/claude-code/releases/tag/v2.1.131diff --git a/08-checkpoints/README.md b/08-checkpoints/README.mdindex 0999e39..edd0f50 100644--- a/08-checkpoints/README.md+++ b/08-checkpoints/README.md@@ -325,8 +325,8 @@ Remember: checkpoints are not a replacement for git. Use checkpoints for rapid e----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/checkpointing- https://code.claude.com/docs/en/settingsdiff --git a/08-checkpoints/checkpoint-examples.md b/08-checkpoints/checkpoint-examples.mdindex 131c051..14beaa6 100644--- a/08-checkpoints/checkpoint-examples.md+++ b/08-checkpoints/checkpoint-examples.md@@ -339,8 +339,8 @@ User: Now let's continue with the approach that worked.6. **Summarize long sessions**: Use "Summarize from here" to keep conversations manageable----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/checkpointing- https://code.claude.com/docs/en/changelogdiff --git a/09-advanced-features/README.md b/09-advanced-features/README.mdindex ac22810..3050222 100644--- a/09-advanced-features/README.md+++ b/09-advanced-features/README.md@@ -429,6 +429,8 @@ claude --enable-auto-mode> **v2.1.112 update**: Auto mode no longer requires the `--enable-auto-mode` flag. Max subscribers access it directly on Opus 4.7.+> **v2.1.158 update**: Auto mode is now available on Bedrock, Vertex, and Foundry for Opus 4.7/4.8 — **opt in** by setting `CLAUDE_CODE_ENABLE_AUTO_MODE=1`.+Or set it as the default permission mode:```bash@@ -749,7 +751,7 @@ For a one-off task you already understand, a single agent (or a direct edit) is- **Launch**: ask Claude to create a workflow for the task (e.g. "run a workflow to review every file in `src/`"). Claude authors the orchestration script and runs it in the background.- **View**: the `/workflows` command shows running and completed workflow runs with live progress.-- **`ultracode`**: selecting `ultracode` in the `/effort` menu turns this on for the session — it sends `xhigh` to the model *and* has Claude orchestrate dynamic workflows by default. It is session-only and not accepted in the settings file.+- **`ultracode`**: selecting `ultracode` in the `/effort` menu turns this on for the session — it sends `xhigh` to the model *and* has Claude orchestrate dynamic workflows by default. It is session-only and not accepted in the settings file. (As of v2.1.160 the trigger keyword is `ultracode`; the bare word "workflow" no longer triggers a run.)Workflows build on the subagent model — see [Subagents](../04-subagents/README.md) for how individual agents are defined and scoped.@@ -852,6 +854,8 @@ Permission modes control what actions Claude can take without explicit approval.Cycle through modes with `Shift+Tab` in the CLI. Set a default with the `--permission-mode` flag or the `permissions.defaultMode` setting.+As of v2.1.160, even `acceptEdits` prompts before writing shell-startup files (`.zshenv`, `.zlogin`, `.bash_login`, `~/.config/git/`) and code-executing build configs (`.npmrc`, `.yarnrc*`, `bunfig.toml`, `.bazelrc`, `.pre-commit-config.yaml`, `.devcontainer/`, …), which could otherwise lead to unintended command execution.+> **`--dangerously-skip-permissions` extended path coverage (v2.1.121, v2.1.126)**: The `--dangerously-skip-permissions` CLI flag (and equivalent `bypassPermissions` mode) now bypasses prompts for writes to a much broader allowlist — `.claude/skills/`, `.claude/agents/`, `.claude/commands/`, `.claude/`, `.git/`, `.vscode/`, and shell config files. Catastrophic removal commands (`rm -rf /`, etc.) still prompt regardless of mode. Treat the flag as a sharper tool than before; use it only in throwaway sandboxes.> **Windows shell detection (v2.1.120, v2.1.126)**: Git for Windows / Git Bash is no longer required. When Git Bash is absent, Claude Code uses PowerShell as the shell tool. From v2.1.126 PowerShell is the *primary* shell when the PowerShell tool is enabled, and detection covers PowerShell 7 installed via the Microsoft Store, MSI without PATH, or as a `.NET global tool`.@@ -1836,10 +1840,13 @@ Trade-off: `"none"` removes the safety net of worktree isolation — concurrent| Item | Description ||------|-------------|+| `EnterWorktree` | Tool to enter a worktree; as of v2.1.157 it can switch between Claude-managed worktrees mid-session || `ExitWorktree` | Tool to exit and clean up the current worktree || `WorktreeCreate` | Hook event fired when a worktree is created || `WorktreeRemove` | Hook event fired when a worktree is removed |+As of v2.1.157, worktrees managed by Claude are left unlocked when the agent finishes, so `git worktree remove`/`prune` can clean them up.+### Auto-CleanupIf no changes are made in the worktree, it is automatically cleaned up when the session ends.@@ -2294,8 +2301,8 @@ For more information about Claude Code and related features:----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/permission-modes- https://code.claude.com/docs/en/interactive-mode@@ -2307,4 +2314,6 @@ For more information about Claude Code and related features:- https://github.com/anthropics/claude-code/releases/tag/v2.1.117- https://github.com/anthropics/claude-code/releases/tag/v2.1.139- https://github.com/anthropics/claude-code/releases/tag/v2.1.154+- https://code.claude.com/docs/en/overview+- https://code.claude.com/docs/en/sub-agents**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.8, Claude Haiku 4.5diff --git a/09-advanced-features/planning-mode-examples.md b/09-advanced-features/planning-mode-examples.mdindex f3cdce1..a1e39ce 100644--- a/09-advanced-features/planning-mode-examples.md+++ b/09-advanced-features/planning-mode-examples.md@@ -533,8 +533,8 @@ Proceed with this plan? (yes/no/modify)7. **Plan for testing** at each phase----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/changelog- https://code.claude.com/docs/en/best-practicesdiff --git a/10-cli/README.md b/10-cli/README.mdindex c74c8a9..45f8bc6 100644--- a/10-cli/README.md+++ b/10-cli/README.md@@ -55,6 +55,7 @@ The older JavaScript bundle is still produced for Windows and for environments t| `claude auto-mode defaults` | Print auto mode default rules as JSON | `claude auto-mode defaults` || `claude remote-control` | Start Remote Control server | `claude remote-control` || `claude plugin` | Manage plugins (install, enable, disable) | `claude plugin install my-plugin` |+| `claude plugin init <name>` | Scaffold a new plugin in `.claude/skills` — auto-loads with no marketplace required (v2.1.157+) | `claude plugin init my-plugin` || `claude plugin tag <version>` | Create a release git tag for a plugin with version validation (v2.1.118+) | `claude plugin tag v0.3.0` || `claude install [version]` | Install a specific native-binary version. Accepts `stable`, `latest`, or an explicit version string | `claude install 2.1.131` || `claude project purge [path]` | Delete all local Claude Code state for a project (transcripts, tasks, debug logs, file-edit history, prompt history, and `~/.claude.json` entry). Omit `[path]` for an interactive picker. Flags: `--dry-run` to preview, `-y/--yes` to skip confirmation, `-i/--interactive` to confirm each item, `--all` for every project (v2.1.126+) | `claude project purge ~/work/repo --dry-run` |@@ -833,7 +834,8 @@ The "ultrathink" keyword in prompts activates deep reasoning. The `/effort` menu| `CLAUDE_CODE_FORCE_SYNC_OUTPUT` | Set to `1` to force synchronous output for terminals where auto-detection misses (e.g., Emacs `eat`) (v2.1.129+) || `CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE` | Set to `1` to enable background upgrades for Homebrew/WinGet installs (which normally do not auto-update) (v2.1.129+) || `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY` | Set to `1` to opt in to gateway `/v1/models` discovery when `ANTHROPIC_BASE_URL` is set. Without it, `/model` shows the built-in static list (v2.1.129+) |-| `CLAUDE_CODE_OPUS_4_6_FAST_MODE_OVERRIDE` | **Deprecated (removed 2026-06-01).** Previously pinned Fast Mode (`/fast`) to Opus 4.6. To use fast mode on Opus 4.6 now, run `/model claude-opus-4-6[1m]` then `/fast on`. |+| `CLAUDE_CODE_ENABLE_AUTO_MODE` | Set to `1` to opt in to auto mode on Bedrock, Vertex, and Foundry for Opus 4.7/4.8 (v2.1.158+) |+| `CLAUDE_CODE_OPUS_4_6_FAST_MODE_OVERRIDE` | **Removed (no-op as of v2.1.160).** Previously pinned Fast Mode (`/fast`) to Opus 4.6. To use fast mode on Opus 4.6 now, run `/model claude-opus-4-6[1m]` then `/fast on`. |> **`ENABLE_TOOL_SEARCH` on Vertex AI (v2.1.119+)**: Tool search is **disabled by default on Google Cloud Vertex AI** deployments. Users who want the tool-search capability on Vertex must explicitly opt in with `export ENABLE_TOOL_SEARCH=true`. On direct Anthropic API it remains enabled by default.@@ -941,8 +943,8 @@ claude -p --output-format json "query"----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/cli-reference- https://code.claude.com/docs/en/settings@@ -954,4 +956,6 @@ claude -p --output-format json "query"- https://github.com/anthropics/claude-code/releases/tag/v2.1.139- https://github.com/anthropics/claude-code/releases/tag/v2.1.142- https://github.com/anthropics/claude-code/releases/tag/v2.1.154+- https://code.claude.com/docs/en/plugins+- https://code.claude.com/docs/en/overview**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.8, Claude Haiku 4.5diff --git a/CATALOG.md b/CATALOG.mdindex 41429d6..ab395c4 100644--- a/CATALOG.md+++ b/CATALOG.md@@ -482,6 +482,8 @@ cp 02-memory/personal-CLAUDE.md ~/.claude/CLAUDE.md| **MCP Elicitation** | MCP servers can request user input during tool execution | Handle via `Elicitation` and `ElicitationResult` hook events || **Plugin LSP Support** | Language Server Protocol integration via plugins | Configure LSP servers in `plugin.json` for editor features || **Managed Drop-ins** | Organization-managed drop-in configurations (v2.1.83) | Admin-configured via managed policies; auto-applied to all users |+| **`claude plugin init`** | Scaffold a new plugin in `.claude/skills`; such plugins auto-load with no marketplace (v2.1.157) | Run `claude plugin init <name>` |+| **Auto Mode on Bedrock/Vertex/Foundry** | Auto mode available on third-party providers for Opus 4.7/4.8 — opt-in (v2.1.158) | Set `CLAUDE_CODE_ENABLE_AUTO_MODE=1` |---@@ -541,12 +543,14 @@ chmod +x ~/.claude/hooks/*.sh----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/overview- https://code.claude.com/docs/en/commands- https://code.claude.com/docs/en/hooks- https://github.com/anthropics/claude-code/releases/tag/v2.1.145- https://github.com/anthropics/claude-code/releases/tag/v2.1.154+- https://code.claude.com/docs/en/plugins+- https://code.claude.com/docs/en/cli-reference**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.8, Claude Haiku 4.5diff --git a/INDEX.md b/INDEX.mdindex f5bb571..4097696 100644--- a/INDEX.md+++ b/INDEX.md@@ -880,8 +880,8 @@ Want to add more examples? Follow the structure:----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/overview- https://code.claude.com/docs/en/hooksdiff --git a/LEARNING-ROADMAP.md b/LEARNING-ROADMAP.mdindex aaad326..2f8613e 100644--- a/LEARNING-ROADMAP.md+++ b/LEARNING-ROADMAP.md@@ -738,8 +738,8 @@ Once you've completed all milestones:----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/overview- https://code.claude.com/docs/en/hooksdiff --git a/QUICK_REFERENCE.md b/QUICK_REFERENCE.mdindex 2636e56..08a46df 100644--- a/QUICK_REFERENCE.md+++ b/QUICK_REFERENCE.md@@ -509,8 +509,8 @@ Getting started checklist:**This Card**: Keep it handy for quick reference!----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/overview- https://code.claude.com/docs/en/hooksdiff --git a/README.md b/README.mdindex 57c4217..7df57d5 100644--- a/README.md+++ b/README.md@@ -12,7 +12,7 @@[](https://github.com/luongnv89/claude-howto/stargazers)[](https://github.com/luongnv89/claude-howto/network/members)[](LICENSE)-[](CHANGELOG.md)+[](CHANGELOG.md)[](https://code.claude.com)🌐 **Language / Ngôn ngữ / 语言 / Мова:** [English](README.md) | [Tiếng Việt](vi/README.md) | [中文](zh/README.md) | [Українська](uk/README.md) | [日本語](ja/README.md)@@ -102,7 +102,7 @@ Run `/lesson-quiz [topic]` after each module. The quiz pinpoints what you missed- **GitHub stars** from developers who use Claude Code daily- **Forks** from teams adapting this guide for their own workflows-- **Actively maintained** — synced with every Claude Code release (latest: v2.1.150, May 2026)+- **Actively maintained** — synced with every Claude Code release (latest: v2.1.160, June 2026)- **Community-driven** — contributions from developers who share their real-world configurations[](https://star-history.com/#luongnv89/claude-howto&Date)@@ -201,7 +201,7 @@ cp -r 03-skills/code-review-specialist ~/.claude/skills/Yes. MIT licensed, free forever. Use it in personal projects, at work, in your team — no restrictions beyond including the license notice.**Is this maintained?**-Actively. The guide is synced with every Claude Code release. Current version: v2.1.150 (May 2026), compatible with Claude Code 2.1+.+Actively. The guide is synced with every Claude Code release. Current version: v2.1.160 (June 2026), compatible with Claude Code 2.1+.**How is this different from the official docs?**The official docs are a feature reference. This guide is a tutorial with diagrams, production-ready templates, and a progressive learning path. They complement each other — start here to learn, reference the docs when you need specifics.@@ -871,12 +871,12 @@ MIT License - see [LICENSE](LICENSE). Free to use, modify, and distribute. The o----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/overview- https://code.claude.com/docs/en/changelog- https://platform.claude.com/docs/en/about-claude/models/overview-- https://github.com/anthropics/claude-code/releases/tag/v2.1.145+- https://github.com/anthropics/claude-code/releases- https://github.com/anthropics/claude-code/releases/tag/v2.1.154**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.8, Claude Haiku 4.5diff --git a/claude_concepts_guide.md b/claude_concepts_guide.mdindex 085567a..ffc7651 100644--- a/claude_concepts_guide.md+++ b/claude_concepts_guide.md@@ -3146,8 +3146,8 @@ Claude Code supports the following models with adaptive reasoning effort:- [Anthropic Cookbook](https://github.com/anthropics/anthropic-cookbook)----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/overview- https://code.claude.com/docs/en/hooksdiff --git a/resources.md b/resources.mdindex a275430..8c5652b 100644--- a/resources.md+++ b/resources.md@@ -252,8 +252,8 @@ These steps capture the core recommendations for smooth workflows with Claude Co| **/run, /verify, /run-skill-generator** | Bundled skills to launch your project, confirm a fix works, and generate per-project run/verify skills (v2.1.145+) | [Skills Guide](03-skills/) |----**Last Updated**: May 29, 2026-**Claude Code Version**: 2.1.156+**Last Updated**: June 2, 2026+**Claude Code Version**: 2.1.160**Sources**:- https://code.claude.com/docs/en/overview- https://code.claude.com/docs/en/changelog