Skip to content

Commit 50eead6

Browse files
Update Claude Code docs - 2025-08-22 | Updated: data-usage.md,hooks-guide.md hooks.md,mcp.md troubleshooting.md
1 parent bf6c682 commit 50eead6

6 files changed

Lines changed: 143 additions & 28 deletions

File tree

docs/data-usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ For full details, please review our [Commercial Terms of Service](https://www.an
3434

3535
## Data flow and dependencies
3636

37-
![Claude Code data flow diagram](https://mintlify.s3.us-west-1.amazonaws.com/anthropic/images/claude-code-data-flow.png)
37+
<img src="https://mintcdn.com/anthropic/images/claude-code-data-flow.png?maxW=1597&auto=format&n=TJyVEsJNS7-wcDQw&q=85&s=fa613fe5084e8c714de3e8251344135d" alt="Claude Code data flow diagram" width="1597" height="1285" data-path="images/claude-code-data-flow.png" srcset="https://mintcdn.com/anthropic/images/claude-code-data-flow.png?w=280&maxW=1597&auto=format&n=TJyVEsJNS7-wcDQw&q=85&s=9b98f9447b3fa42f12bdabf890062c72 280w, https://mintcdn.com/anthropic/images/claude-code-data-flow.png?w=560&maxW=1597&auto=format&n=TJyVEsJNS7-wcDQw&q=85&s=edc5e1f783fae53f9067ba51dcb87d87 560w, https://mintcdn.com/anthropic/images/claude-code-data-flow.png?w=840&maxW=1597&auto=format&n=TJyVEsJNS7-wcDQw&q=85&s=b675e341c4797dbfe8a1c2d32838b6c8 840w, https://mintcdn.com/anthropic/images/claude-code-data-flow.png?w=1100&maxW=1597&auto=format&n=TJyVEsJNS7-wcDQw&q=85&s=e0c22bc2577235900e7b08b351ce9d59 1100w, https://mintcdn.com/anthropic/images/claude-code-data-flow.png?w=1650&maxW=1597&auto=format&n=TJyVEsJNS7-wcDQw&q=85&s=174115b36520b289b985968bf90ad1d7 1650w, https://mintcdn.com/anthropic/images/claude-code-data-flow.png?w=2500&maxW=1597&auto=format&n=TJyVEsJNS7-wcDQw&q=85&s=753faf09b799b3087fdda86d86796a36 2500w" data-optimize="true" data-opv="2" />
3838

3939
Claude Code is installed from [NPM](https://www.npmjs.com/package/@anthropic-ai/claude-code). Claude Code runs locally. In order to interact with the LLM, Claude Code sends data over the network. This data includes all user prompts and model outputs. The data is encrypted in transit via TLS and is not encrypted at rest. Claude Code is compatible with most popular VPNs and LLM proxies.
4040

docs/docs_manifest.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
"data-usage.md": {
4040
"original_url": "https://docs.anthropic.com/en/docs/claude-code/data-usage",
4141
"original_md_url": "https://docs.anthropic.com/en/docs/claude-code/data-usage.md",
42-
"hash": "7a8fd4e7dd09cb1735c9cf62d633d8e43bf5f4cb7c23a389ba0ae64c34185ed6",
43-
"last_updated": "2025-08-06T00:04:51.571452"
42+
"hash": "60bf155d6ba8dbbaede4bd98c03cea0daa25a81db2f3c3dd9e01176bc1eb34fa",
43+
"last_updated": "2025-08-22T21:03:53.426497"
4444
},
4545
"devcontainer.md": {
4646
"original_url": "https://docs.anthropic.com/en/docs/claude-code/devcontainer",
@@ -63,14 +63,14 @@
6363
"hooks.md": {
6464
"original_url": "https://docs.anthropic.com/en/docs/claude-code/hooks",
6565
"original_md_url": "https://docs.anthropic.com/en/docs/claude-code/hooks.md",
66-
"hash": "87e2b8876dab1de54d9838d3720072fe0996ad9112701b9c47deb22dc1f94ac4",
67-
"last_updated": "2025-07-31T03:30:20.759961"
66+
"hash": "4bc290a423a52087fdef7a527616c9f8eb5dfe244a484eb3f06cfb1e1ea035d0",
67+
"last_updated": "2025-08-22T21:03:55.559085"
6868
},
6969
"hooks-guide.md": {
7070
"original_url": "https://docs.anthropic.com/en/docs/claude-code/hooks-guide",
7171
"original_md_url": "https://docs.anthropic.com/en/docs/claude-code/hooks-guide.md",
72-
"hash": "46ec8c1f79e8f78a0f569de5c7391db82a86d7b9868ac9a770a3c603bda51561",
73-
"last_updated": "2025-08-14T18:02:04.728304"
72+
"hash": "a8347a1951dfe7a55e644c95b5dced0ab1bdb5ef387f4e3443dac610a8cac836",
73+
"last_updated": "2025-08-22T21:03:56.085331"
7474
},
7575
"iam.md": {
7676
"original_url": "https://docs.anthropic.com/en/docs/claude-code/iam",
@@ -105,8 +105,8 @@
105105
"mcp.md": {
106106
"original_url": "https://docs.anthropic.com/en/docs/claude-code/mcp",
107107
"original_md_url": "https://docs.anthropic.com/en/docs/claude-code/mcp.md",
108-
"hash": "c7ee422e5476da66d568679d061ea68fcaef48a26b459fe6bf5f831b23546620",
109-
"last_updated": "2025-08-19T21:01:57.038256"
108+
"hash": "3110c23f7a50c398bd6fe914b71b45f4ae5672d68a42e9fa4f5f089c47e3b752",
109+
"last_updated": "2025-08-22T21:03:59.291460"
110110
},
111111
"memory.md": {
112112
"original_url": "https://docs.anthropic.com/en/docs/claude-code/memory",
@@ -195,8 +195,8 @@
195195
"troubleshooting.md": {
196196
"original_url": "https://docs.anthropic.com/en/docs/claude-code/troubleshooting",
197197
"original_md_url": "https://docs.anthropic.com/en/docs/claude-code/troubleshooting.md",
198-
"hash": "37ac345e1928b67a1721e356c43b194c39e3ded2c2dc04785c861f537d92b70e",
199-
"last_updated": "2025-08-19T00:05:07.148425"
198+
"hash": "5893f01fd30bb019501c95d18a2cfd7236c5bf252591dc1901978a2f0722312b",
199+
"last_updated": "2025-08-22T21:04:07.222179"
200200
},
201201
"changelog.md": {
202202
"original_url": "https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md",
@@ -207,8 +207,8 @@
207207
}
208208
},
209209
"fetch_metadata": {
210-
"last_fetch_completed": "2025-08-22T18:05:33.969768",
211-
"fetch_duration_seconds": 17.800251,
210+
"last_fetch_completed": "2025-08-22T21:04:07.257889",
211+
"fetch_duration_seconds": 18.513461,
212212
"total_pages_discovered": 33,
213213
"pages_fetched_successfully": 34,
214214
"pages_failed": 0,
@@ -218,7 +218,7 @@
218218
"total_files": 34,
219219
"fetch_tool_version": "3.0"
220220
},
221-
"last_updated": "2025-08-22T18:05:33.969823",
221+
"last_updated": "2025-08-22T21:04:07.257911",
222222
"base_url": "https://raw.githubusercontent.com/mnestorov/cc-docs-mirror/main/docs/",
223223
"github_repository": "mnestorov/cc-docs-mirror",
224224
"github_ref": "main",

docs/hooks-guide.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ workflow:
4444
* **UserPromptSubmit**: Runs when the user submits a prompt, before Claude processes it
4545
* **Notification**: Runs when Claude Code sends notifications
4646
* **Stop**: Runs when Claude Code finishes responding
47-
* **Subagent Stop**: Runs when subagent tasks complete
47+
* **SubagentStop**: Runs when subagent tasks complete
4848
* **PreCompact**: Runs before Claude Code is about to run a compact operation
4949
* **SessionStart**: Runs when Claude Code starts a new session or resumes an existing session
50+
* **SessionEnd**: Runs when Claude Code session ends
5051

5152
Each event receives different data and can control Claude's behavior in
5253
different ways.

docs/hooks.md

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,18 @@ the stoppage occurred due to a user interrupt.
141141

142142
Runs when a Claude Code subagent (Task tool call) has finished responding.
143143

144+
### SessionEnd
145+
146+
Runs when a Claude Code session ends. Useful for cleanup tasks, logging session
147+
statistics, or saving session state.
148+
149+
The `reason` field in the hook input will be one of:
150+
151+
* `clear` - Session cleared with /clear command
152+
* `logout` - User logged out
153+
* `prompt_input_exit` - User exited while prompt input was visible
154+
* `other` - Other exit reasons
155+
144156
### PreCompact
145157

146158
Runs before Claude Code is about to run a compact operation.
@@ -285,6 +297,18 @@ For `manual`, `custom_instructions` comes from what the user passes into
285297
}
286298
```
287299

300+
### SessionEnd Input
301+
302+
```json
303+
{
304+
"session_id": "abc123",
305+
"transcript_path": "~/.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
306+
"cwd": "/Users/...",
307+
"hook_event_name": "SessionEnd",
308+
"reason": "exit"
309+
}
310+
```
311+
288312
## Hook Output
289313

290314
There are two ways for hooks to return output back to Claude Code. The output
@@ -320,6 +344,7 @@ Hooks communicate status through exit codes, stdout, and stderr:
320344
| `SubagentStop` | Blocks stoppage, shows stderr to Claude subagent |
321345
| `PreCompact` | N/A, shows stderr to user only |
322346
| `SessionStart` | N/A, shows stderr to user only |
347+
| `SessionEnd` | N/A, shows stderr to user only |
323348

324349
### Advanced: JSON Output
325350

@@ -332,8 +357,10 @@ All hook types can include these optional fields:
332357
```json
333358
{
334359
"continue": true, // Whether Claude should continue after hook execution (default: true)
335-
"stopReason": "string" // Message shown when continue is false
360+
"stopReason": "string", // Message shown when continue is false
361+
336362
"suppressOutput": true, // Hide stdout from transcript mode (default: false)
363+
"systemMessage": "string" // Optional warning message shown to the user
337364
}
338365
```
339366

@@ -357,10 +384,9 @@ to Claude.
357384
`PreToolUse` hooks can control whether a tool call proceeds.
358385

359386
* `"allow"` bypasses the permission system. `permissionDecisionReason` is shown
360-
to the user but not to Claude. (*Deprecated `"approve"` value + `reason` has
361-
the same behavior.*)
387+
to the user but not to Claude.
362388
* `"deny"` prevents the tool call from executing. `permissionDecisionReason` is
363-
shown to Claude. (*`"block"` value + `reason` has the same behavior.*)
389+
shown to Claude.
364390
* `"ask"` asks the user to confirm the tool call in the UI.
365391
`permissionDecisionReason` is shown to the user but not to Claude.
366392

@@ -369,24 +395,34 @@ to Claude.
369395
"hookSpecificOutput": {
370396
"hookEventName": "PreToolUse",
371397
"permissionDecision": "allow" | "deny" | "ask",
372-
"permissionDecisionReason": "My reason here (shown to user)"
373-
},
374-
"decision": "approve" | "block" | undefined, // Deprecated for PreToolUse but still supported
375-
"reason": "Explanation for decision" // Deprecated for PreToolUse but still supported
398+
"permissionDecisionReason": "My reason here"
399+
}
376400
}
377401
```
378402

403+
<Note>
404+
The `decision` and `reason` fields are deprecated for PreToolUse hooks.
405+
Use `hookSpecificOutput.permissionDecision` and
406+
`hookSpecificOutput.permissionDecisionReason` instead. The deprecated fields
407+
`"approve"` and `"block"` map to `"allow"` and `"deny"` respectively.
408+
</Note>
409+
379410
#### `PostToolUse` Decision Control
380411

381-
`PostToolUse` hooks can control whether a tool call proceeds.
412+
`PostToolUse` hooks can provide feedback to Claude after tool execution.
382413

383414
* `"block"` automatically prompts Claude with `reason`.
384415
* `undefined` does nothing. `reason` is ignored.
416+
* `"hookSpecificOutput.additionalContext"` adds context for Claude to consider.
385417

386418
```json
387419
{
388420
"decision": "block" | undefined,
389-
"reason": "Explanation for decision"
421+
"reason": "Explanation for decision",
422+
"hookSpecificOutput": {
423+
"hookEventName": "PostToolUse",
424+
"additionalContext": "Additional information for Claude"
425+
}
390426
}
391427
```
392428

@@ -431,6 +467,7 @@ to Claude.
431467
`SessionStart` hooks allow you to load in context at the start of a session.
432468

433469
* `"hookSpecificOutput.additionalContext"` adds the string to the context.
470+
* Multiple hooks' `additionalContext` values are concatenated.
434471

435472
```json
436473
{
@@ -441,6 +478,11 @@ to Claude.
441478
}
442479
```
443480

481+
#### `SessionEnd` Decision Control
482+
483+
`SessionEnd` hooks run when a session ends. They cannot block session termination
484+
but can perform cleanup tasks.
485+
444486
#### Exit Code Example: Bash Command Validation
445487

446488
```python
@@ -682,13 +724,15 @@ This prevents malicious hook modifications from affecting your current session.
682724
* **Timeout**: 60-second execution limit by default, configurable per command.
683725
* A timeout for an individual command does not affect the other commands.
684726
* **Parallelization**: All matching hooks run in parallel
727+
* **Deduplication**: Multiple identical hook commands are deduplicated automatically
685728
* **Environment**: Runs in current directory with Claude Code's environment
686729
* The `CLAUDE_PROJECT_DIR` environment variable is available and contains the
687-
absolute path to the project root directory
730+
absolute path to the project root directory (where Claude Code was started)
688731
* **Input**: JSON via stdin
689732
* **Output**:
690-
* PreToolUse/PostToolUse/Stop: Progress shown in transcript (Ctrl-R)
691-
* Notification: Logged to debug only (`--debug`)
733+
* PreToolUse/PostToolUse/Stop/SubagentStop: Progress shown in transcript (Ctrl-R)
734+
* Notification/SessionEnd: Logged to debug only (`--debug`)
735+
* UserPromptSubmit/SessionStart: stdout added as context for Claude
692736

693737
## Debugging
694738

docs/mcp.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,22 @@ export const MCPServersTable = ({platform = "all"}) => {
115115
claudeDesktop: false
116116
},
117117
notes: "Multiple services available. See documentation for specific server URLs. Claude Code can use the Cloudflare CLI if installed."
118+
}, {
119+
name: "Cloudinary",
120+
category: "Design & Media",
121+
description: "Upload, manage, transform, and analyze your media assets",
122+
documentation: "https://cloudinary.com/documentation/mcp_server",
123+
urls: {
124+
http: "https://mcp.cloudinary.com/mcp"
125+
},
126+
authentication: {
127+
type: "oauth"
128+
},
129+
availability: {
130+
claudeCode: true,
131+
mcpConnector: true,
132+
claudeDesktop: false
133+
}
118134
}, {
119135
name: "Intercom",
120136
category: "Project Management & Documentation",

docs/troubleshooting.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,44 @@ You might encounter the following issues in WSL:
1515

1616
**Node not found errors**: If you see `exec: node: not found` when running `claude`, your WSL environment may be using a Windows installation of Node.js. You can confirm this with `which npm` and `which node`, which should point to Linux paths starting with `/usr/` rather than `/mnt/c/`. To fix this, try installing Node via your Linux distribution's package manager or via [`nvm`](https://github.com/nvm-sh/nvm).
1717

18+
**nvm version conflicts**: If you have nvm installed in both WSL and Windows, you may experience version conflicts when switching Node versions in WSL. This happens because WSL imports the Windows PATH by default, causing Windows nvm/npm to take priority over the WSL installation.
19+
20+
You can identify this issue by:
21+
22+
* Running `which npm` and `which node` - if they point to Windows paths (starting with `/mnt/c/`), Windows versions are being used
23+
* Experiencing broken functionality after switching Node versions with nvm in WSL
24+
25+
To resolve this issue, fix your Linux PATH to ensure the Linux node/npm versions take priority:
26+
27+
**Primary solution: Ensure nvm is properly loaded in your shell**
28+
29+
The most common cause is that nvm isn't loaded in non-interactive shells. Add the following to your shell configuration file (`~/.bashrc`, `~/.zshrc`, etc.):
30+
31+
```bash
32+
# Load nvm if it exists
33+
export NVM_DIR="$HOME/.nvm"
34+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
35+
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
36+
```
37+
38+
Or run directly in your current session:
39+
40+
```bash
41+
source ~/.nvm/nvm.sh
42+
```
43+
44+
**Alternative: Adjust PATH order**
45+
46+
If nvm is properly loaded but Windows paths still take priority, you can explicitly prepend your Linux paths to PATH in your shell configuration:
47+
48+
```bash
49+
export PATH="$HOME/.nvm/versions/node/$(node -v)/bin:$PATH"
50+
```
51+
52+
<Warning>
53+
Avoid disabling Windows PATH importing (`appendWindowsPath = false`) as this breaks the ability to easily call Windows executables from WSL. Similarly, avoid uninstalling Node.js from Windows if you use it for Windows development.
54+
</Warning>
55+
1856
### Linux and Mac installation issues: permission or command not found errors
1957

2058
When installing Claude Code with npm, `PATH` problems may prevent access to `claude`.
@@ -169,6 +207,22 @@ pacman -S ripgrep
169207

170208
Then set `USE_BUILTIN_RIPGREP=0` in your [environment](/en/docs/claude-code/settings#environment-variables).
171209

210+
### Slow or incomplete search results on WSL
211+
212+
Disk read performance penalties when [working across file systems on WSL](https://learn.microsoft.com/en-us/windows/wsl/filesystems) may result in fewer-than-expected matches (but not a complete lack of search functionality) when using Claude Code on WSL.
213+
214+
<Note>
215+
`/doctor` will show Search as OK in this case.
216+
</Note>
217+
218+
**Solutions:**
219+
220+
1. **Submit more specific searches**: Reduce the number of files searched by specifying directories or file types: "Search for JWT validation logic in the auth-service package" or "Find use of md5 hash in JS files".
221+
222+
2. **Move project to Linux filesystem**: If possible, ensure your project is located on the Linux filesystem (`/home/`) rather than the Windows filesystem (`/mnt/c/`).
223+
224+
3. **Use native Windows instead**: Consider running Claude Code natively on Windows instead of through WSL, for better file system performance.
225+
172226
## Markdown formatting issues
173227

174228
Claude Code sometimes generates markdown files with missing language tags on code fences, which can affect syntax highlighting and readability in GitHub, editors, and documentation tools.

0 commit comments

Comments
 (0)