Claude Code configuration and hooks
Know which layer owns the behavior
Section titled “Know which layer owns the behavior”Edit the owner. Changes in ~/.claude/plugins/ disappear at the next reconciliation.
| Concern | Source | Inspect |
|---|---|---|
| Shared instructions | agents-common.md, CLAUDE.md.tmpl | chezmoi diff |
| Settings/status line | settings.json, executable_statusline.sh | jq . ~/.claude/settings.json |
| Interactive model default | claude-defaults.sh, .zshrc, .bashrc | type claude |
| Plugin declarations | claude-plugins.txt | claude plugin list --json |
| Hook scopes | claude-hook-scope.py, hook-scope.sh | jq . ~/.claude/hook-scope-state.json |
The shared voice arrives through Claude’s cade output style. Project instructions still own project build, test, and deployment work.
The user setting selects claude-opus-5-5 at xhigh effort, with 1M context
enabled by default, with Sonnet 5.5 as the configured fallback. The effort is also stored in
modelSettings.claude-opus-5-5.effortLevel: Opus 5.5 ignores the older top-level
user effortLevel setting. On NVIDIA hosts, server-managed settings select
Sonnet again at startup even though Opus remains allowed. The interactive shell
launcher therefore supplies --model claude-opus-5-5 --effort xhigh for session
commands. Explicit model or
effort flags win independently; management commands such as claude mcp,
claude auth, claude plugin, claude doctor, and claude update bypass the
launcher defaults unchanged. Resumed sessions retain the model stored in their
transcript.
After applying the managed files, open a new shell and run:
claudeExpected result: a new session starts on Opus 5.5 at xhigh; confirm with
/model and /effort status. Higher effort spends more tokens on reasoning.
See model configuration
for model-specific effort settings and context behavior.
Plugin and hook lifecycle
Section titled “Plugin and hook lifecycle”install/claude.sh installs the CLI, reads the marketplace inventory, refreshes declared marketplaces, reconciles plugins, and regenerates narrow hook gates. An inventory failure stops before marketplace or plugin changes; resolve authentication or managed-settings failures before retrying. After an intentional direct plugin update:
bash ~/dotfiles/install/claude.sh sync-hooksjq . ~/.claude/hook-scope-state.jsonExpected result: generated scope and drift state are printed. The generator narrows reviewed Hookify and Lean gates; upstream implementation drift restores the full upstream check and records a warning. Hookify still follows rule globs; Lean prompt checks remain for /lean4: and Bash checks use physical ancestor project markers.
Observe overhead without inventing a speedup
Section titled “Observe overhead without inventing a speedup”The status line stores aggregate transcript statistics and offsets under ${XDG_CACHE_HOME:-~/.cache}/claude-statusline, not transcript text. It incrementally handles appends; replacement, truncation, equal-size timestamp changes, and boundary-fingerprint changes invalidate cache state. This is not an end-to-end latency claim.
The shared chezmoi guard uses fresh ownership observation and resolves lexical/physical aliases. Third-party adapters fail open if its executable is unavailable; inspect the deployed helper before treating it as enforcement. Preserve inputs, cache state, versions, and focused test evidence. See hook overhead.
Practical routes
Section titled “Practical routes”researcher: source-grounded, read-heavy work; no editor tools.reviewer: adversarial review after implementation; no edits.df-agent-doctor: post-bootstrap component check; not account, GUI, or running-session proof.
Before changing schemas, check current hooks and plugins documentation.