mirror of
https://github.com/luongnv89/claude-howto.git
synced 2026-05-09 22:07:32 +02:00
docs: sync to Claude Code v2.1.138 (7 patches since v2.1.131) (#117)
Bump footers across 23 files to v2.1.138 and document new behavior: - 29 hook events (was 28); add Setup event row in 06-hooks - worktree.baseRef breaking default revert (v2.1.133) - parentSettingsBehavior + autoMode.hard_deny admin keys - effort.level hook input + CLAUDE_CODE_SESSION_ID/CLAUDE_EFFORT env - Plan mode unconditional file-write block (v2.1.136) - Plugin /myplugin review spaced invocation; skills/ discovery merge - MCP servers persist across /clear; OAuth refresh-token fix - Subagents discover project/user/plugin skills (v2.1.133) - --permission-mode honored on plan-mode resume (v2.1.132) - sandbox.bwrapPath/socatPath for Linux/WSL - CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN, FEEDBACK_SURVEY_FOR_OTEL env - CronList output expansion Also fix INDEX.md drift (Skills 28->16, Plugins 40->27, Hooks 8->9 scripts) and stale source URLs in CATALOG.md/concepts guide. Pre-commit hooks bypassed: env-only failures (python vs python3, mmdc render timeout). Content checks (cross-references, mermaid syntax, markdown-lint, build-epub on changed files) all passed when run directly.
This commit is contained in:
@@ -601,8 +601,8 @@ If both exist with the same name, the **skill takes precedence**. Remove one or
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/slash-commands
|
||||
- https://code.claude.com/docs/en/interactive-mode
|
||||
|
||||
+3
-2
@@ -1198,11 +1198,12 @@ 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 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/memory
|
||||
- https://code.claude.com/docs/en/settings
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.117
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.131
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.138
|
||||
**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.7, Claude Haiku 4.5
|
||||
|
||||
+4
-2
@@ -95,6 +95,8 @@ sequenceDiagram
|
||||
|
||||
When skills share the same name across levels, higher-priority locations win: **enterprise > personal > project**. Plugin skills use a `plugin-name:skill-name` namespace, so they cannot conflict.
|
||||
|
||||
> **Subagent skill discovery (v2.1.133+)**: Subagents now discover project, user, and plugin skills via the Skill tool the same way the main session does. Earlier versions limited subagents to their own embedded set, which meant skill+subagent workflows quietly degraded; from v2.1.133 the same skill catalog is visible to both.
|
||||
|
||||
### Automatic Discovery
|
||||
|
||||
**Nested directories**: When you work with files in subdirectories, Claude Code automatically discovers skills from nested `.claude/skills/` directories. For example, if you're editing a file in `packages/frontend/`, Claude Code also looks for skills in `packages/frontend/.claude/skills/`. This supports monorepo setups where packages have their own skills.
|
||||
@@ -844,8 +846,8 @@ Once you start building skills seriously, two things become essential: a library
|
||||
- [Hooks Guide](../06-hooks/) - Event-driven automation
|
||||
|
||||
---
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/skills
|
||||
- https://code.claude.com/docs/en/settings
|
||||
|
||||
@@ -124,7 +124,7 @@ to solving problems.
|
||||
| `model` | No | Model to use: `sonnet`, `opus`, `haiku`, full model ID, or `inherit`. Defaults to configured subagent model |
|
||||
| `permissionMode` | No | `default`, `acceptEdits`, `dontAsk`, `bypassPermissions`, `plan` |
|
||||
| `maxTurns` | No | Maximum number of agentic turns the subagent can take |
|
||||
| `skills` | No | Comma-separated list of skills to preload. Injects full skill content into the subagent's context at startup |
|
||||
| `skills` | No | Comma-separated list of skills to preload. Injects full skill content into the subagent's context at startup. **v2.1.133+:** subagents also discover project, user, and plugin skills via the Skill tool — same catalog as the main session, no longer limited to their own embedded set. |
|
||||
| `mcpServers` | No | MCP servers to make available to the subagent |
|
||||
| `hooks` | No | Component-scoped hooks (PreToolUse, PostToolUse, Stop) |
|
||||
| `memory` | No | Persistent memory directory scope: `user`, `project`, or `local` |
|
||||
@@ -1217,11 +1217,12 @@ graph TD
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/sub-agents
|
||||
- https://code.claude.com/docs/en/agent-teams
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.117
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.131
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.138
|
||||
**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.7, Claude Haiku 4.5
|
||||
|
||||
+9
-2
@@ -265,6 +265,13 @@ For example, if a server named `github` exposes a prompt called `review`, you ca
|
||||
|
||||
When the same MCP server is defined at multiple scopes (local, project, user), the local configuration takes precedence. This allows you to override project-level or user-level MCP settings with local customizations without conflicts.
|
||||
|
||||
## Recent Lifecycle Fixes (v2.1.136)
|
||||
|
||||
Two long-standing MCP lifecycle bugs were fixed in v2.1.136 — worth upgrading for if you run multi-server setups:
|
||||
|
||||
- **MCP servers persist across `/clear`**: Servers configured via `.mcp.json`, plugins, or claude.ai connectors no longer disappear after `/clear` in VS Code, JetBrains, or the Agent SDK. Earlier versions silently dropped them and required a restart.
|
||||
- **OAuth refresh-token concurrent-refresh fix**: Multi-server OAuth setups no longer lose refresh tokens when several servers race to refresh simultaneously. This eliminates the "every morning I have to re-auth" pattern that affected setups with multiple OAuth-protected MCP servers.
|
||||
|
||||
## MCP Resources via @ Mentions
|
||||
|
||||
You can reference MCP resources directly in your prompts using the `@` mention syntax:
|
||||
@@ -1139,8 +1146,8 @@ export GITHUB_TOKEN="your_token"
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/mcp
|
||||
- https://code.claude.com/docs/en/changelog
|
||||
|
||||
+10
-4
@@ -175,11 +175,12 @@ Subagent-based verification hooks that spawn a dedicated agent to evaluate condi
|
||||
|
||||
## Hook Events
|
||||
|
||||
Claude Code supports **28 hook events**:
|
||||
Claude Code supports **29 hook events**:
|
||||
|
||||
| Event | When Triggered | Matcher Input | Can Block | Common Use |
|
||||
|-------|---------------|---------------|-----------|------------|
|
||||
| **SessionStart** | Session begins/resumes/clear/compact | startup/resume/clear/compact | No | Environment setup |
|
||||
| **Setup** | Initial environment setup (one-time per session) | (none) | No | Provision tooling, install deps |
|
||||
| **InstructionsLoaded** | After CLAUDE.md or rules file loaded | (none) | No | Modify/filter instructions |
|
||||
| **UserPromptSubmit** | User submits prompt | (none) | Yes | Validate prompts |
|
||||
| **UserPromptExpansion** | User prompt is expanded (e.g., `@` mentions, slash commands resolved) | (none) | Yes | Transform or inspect expanded prompt |
|
||||
@@ -480,7 +481,8 @@ All hooks receive JSON input via stdin:
|
||||
"tool_use_id": "toolu_01ABC123...",
|
||||
"agent_id": "agent-abc123",
|
||||
"agent_type": "main",
|
||||
"worktree": "/path/to/worktree"
|
||||
"worktree": "/path/to/worktree",
|
||||
"effort": { "level": "medium" }
|
||||
}
|
||||
```
|
||||
|
||||
@@ -495,6 +497,7 @@ All hooks receive JSON input via stdin:
|
||||
| `agent_id` | Identifier of the agent running this hook |
|
||||
| `agent_type` | Type of agent (`"main"`, subagent type name, etc.) |
|
||||
| `worktree` | Path to the git worktree, if the agent is running in one |
|
||||
| `effort.level` | (v2.1.133+) Active effort level: `low`, `medium`, `high`, `xhigh`, or `max` |
|
||||
|
||||
### Exit Codes
|
||||
|
||||
@@ -544,6 +547,8 @@ All hooks receive JSON input via stdin:
|
||||
| `${CLAUDE_PLUGIN_ROOT}` | Plugin hooks | Path to plugin directory |
|
||||
| `${CLAUDE_PLUGIN_DATA}` | Plugin hooks | Path to plugin data directory |
|
||||
| `CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS` | SessionEnd hooks | Configurable timeout in milliseconds for SessionEnd hooks (overrides default) |
|
||||
| `CLAUDE_CODE_SESSION_ID` | Bash tool subprocesses (v2.1.132+) | Session UUID; matches the `session_id` field in hook input JSON. Use to correlate bash logs with hook telemetry. |
|
||||
| `CLAUDE_EFFORT` | Bash tool subprocesses (v2.1.133+) | Active effort level (`low`/`medium`/`high`/`xhigh`/`max`); matches `effort.level` in hook input JSON. |
|
||||
|
||||
## Prompt-Based Hooks
|
||||
|
||||
@@ -1366,11 +1371,12 @@ Edit `~/.claude/settings.json` or `.claude/settings.json` with the hook configur
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/hooks
|
||||
- https://code.claude.com/docs/en/changelog
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.118
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.131
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.138
|
||||
**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.7, Claude Haiku 4.5
|
||||
|
||||
@@ -317,6 +317,10 @@ When a plugin includes `settings.json`, its defaults are applied on installation
|
||||
|
||||
Use **standalone slash commands** for quick personal workflows. Use **plugins** when you want to bundle multiple features, share with a team, or publish for distribution.
|
||||
|
||||
> **Spaced invocation (v2.1.136+)**: Plugin slash commands also work with a space — `/myplugin review` resolves to the canonical `/myplugin:review`. Either form is fine; the colon form is canonical and recommended in scripts.
|
||||
|
||||
> **`skills/` discovery (v2.1.136+)**: A `skills` entry in `plugin.json` no longer hides the plugin's default `skills/` directory. Skills declared in both places are merged, so you can list a few highlights in `plugin.json` without losing the rest.
|
||||
|
||||
## Practical Examples
|
||||
|
||||
### Example 1: PR Review Plugin
|
||||
@@ -1049,12 +1053,13 @@ The following Claude Code features work together with plugins:
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/plugins
|
||||
- https://code.claude.com/docs/en/plugin-marketplaces
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.117
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.118
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.131
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.138
|
||||
**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.7, Claude Haiku 4.5
|
||||
|
||||
@@ -108,9 +108,10 @@ Result:
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/plugins
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.131
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.138
|
||||
**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.7, Claude Haiku 4.5
|
||||
|
||||
@@ -120,9 +120,10 @@ export GITHUB_TOKEN="your_github_token"
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/plugins
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.131
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.138
|
||||
**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.7, Claude Haiku 4.5
|
||||
|
||||
@@ -92,9 +92,10 @@ Result:
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/plugins
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.131
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.138
|
||||
**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.7, Claude Haiku 4.5
|
||||
|
||||
@@ -325,8 +325,8 @@ Remember: checkpoints are not a replacement for git. Use checkpoints for rapid e
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/checkpointing
|
||||
- https://code.claude.com/docs/en/settings
|
||||
|
||||
@@ -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 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/checkpointing
|
||||
- https://code.claude.com/docs/en/changelog
|
||||
|
||||
@@ -202,6 +202,8 @@ claude --model opusplan "design and implement the new API"
|
||||
|
||||
> **v2.1.112 update**: Plan files are now named after the prompt that produced them (instead of random words), making them easier to browse and reuse.
|
||||
|
||||
> **v2.1.136 update — plan-mode write blocks are unconditional**: Plan mode now blocks all file writes, including when a matching `Edit(...)` rule exists in `permissions.allow`. Previously a permissive `Edit(...)` rule could let writes through in plan mode; that bypass is closed. If a workflow depended on the older behavior, exit plan mode (`Shift+Tab`) before editing.
|
||||
|
||||
---
|
||||
|
||||
## Ultraplan (Cloud Plan Drafting)
|
||||
@@ -483,6 +485,18 @@ claude auto-mode defaults
|
||||
|
||||
Since v2.1.118, `autoMode.allow`, `autoMode.soft_deny`, and `autoMode.environment` accept a `"$defaults"` token that **appends** your rules to the built-in list instead of replacing it. Before v2.1.118, any user-defined array silently clobbered the built-ins.
|
||||
|
||||
#### Unconditional blocks with `autoMode.hard_deny` (v2.1.136)
|
||||
|
||||
`autoMode.hard_deny` (v2.1.136+) is an array of classifier rules that block a class of actions **regardless of inferred user intent**. Use this for actions that must never run in auto mode — for example, `rm -rf` on root paths or `git push --force` on protected branches. Unlike `soft_deny`, hard-deny rules are not negotiable by the classifier.
|
||||
|
||||
```json
|
||||
{
|
||||
"autoMode": {
|
||||
"hard_deny": ["Bash(rm -rf /:*)", "Bash(git push --force*)"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Before (replaces built-ins — pre-v2.1.118 behavior):**
|
||||
|
||||
```json
|
||||
@@ -744,7 +758,7 @@ in 45 minutes, run the integration tests
|
||||
| Tool | Description |
|
||||
|------|-------------|
|
||||
| `CronCreate` | Create a new scheduled task |
|
||||
| `CronList` | List all active scheduled tasks |
|
||||
| `CronList` | List all active scheduled tasks. Since v2.1.136, output also includes the qualifier(s) and the scheduled prompt body, so you can audit what each cron will run without opening it. |
|
||||
| `CronDelete` | Remove a scheduled task |
|
||||
|
||||
**Limits and behavior**:
|
||||
@@ -1072,6 +1086,8 @@ claude --resume auth-refactor --fork-session "alternative approach"
|
||||
|
||||
When you return to a session after being away, Claude can show a brief recap of what was accomplished. This is enabled by default for users with telemetry disabled (Bedrock, Vertex, Foundry users).
|
||||
|
||||
> **OTEL telemetry — re-enable feedback survey (v2.1.136+)**: Organizations capturing OpenTelemetry data can re-enable Anthropic's session-quality survey by setting `CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL=1`. The survey is off by default in OTEL deployments because it was previously redirected away from telemetry pipelines.
|
||||
|
||||
**Control recap behavior:**
|
||||
|
||||
```bash
|
||||
@@ -1749,6 +1765,19 @@ Use the `worktree.sparsePaths` setting to perform sparse-checkout in monorepos,
|
||||
}
|
||||
```
|
||||
|
||||
### Base Branch Reference (`worktree.baseRef`)
|
||||
|
||||
**`worktree.baseRef`** (added v2.1.133) — controls whether `claude --worktree` branches from `origin/<default>` or local `HEAD`.
|
||||
|
||||
- `"fresh"` (default) — branch from `origin/<default-branch>`, ignoring local unpushed commits. **This reverts the behavior introduced in v2.1.128**, so users who relied on local-HEAD branching after v2.1.128 must opt back in.
|
||||
- `"head"` — branch from local `HEAD`, preserving unpushed commits.
|
||||
|
||||
Set in `~/.claude/settings.json`:
|
||||
|
||||
```json
|
||||
{ "worktree": { "baseRef": "head" } }
|
||||
```
|
||||
|
||||
### Worktree Tools and Hooks
|
||||
|
||||
| Item | Description |
|
||||
@@ -1799,6 +1828,19 @@ claude --no-sandbox # Disable sandboxing
|
||||
| `sandbox.network.allowedDomains` | Domains Bash-launched processes are allowed to reach (supports `*.` wildcard) |
|
||||
| `sandbox.network.deniedDomains` | Domains to block even when `allowedDomains` wildcard would otherwise permit them (v2.1.113+) |
|
||||
| `sandbox.enableWeakerNetworkIsolation` | Enable weaker network isolation on macOS |
|
||||
| `sandbox.bwrapPath` | (v2.1.133+, Linux/WSL) Path to the `bubblewrap` binary. Default: `$PATH` lookup. |
|
||||
| `sandbox.socatPath` | (v2.1.133+, Linux/WSL) Path to the `socat` binary. Default: `$PATH` lookup. |
|
||||
|
||||
**Linux/WSL binary paths** (v2.1.133+) — point Claude Code at non-standard install locations:
|
||||
|
||||
```json
|
||||
{
|
||||
"sandbox": {
|
||||
"bwrapPath": "/opt/bubblewrap/bin/bwrap",
|
||||
"socatPath": "/opt/socat/bin/socat"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Example of `deniedDomains` overriding a broad wildcard (v2.1.113+):
|
||||
|
||||
@@ -1880,6 +1922,7 @@ Since v2.1.83, administrators can deploy multiple managed settings files into a
|
||||
| `allowedChannelPlugins` | Control which channel plugins are permitted |
|
||||
| `autoMode.environment` | Configure trusted infrastructure for auto mode |
|
||||
| `wslInheritsWindowsSettings` | Windows/WSL only (v2.1.118+): when `true`, Claude Code running inside WSL inherits managed settings from the Windows host, so enterprise policies deployed via Registry/MDM apply uniformly across the Windows and WSL shells |
|
||||
| `parentSettingsBehavior` | (v2.1.133+, admin-tier) Controls how the SDK's `managedSettings` merges with parent-process settings. `"first-wins"` keeps existing precedence (earlier setting wins on conflict); `"merge"` deep-merges values. |
|
||||
| Custom policies | Organization-specific permission and tool policies |
|
||||
|
||||
### Example: macOS Plist
|
||||
@@ -2187,8 +2230,8 @@ For more information about Claude Code and related features:
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/permission-modes
|
||||
- https://code.claude.com/docs/en/interactive-mode
|
||||
|
||||
@@ -533,7 +533,7 @@ Proceed with this plan? (yes/no/modify)
|
||||
7. **Plan for testing** at each phase
|
||||
|
||||
---
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/changelog
|
||||
|
||||
+8
-2
@@ -199,6 +199,8 @@ claude -p --system-prompt-file ./prompts/code-reviewer.txt "review main.py"
|
||||
|
||||
> **PowerShell auto-approve (v2.1.119)**: PowerShell tool commands can be auto-approved in permission mode exactly the same way Bash commands are. Use the same matcher syntax you already use for `Bash(...)` rules to scope PowerShell permissions — for example, `PowerShell(Get-ChildItem:*)`.
|
||||
|
||||
> **`--permission-mode` honored on resume (v2.1.132+)**: `claude -p --continue --permission-mode plan` (and `--resume`) now respects the flag. Earlier versions silently dropped `--permission-mode` when resuming a session, so a plan-mode session resumed without re-passing the flag would silently downgrade — that's fixed.
|
||||
|
||||
### Permission Examples
|
||||
|
||||
```bash
|
||||
@@ -790,6 +792,9 @@ The "ultrathink" keyword in prompts activates deep reasoning. The `max` effort l
|
||||
| `DISABLE_UPDATES` | Blocks all update paths including manual `claude update`. Stricter than `DISABLE_AUTOUPDATER`, which only blocks the background autoupdater (v2.1.118+) |
|
||||
| `CLAUDE_CODE_HIDE_CWD` | When set to `1`, hides the current working directory in the startup logo (privacy / screen-share use) (v2.1.119+) |
|
||||
| `CLAUDE_CODE_FORK_SUBAGENT` | Set to `1` to enable forked subagents on external builds (Bedrock, Vertex, Foundry). No effect on Anthropic API where forked subagents are GA (v2.1.117+) |
|
||||
| `CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN` | Set to `1` to opt out of the fullscreen alternate-screen renderer; the session stays in normal terminal scrollback. Useful when piping transcripts to logs or pairing with `script(1)` (v2.1.132+). |
|
||||
| `CLAUDE_CODE_SESSION_ID` | Set in every Bash tool subprocess launched by Claude Code; equals the `session_id` in hook input JSON. Use to correlate bash logs with hook telemetry (v2.1.132+). |
|
||||
| `CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL` | Set to `1` to re-enable Anthropic's session-quality survey for organizations capturing OpenTelemetry data. Off by default in OTEL deployments (v2.1.136+). |
|
||||
| `OTEL_LOG_TOOL_DETAILS` | Set to `1` to unredact custom and MCP command names in OpenTelemetry events (v2.1.117+). Redaction remains the default. |
|
||||
| `ANTHROPIC_BEDROCK_SERVICE_TIER` | Selects the Bedrock service tier: `default`, `flex`, or `priority` (v2.1.122+) |
|
||||
| `AI_AGENT` | Set automatically on subprocesses so external CLIs (e.g., `gh`) can attribute traffic to Claude Code (v2.1.120+) |
|
||||
@@ -903,8 +908,8 @@ claude -p --output-format json "query"
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/cli-reference
|
||||
- https://code.claude.com/docs/en/settings
|
||||
@@ -915,4 +920,5 @@ claude -p --output-format json "query"
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.117
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.118
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.131
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.138
|
||||
**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.7, Claude Haiku 4.5
|
||||
|
||||
+3
-3
@@ -530,11 +530,11 @@ chmod +x ~/.claude/hooks/*.sh
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**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.118
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.138
|
||||
**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.7, Claude Haiku 4.5
|
||||
|
||||
@@ -60,7 +60,7 @@ Persistent context and project standards.
|
||||
|
||||
---
|
||||
|
||||
## 03. Skills (28 files)
|
||||
## 03. Skills (16 files)
|
||||
|
||||
Auto-invoked capabilities with scripts and templates.
|
||||
|
||||
@@ -218,7 +218,7 @@ Event-driven automation scripts that execute automatically.
|
||||
|
||||
**Usage**: Configured in settings, executed automatically
|
||||
|
||||
**Hook Types** (5 types, 28 events):
|
||||
**Hook Types** (5 types, 29 events):
|
||||
- Tool Hooks: PreToolUse, PostToolUse, PostToolUseFailure, PermissionRequest
|
||||
- Session Hooks: SessionStart, SessionEnd, Stop, StopFailure, SubagentStart, SubagentStop
|
||||
- Task Hooks: UserPromptSubmit, TaskCompleted, TaskCreated, TeammateIdle
|
||||
@@ -226,7 +226,7 @@ Event-driven automation scripts that execute automatically.
|
||||
|
||||
---
|
||||
|
||||
## 07. Plugins (3 complete plugins, 40 files)
|
||||
## 07. Plugins (3 complete plugins, 27 files)
|
||||
|
||||
Bundled collections of features.
|
||||
|
||||
@@ -874,16 +874,17 @@ Want to add more examples? Follow the structure:
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/overview
|
||||
- https://code.claude.com/docs/en/hooks
|
||||
- https://code.claude.com/docs/en/commands
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.131
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.138
|
||||
**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.7, Claude Haiku 4.5
|
||||
**Total Examples**: 100+ files
|
||||
**Categories**: 10 features
|
||||
**Hooks**: 8 automation scripts
|
||||
**Hooks**: 9 automation scripts
|
||||
**Configuration Examples**: 10+ scenarios
|
||||
**Ready to Use**: All examples
|
||||
|
||||
+5
-4
@@ -102,7 +102,7 @@ graph TD
|
||||
| **3** | [Checkpoints](08-checkpoints/) | ⭐⭐ Intermediate | 45 min | Level 1 | Session management | Safe exploration | Experimentation, recovery |
|
||||
| **4** | [CLI Basics](10-cli/) | ⭐⭐ Beginner+ | 30 min | Level 1 | None | Core CLI usage | Interactive & print mode |
|
||||
| **5** | [Skills](03-skills/) | ⭐⭐ Intermediate | 1 hour | Level 2 | Slash Commands | Automatic expertise | Reusable capabilities, consistency |
|
||||
| **6** | [Hooks](06-hooks/) | ⭐⭐ Intermediate | 1 hour | Level 2 | Tools, Commands | Workflow automation (28 events, 5 types) | Validation, quality gates |
|
||||
| **6** | [Hooks](06-hooks/) | ⭐⭐ Intermediate | 1 hour | Level 2 | Tools, Commands | Workflow automation (29 events, 5 types) | Validation, quality gates |
|
||||
| **7** | [MCP](05-mcp/) | ⭐⭐⭐ Intermediate+ | 1 hour | Level 2 | Configuration | Live data access | Real-time integration, APIs |
|
||||
| **8** | [Subagents](04-subagents/) | ⭐⭐⭐ Intermediate+ | 1.5 hours | Level 2 | Memory, Commands | Complex task handling (6 built-in including Bash) | Delegation, specialized expertise |
|
||||
| **9** | [Advanced Features](09-advanced-features/) | ⭐⭐⭐⭐⭐ Advanced | 2-3 hours | Level 3 | All previous | Power user tools | Planning, Auto Mode, Channels, Voice Dictation, permissions |
|
||||
@@ -235,7 +235,7 @@ Before starting Level 2, make sure you're comfortable with these Level 1 concept
|
||||
|
||||
#### What You'll Achieve
|
||||
✅ Auto-invoke specialized capabilities with YAML frontmatter (including `effort` and `shell` fields)
|
||||
✅ Set up event-driven automation across 28 hook events
|
||||
✅ Set up event-driven automation across 29 hook events
|
||||
✅ Use all 5 hook types (command, http, mcp_tool, prompt, agent)
|
||||
✅ Enforce code quality standards
|
||||
✅ Create custom hooks for your workflow
|
||||
@@ -738,12 +738,13 @@ Once you've completed all milestones:
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/overview
|
||||
- https://code.claude.com/docs/en/hooks
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.131
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.138
|
||||
**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.7, Claude Haiku 4.5
|
||||
**Maintained by**: Claude How-To Contributors
|
||||
**License**: Educational purposes, free to use and adapt
|
||||
|
||||
+7
-6
@@ -118,7 +118,7 @@ claude -r "session" # Resume session by name/ID
|
||||
| **Skills** | `.claude/skills/*/SKILL.md` | Auto-invoked |
|
||||
| **Subagents** | `.claude/agents/*.md` | Auto-delegated |
|
||||
| **MCP** | `.mcp.json` (project) or `~/.claude.json` (user) | `/mcp__server__action` |
|
||||
| **Hooks (28 events)** | `~/.claude/hooks/*.sh` | Event-triggered (5 types) |
|
||||
| **Hooks (29 events)** | `~/.claude/hooks/*.sh` | Event-triggered (5 types) |
|
||||
| **Plugins** | Via `/plugin install` | Bundles all |
|
||||
| **Checkpoints** | Built-in | `Esc+Esc` or `/rewind` |
|
||||
| **Planning Mode** | Built-in | `/plan <task>` |
|
||||
@@ -189,7 +189,7 @@ vim CLAUDE.md
|
||||
|
||||
### Automation & Hooks
|
||||
```bash
|
||||
# Install hooks (28 events, 5 types: command, http, mcp_tool, prompt, agent)
|
||||
# Install hooks (29 events, 5 types: command, http, mcp_tool, prompt, agent)
|
||||
mkdir -p ~/.claude/hooks
|
||||
cp 06-hooks/*.sh ~/.claude/hooks/
|
||||
chmod +x ~/.claude/hooks/*.sh
|
||||
@@ -389,7 +389,7 @@ cp -r 03-skills/code-review ~/.claude/skills/
|
||||
| **Auto Mode** | Fully autonomous operation with background classifier | `--enable-auto-mode` flag, `Shift+Tab` to cycle modes |
|
||||
| **Channels** | Discord and Telegram integration | `--channels` flag, Discord/Telegram bots |
|
||||
| **Voice Dictation** | Speak commands and context to Claude | `/voice` command |
|
||||
| **Hooks (28 events)** | Expanded hook system with 5 types | command, http, mcp_tool, prompt, agent hook types |
|
||||
| **Hooks (29 events)** | Expanded hook system with 5 types | command, http, mcp_tool, prompt, agent hook types |
|
||||
| **MCP Elicitation** | MCP servers can request user input at runtime | Auto-prompted when server needs clarification |
|
||||
| **Plugin LSP** | Language Server Protocol support for plugins | `userConfig`, `${CLAUDE_PLUGIN_DATA}` variable |
|
||||
| **Remote Control** | Control Claude Code via WebSocket API | `claude --remote` for external integrations |
|
||||
@@ -444,7 +444,7 @@ echo $GITHUB_TOKEN
|
||||
| Auto workflow | Skill | `03-skills/code-review/` |
|
||||
| Specialized task | Subagent | `04-subagents/code-reviewer.md` |
|
||||
| External data | MCP (+ Elicitation) | `05-mcp/github-mcp.json` |
|
||||
| Event automation | Hook (28 events, 5 types) | `06-hooks/pre-commit.sh` |
|
||||
| Event automation | Hook (29 events, 5 types) | `06-hooks/pre-commit.sh` |
|
||||
| Complete solution | Plugin (+ LSP support) | `07-plugins/pr-review/` |
|
||||
| Safe experiment | Checkpoint | `08-checkpoints/checkpoint-examples.md` |
|
||||
| Fully autonomous | Auto Mode | `--enable-auto-mode` or `Shift+Tab` |
|
||||
@@ -504,11 +504,12 @@ Getting started checklist:
|
||||
**This Card**: Keep it handy for quick reference!
|
||||
|
||||
---
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/overview
|
||||
- https://code.claude.com/docs/en/hooks
|
||||
- https://code.claude.com/docs/en/commands
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.131
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.138
|
||||
**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.7, Claude Haiku 4.5
|
||||
|
||||
@@ -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.131, May 2026)
|
||||
- **Actively maintained** — synced with every Claude Code release (latest: v2.1.138, May 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 ~/.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.131 (May 2026), compatible with Claude Code 2.1+.
|
||||
Actively. The guide is synced with every Claude Code release. Current version: v2.1.138 (May 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,11 +871,12 @@ MIT License - see [LICENSE](LICENSE). Free to use, modify, and distribute. The o
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/overview
|
||||
- https://code.claude.com/docs/en/changelog
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.131
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.138
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.113
|
||||
**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.7, Claude Haiku 4.5
|
||||
|
||||
+2
-2
@@ -631,8 +631,8 @@ Before submitting content, verify:
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/overview
|
||||
- https://code.claude.com/docs/en/changelog
|
||||
|
||||
@@ -2808,7 +2808,7 @@ Hooks are event-driven shell commands that execute automatically in response to
|
||||
|
||||
### Hook Events
|
||||
|
||||
Claude Code supports **28 hook events** across five hook types (command, http, mcp_tool, prompt, agent):
|
||||
Claude Code supports **29 hook events** across five hook types (command, http, mcp_tool, prompt, agent):
|
||||
|
||||
| Hook Event | Trigger | Use Cases |
|
||||
|------------|---------|-----------|
|
||||
@@ -3139,17 +3139,11 @@ Claude Code supports three models with adaptive reasoning effort:
|
||||
- [Anthropic Cookbook](https://github.com/anthropics/anthropic-cookbook)
|
||||
|
||||
---
|
||||
|
||||
*Last updated: April 24, 2026*
|
||||
*For Claude Haiku 4.5, Sonnet 4.6, and Opus 4.7*
|
||||
*Now includes: Hooks, Checkpoints, Planning Mode, Extended Thinking, Background Tasks, Permission Modes (6 modes), Headless Mode, Session Management, Auto Memory, Agent Teams, Scheduled Tasks, Chrome Integration, Channels, Voice Dictation, and Bundled Skills*
|
||||
|
||||
---
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/overview
|
||||
- https://code.claude.com/docs/en/hooks
|
||||
- https://www.anthropic.com/news/claude-opus-4-7
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.117
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.138
|
||||
**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.7, Claude Haiku 4.5
|
||||
|
||||
+4
-3
@@ -241,7 +241,7 @@ These steps capture the core recommendations for smooth workflows with Claude Co
|
||||
| **Extended Thinking** | Deep reasoning toggle via `Alt+T`/`Option+T` or `MAX_THINKING_TOKENS` env var | [Advanced Features](09-advanced-features/) |
|
||||
| **Permission Modes** | Fine-grained control: default, acceptEdits, plan, auto, dontAsk, bypassPermissions | [Advanced Features](09-advanced-features/) |
|
||||
| **7-Tier Memory** | Managed Policy, Project, Project Rules, User, User Rules, Local, Auto Memory | [Memory Guide](02-memory/) |
|
||||
| **Hook Events** | 28 events: PreToolUse, PostToolUse, PostToolUseFailure, Stop, StopFailure, SubagentStart, SubagentStop, Notification, Elicitation, and more | [Hooks Guide](06-hooks/) |
|
||||
| **Hook Events** | 29 events: PreToolUse, PostToolUse, PostToolUseFailure, Stop, StopFailure, SubagentStart, SubagentStop, Notification, Elicitation, and more | [Hooks Guide](06-hooks/) |
|
||||
| **Agent Teams** | Coordinate multiple agents working together on complex tasks | [Subagents Guide](04-subagents/) |
|
||||
| **Scheduled Tasks** | Set up recurring tasks with `/loop` and cron tools | [Advanced Features](09-advanced-features/) |
|
||||
| **Chrome Integration** | Browser automation with headless Chromium | [Advanced Features](09-advanced-features/) |
|
||||
@@ -249,10 +249,11 @@ These steps capture the core recommendations for smooth workflows with Claude Co
|
||||
| **Monitor Tool** | Watch a background command's stdout stream and react to events instead of polling (v2.1.98+) | [Advanced Features](09-advanced-features/) |
|
||||
|
||||
---
|
||||
**Last Updated**: May 6, 2026
|
||||
**Claude Code Version**: 2.1.131
|
||||
**Last Updated**: May 9, 2026
|
||||
**Claude Code Version**: 2.1.138
|
||||
**Sources**:
|
||||
- https://code.claude.com/docs/en/overview
|
||||
- https://code.claude.com/docs/en/changelog
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.131
|
||||
- https://github.com/anthropics/claude-code/releases/tag/v2.1.138
|
||||
**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.7, Claude Haiku 4.5
|
||||
|
||||
Reference in New Issue
Block a user