One read of Claude Code CLIclaude-code-20261110T163701Z
4 pages moved out of 228 read.
Pages moved
4
significant first
Pages read
228
in this capture
Captured
16:37 UTC
Corpus hash
323a5c36c79a
corpus-hash
What this read moved
1-4 of 4costs Changed · +6 / -6 lines
from line 288
288288
289289Custom [hooks](https://code.claude.com/docs/en/hooks.md) can preprocess data before Claude sees it. Instead of Claude reading a 10,000-line log file to find errors, a hook can grep for `ERROR` and return only matching lines, reducing context from tens of thousands of tokens to hundreds.
290290
291A [skill](https://code.claude.com/docs/en/skills.md) can give Claude domain knowledge so it doesn't have to explore. For example, a "codebase-overview" skill could describe your project's architecture, key directories, and naming conventions. When Claude invokes the skill, it gets this context immediately instead of spending tokens reading multiple files to understand the structure.
291This PreToolUse hook trims test output to its last 100 lines:
292292
293For example, this PreToolUse hook filters test output to show only failures:
294
295293> [tab] settings.json
296294>
297295> Add this to your [settings.json](https://code.claude.com/docs/en/settings.md#where-settings-live) to run the hook before every Bash command:
from line 314
316314
317315> [tab] filter-test-output.sh
318316>
319> The hook calls this script. Create the folder with `mkdir -p ~/.claude/hooks`, save the script below as `~/.claude/hooks/filter-test-output.sh`, and make it executable with `chmod +x ~/.claude/hooks/filter-test-output.sh`. It checks if the command is a test runner and modifies it to show only failures:
317> The hook calls this script. Create the folder with `mkdir -p ~/.claude/hooks`, save the script below as `~/.claude/hooks/filter-test-output.sh`, and make it executable with `chmod +x ~/.claude/hooks/filter-test-output.sh`. It checks if the command is a test runner and, if so, keeps only the last 100 lines of its output:
320318>
321319> ```bash theme={null}
322320> #!/bin/bash
from line 321
323321> input=$(cat)
324322> cmd=$(echo "$input" | jq -r '.tool_input.command')
325323>
326> # If running tests, filter to show only failures
324> # If running tests, keep only the last 100 lines
327325> pattern='^(npm test|pytest|go test)( [^;&|<>`$#\\[:cntrl:]]*)?$'
328326> if [[ "$cmd" =~ $pattern ]]; then
329> filtered_cmd="$cmd 2>&1 | grep -A 5 -E '(FAIL|ERROR|error:)' | head -100"
327> filtered_cmd="$cmd 2>&1 | tail -n 100"
330328> echo "$input" | jq --arg filtered "$filtered_cmd" \
331329> '{hookSpecificOutput: {hookEventName: "PreToolUse", updatedInput: (.tool_input + {command: $filtered})}}'
332330> else
from line 333
335333> ```
336334
337335To verify the setup, run `/hooks` and check that the hook appears under PreToolUse. You can also start Claude Code with `claude --debug-file ./claude-debug.txt` and ask Claude to run `npm test`. When the hook rewrites the command, that log file contains a `modified tool input keys` line listing `command` and the other Bash input fields.
336
337A [skill](https://code.claude.com/docs/en/skills.md) can give Claude domain knowledge so it doesn't have to explore. For example, a "codebase-overview" skill could describe your project's architecture, key directories, and naming conventions. When Claude invokes the skill, it gets this context immediately instead of spending tokens reading multiple files to understand the structure.
338338
339339### Move instructions from CLAUDE.md to skills
340340
desktop Changed · +1 / -1 lines
from line 252
252252
253253### Minimize a pane
254254
255To keep the Terminal, Browser, or [iOS Simulator](https://code.claude.com/docs/en/desktop-ios-simulator.md) in view at a small size, click **Minimize** in the pane's header. The button requires Claude Desktop v4.0.0 or later and a Claude account rather than a [third-party provider](https://code.claude.com/docs/en/third-party-integrations.md). The Browser pane has it only in local sessions.
255To keep the Terminal, Browser, [iOS Simulator](https://code.claude.com/docs/en/desktop-ios-simulator.md), or a [side chat](#ask-a-side-question-without-derailing-the-session) in view at a small size, click **Minimize** in the pane's header. The button requires Claude Desktop v4.0.0 or later and a Claude account rather than a [third-party provider](https://code.claude.com/docs/en/third-party-integrations.md). The Browser pane has it only in local sessions.
256256
257257The minimized pane sits in the [session details panel](#see-session-details) while that panel is on screen, and floats in a corner of the chat otherwise:
258258
monitoring-usage Changed · +2 / -2 lines
from line 519
519519export OTEL_METRICS_EXPORTER=otlp
520520export OTEL_LOGS_EXPORTER=otlp
521521export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=http/protobuf
522export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://metrics.example.com:4318
522export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://metrics.example.com:4318/v1/metrics
523523export OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=grpc
524524export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=http://logs.example.com:4317
525525```
from line 1782
17821782## Security and privacy
17831783
17841784* OpenTelemetry export to your backend is opt-in and requires explicit configuration. For Anthropic's separate operational telemetry and how to disable it, see [Data usage](https://code.claude.com/docs/en/data-usage.md#telemetry-services)
1785* Raw file contents and code snippets are not included in metrics or events. Trace spans are a separate data path: see the `OTEL_LOG_TOOL_CONTENT` bullet below
1785* By default, raw file contents and code snippets aren't included in metrics or events. If you set a variable such as `OTEL_LOG_TOOL_DETAILS` or `OTEL_LOG_RAW_API_BODIES`, events can include them. Trace spans are a separate data path: see the `OTEL_LOG_TOOL_CONTENT` bullet below
17861786* When authenticated via OAuth, `user.email` is included in telemetry attributes, sent only to the OTel endpoint you configure, never to Anthropic. If this is a concern for your organization, work with your telemetry backend to filter or redact this field
17871787* User prompt content is not collected by default. Only prompt length is recorded. To include prompt content, set `OTEL_LOG_USER_PROMPTS=1`. When enabled:
17881788 * `user_prompt` events carry the prompt text in two attributes, `prompt` and [`prompt_text`](#user-prompt-event). If you drop or mask the event's prompt text by attribute name in your collector, name both attributes in the rule
server-managed-settings Changed · +1 / -1 lines
from line 58
5858
5959Hooks use the same format as in `settings.json`.
6060
61This example runs an audit script after every file edit across the organization:
61This example runs an audit script after `Edit` and `Write` tool calls across the organization:
6262
6363```json theme={null}
6464{