SpyBara
Go Premium

Documentation 2025-11-03 21:01 UTC to 2025-11-04 18:02 UTC

4 files changed +52 −203. View all changes and history on the product overview
2025
Thu 27 06:02 Wed 26 00:04 Tue 25 03:22 Mon 24 21:01 Fri 21 00:04 Thu 20 18:02 Wed 19 03:21 Tue 18 18:02 Mon 17 03:24 Sun 16 00:04 Fri 14 21:26 Thu 6 18:02 Tue 4 18:02 Mon 3 21:01 Sun 2 18:01 Sat 1 21:01

hooks.md +0 −100

Details

295 295 

296Recognizes the same matcher values as PreToolUse.296Recognizes the same matcher values as PreToolUse.

297 297 

298### PostCustomToolCall

299 

300Runs after an MCP tool completes but **before** `PostToolUse` hooks execute. This hook allows you to modify the tool's output before it's processed further or shown to the model.

301 

302**Key characteristics:**

303 

304* **Only runs for MCP tools** (tools starting with `mcp__`)

305* Executes after the tool completes but before `PostToolUse` hooks

306* Can modify tool output using the `updatedOutput` field

307* Original tool response is replaced with modified output

308 

309**Common use cases:**

310 

311* Adding metadata to MCP tool responses

312* Filtering sensitive information from tool outputs

313* Transforming response formats

314* Logging MCP tool usage with enriched data

315 

316**Important**: If multiple hooks provide `updatedOutput` for the same tool call, they may conflict. Hook execution order is non-deterministic when hooks run in parallel. Only configure one hook per tool to modify output.

317 

318**Matchers:**

319Recognizes the same matcher values as PreToolUse, but will only execute for MCP tools (`mcp__*`).

320 

321### Notification298### Notification

322 299 

323Runs when Claude Code sends notifications. Notifications are sent when:300Runs when Claude Code sends notifications. Notifications are sent when:


482}459}

483```460```

484 461 

485### PostCustomToolCall Input

486 

487The exact schema for `tool_input` and `tool_response` depends on the MCP tool.

488 

489```json theme={null}

490{

491 "session_id": "abc123",

492 "transcript_path": "/Users/.../.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",

493 "cwd": "/Users/...",

494 "permission_mode": "default",

495 "hook_event_name": "PostCustomToolCall",

496 "tool_name": "mcp__github__create_issue",

497 "tool_input": {

498 "title": "Bug report",

499 "body": "Description of the issue"

500 },

501 "tool_response": {

502 "issue_number": 42,

503 "url": "https://github.com/org/repo/issues/42"

504 }

505}

506```

507 

508### Notification Input462### Notification Input

509 463 

510```json theme={null}464```json theme={null}


713}667}

714```668```

715 669 

716#### `PostCustomToolCall` Output Control

717 

718`PostCustomToolCall` hooks can modify MCP tool outputs before they're processed further.

719 

720* `"hookSpecificOutput.updatedOutput"` replaces the original tool response

721* The modified output is shown to Claude instead of the original response

722* This runs **before** `PostToolUse` hooks, so they see the modified output

723 

724```json theme={null}

725{

726 "hookSpecificOutput": {

727 "hookEventName": "PostCustomToolCall",

728 "updatedOutput": {

729 "issue_number": 42,

730 "url": "https://github.com/org/repo/issues/42",

731 "hook_processed": true,

732 "processed_at": "2025-01-01T00:00:00Z"

733 }

734 }

735}

736```

737 

738**Example: Adding metadata to MCP tool responses**

739 

740```bash theme={null}

741#!/bin/bash

742# Read JSON input from stdin

743INPUT=$(cat)

744 

745# Extract tool information

746TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name')

747TOOL_RESPONSE=$(echo "$INPUT" | jq -r '.tool_response')

748 

749# Only process MCP tools

750if [[ "$TOOL_NAME" != mcp__* ]]; then

751 exit 0

752fi

753 

754# Add metadata to the response

755UPDATED_OUTPUT=$(echo "$TOOL_RESPONSE" | jq '. + {"hook_processed": true, "processed_at": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}')

756 

757# Output the modified response

758jq -n --argjson output "$UPDATED_OUTPUT" '{

759 "hookSpecificOutput": {

760 "hookEventName": "PostCustomToolCall",

761 "updatedOutput": $output

762 }

763}'

764```

765 

766<Warning>

767 If multiple hooks provide `updatedOutput` for the same tool call, conflicts may occur since hooks run in parallel. Only configure one hook per tool to modify output.

768</Warning>

769 

770#### `UserPromptSubmit` Decision Control670#### `UserPromptSubmit` Decision Control

771 671 

772`UserPromptSubmit` hooks can control whether a user prompt is processed.672`UserPromptSubmit` hooks can control whether a user prompt is processed.

output-styles.md +40 −101

Details

1# Output styles1# Output styles

2 2 

3> [DEPRECATED] Adapt Claude Code for uses beyond software engineering3> Adapt Claude Code for uses beyond software engineering

4 

5<Warning>

6 Output styles are **DEPRECATED.** On **November 5, 2025** or later, we'll

7 stop supporting the output styles feature. Use `--system-prompt-file`,

8 `--system-prompt`, `--append-system-prompt`, CLAUDE.md, or [plugins](/en/docs/claude-code/plugins) instead.

9 For **Explanatory** output style users, you can reference the ([explanatory-output-style

10 plugin](https://github.com/anthropics/claude-code/tree/main/plugins/explanatory-output-style)

11 in our public repository.)

12</Warning>

13 

14## Deprecation timeline

15 

16As of **November 5, 2025**, Claude Code will:

17 

18* Stop supporting the output styles feature

19* Remove the `/output-style` command and related functionality

20 

21## Alternative for Custom Output Styles

22 

23Use `--system-prompt-file` to start a Claude Code session with your own system

24prompt. You can also use `--system-prompt` to pass in a string to use as the system prompt, or

25`--append-system-prompt` to add to the default Claude Code system prompt.

26 

27## Alternative for Explanatory Output Style: explanatory-output-style Plugin

28 

29Plugins provide more powerful and flexible ways to customize Claude Code's

30behavior. The

31[`explanatory-output-style` plugin](https://github.com/anthropics/claude-code/tree/main/plugins/explanatory-output-style)

32recreates the deprecated Explanatory output style functionality.

33 

34### Example: Explanatory Output Style Plugin

35 

36The `explanatory-output-style` plugin uses a SessionStart hook to inject

37additional context that encourages Claude to provide educational insights.

38Here's what it does:

39 

40* Provides educational insights about implementation choices

41* Explains codebase patterns and decisions

42* Balances task completion with learning opportunities

43 

44### Installing a plugin

45 

46To install a plugin like `explanatory-output-style`:

47 

48```shell Add the marketplace (if not already added) theme={null}

49/plugin marketplace add anthropics/claude-code

50```

51 

52```shell Install the plugin theme={null}

53/plugin install explanatory-output-style@claude-code-plugins

54```

55 

56```shell Restart Claude Code to activate the plugin theme={null}

57/exit

58```

59 

60```shell Disable the plugin theme={null}

61/plugin manage explanatory-output-style@claude-code-plugins

62 

631. Press enter when you see claude-code-marketplace

642. Press space when you see explanatory-output-style to toggle enabled

653. Press down to "Apply changes", then press enter

66 You should see "Disabled 1 plugin. Restart Claude Code to apply changes."

67 

68/exit

69```

70 

71For more details on plugins, see the

72[Plugins documentation](/en/docs/claude-code/plugins).

73 

74***

75 

76## Reference: Original output styles documentation

77 

78<Note>

79 The content below is preserved for reference only. Output styles are

80 deprecated and will be removed on November 5, 2025. Please migrate to plugins,

81 hooks, or subagents.

82</Note>

83 4 

84Output styles allow you to use Claude Code as any type of agent while keeping5Output styles allow you to use Claude Code as any type of agent while keeping

85its core capabilities, such as running local scripts, reading/writing files, and6its core capabilities, such as running local scripts, reading/writing files, and

86tracking TODOs.7tracking TODOs.

87 8 

88### Built-in output styles9## Built-in output styles

89 10 

90Claude Code's **Default** output style is the existing system prompt, designed11Claude Code's **Default** output style is the existing system prompt, designed

91to help you complete software engineering tasks efficiently.12to help you complete software engineering tasks efficiently.


102 pieces of code yourself. Claude Code will add `TODO(human)` markers in your23 pieces of code yourself. Claude Code will add `TODO(human)` markers in your

103 code for you to implement.24 code for you to implement.

104 25 

105### How output styles work26## How output styles work

106 27 

107Output styles directly modify Claude Code's system prompt.28Output styles directly modify Claude Code's system prompt.

108 29 


112* Instead, these output styles have their own custom instructions added to the33* Instead, these output styles have their own custom instructions added to the

113 system prompt.34 system prompt.

114 35 

115### Change your output style36## Change your output style

116 37 

117You can either:38You can either:

118 39 


125These changes apply to the [local project level](/en/docs/claude-code/settings)46These changes apply to the [local project level](/en/docs/claude-code/settings)

126and are saved in `.claude/settings.local.json`.47and are saved in `.claude/settings.local.json`.

127 48 

128You can also create your own output style Markdown files and save them either at49## Create a custom output style

129the user level (`~/.claude/output-styles`) or the project level

130(`.claude/output-styles`).

131 50 

132### Comparisons to related features51To set up a new output style with Claude's help, run

52`/output-style:new I want an output style that ...`

133 53 

134#### Output Styles vs. CLAUDE.md vs. System Prompt Flags54By default, output styles created through `/output-style:new` are saved as

55markdown files at the user level in `~/.claude/output-styles` and can be used

56across projects. They have the following structure:

135 57 

136Output styles completely "turn off" the parts of Claude Code's default system58```markdown theme={null}

137prompt specific to software engineering.59---

60name: My Custom Style

61description:

62 A brief description of what this style does, to be displayed to the user

63---

64 

65# Custom Style Instructions

66 

67You are an interactive CLI tool that helps users with software engineering

68tasks. [Your custom instructions here...]

69 

70## Specific Behaviors

71 

72[Define how the assistant should behave in this style...]

73```

138 74 

139**CLAUDE.md** adds the contents as a user message *following* Claude Code's default system75You can also create your own output style Markdown files and save them either at

140prompt, rather than modifying the system prompt itself.76the user level (`~/.claude/output-styles`) or the project level

77(`.claude/output-styles`).

141 78 

142**System prompt CLI flags** provide different levels of control:79## Comparisons to related features

143 80 

144* `--append-system-prompt`: Appends text to the end of the default system prompt81### Output Styles vs. CLAUDE.md vs. --append-system-prompt

145* `--system-prompt`: Replaces the entire default system prompt with custom text

146* `--system-prompt-file`: Loads a custom system prompt from a file

147 82 

148See the [CLI reference](/en/docs/claude-code/cli-reference#system-prompt-flags) for detailed guidance on when to use each flag.83Output styles completely "turn off" the parts of Claude Code's default system

84prompt specific to software engineering. Neither CLAUDE.md nor

85`--append-system-prompt` edit Claude Code's default system prompt. CLAUDE.md

86adds the contents as a user message *following* Claude Code's default system

87prompt. `--append-system-prompt` appends the content to the system prompt.

149 88 

150#### Output Styles vs. [Agents](/en/docs/claude-code/sub-agents)89### Output Styles vs. [Agents](/en/docs/claude-code/sub-agents)

151 90 

152Output styles directly affect the main agent loop and only affect the system91Output styles directly affect the main agent loop and only affect the system

153prompt. Agents are invoked to handle specific tasks and can include additional92prompt. Agents are invoked to handle specific tasks and can include additional

154settings like the model to use, the tools they have available, and some context93settings like the model to use, the tools they have available, and some context

155about when to use the agent.94about when to use the agent.

156 95 

157#### Output Styles vs. [Custom Slash Commands](/en/docs/claude-code/slash-commands)96### Output Styles vs. [Custom Slash Commands](/en/docs/claude-code/slash-commands)

158 97 

159You can think of output styles as stored system prompts and custom slash98You can think of output styles as "stored system prompts" and custom slash

160commands as stored prompts.99commands as "stored prompts".

overview.md +4 −0

Details

92## Additional resources92## Additional resources

93 93 

94<CardGroup>94<CardGroup>

95 <Card title="Build with the Agent SDK" icon="code-branch" href="/en/api/agent-sdk/overview">

96 Create custom AI agents with the Claude Agent SDK

97 </Card>

98 

95 <Card title="Host on AWS or GCP" icon="cloud" href="/en/docs/claude-code/third-party-integrations">99 <Card title="Host on AWS or GCP" icon="cloud" href="/en/docs/claude-code/third-party-integrations">

96 Configure Claude Code with Amazon Bedrock or Google Vertex AI100 Configure Claude Code with Amazon Bedrock or Google Vertex AI

97 </Card>101 </Card>

settings.md +8 −2

Details

44 "env": {44 "env": {

45 "CLAUDE_CODE_ENABLE_TELEMETRY": "1",45 "CLAUDE_CODE_ENABLE_TELEMETRY": "1",

46 "OTEL_METRICS_EXPORTER": "otlp"46 "OTEL_METRICS_EXPORTER": "otlp"

47 }47 },

48 "companyAnnouncements": [

49 "Welcome to Acme Corp! Review our code guidelines at docs.acme.com",

50 "Reminder: Code reviews required for all PRs",

51 "New security policy in effect"

52 ]

48}53}

49```54```

50 55 


53`settings.json` supports a number of options:58`settings.json` supports a number of options:

54 59 

55| Key | Description | Example |60| Key | Description | Example |

56| :--------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------- |61| :--------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------- |

57| `apiKeyHelper` | Custom script, to be executed in `/bin/sh`, to generate an auth value. This value will be sent as `X-Api-Key` and `Authorization: Bearer` headers for model requests | `/bin/generate_temp_api_key.sh` |62| `apiKeyHelper` | Custom script, to be executed in `/bin/sh`, to generate an auth value. This value will be sent as `X-Api-Key` and `Authorization: Bearer` headers for model requests | `/bin/generate_temp_api_key.sh` |

58| `cleanupPeriodDays` | How long to locally retain chat transcripts based on last activity date (default: 30 days) | `20` |63| `cleanupPeriodDays` | How long to locally retain chat transcripts based on last activity date (default: 30 days) | `20` |

64| `companyAnnouncements` | Announcement to display to users at startup. If multiple announcements are provided, they will be cycled through at random. | `["Welcome to Acme Corp! Review our code guidelines at docs.acme.com"]` |

59| `env` | Environment variables that will be applied to every session | `{"FOO": "bar"}` |65| `env` | Environment variables that will be applied to every session | `{"FOO": "bar"}` |

60| `includeCoAuthoredBy` | Whether to include the `co-authored-by Claude` byline in git commits and pull requests (default: `true`) | `false` |66| `includeCoAuthoredBy` | Whether to include the `co-authored-by Claude` byline in git commits and pull requests (default: `true`) | `false` |

61| `permissions` | See table below for structure of permissions. | |67| `permissions` | See table below for structure of permissions. | |