Add formatters, hooks, memory entries and context-load improvements
- formatters/js, md, yaml: new/updated formatter scripts - hooks/set-wezterm-profile.sh: new hook for WezTerm profile switching - scripts/context-load: improvements from recent sessions - HOOKS.md, MEMORY.md: updated documentation and index entries - memory/log, memory/reference-infrastructure-docs.md: session logs and reference Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
16
HOOKS.md
16
HOOKS.md
@@ -9,6 +9,7 @@ Claude Code hooks that run automatically in response to events. Source of truth
|
||||
| Pre-compact backup | PreCompact (auto + manual) | `hooks/pre-compact-backup.sh` |
|
||||
| Post-edit lint | PostToolUse (Edit/Write/MultiEdit) | `hooks/post-edit-lint.sh` |
|
||||
| Pre-commit lint | Git pre-commit | `hooks/pre-commit-lint.sh` |
|
||||
| WezTerm profile theme | SessionStart (per-profile) | `hooks/set-wezterm-profile.sh` |
|
||||
|
||||
## Post-edit Lint
|
||||
|
||||
@@ -92,6 +93,21 @@ This symlinks all hooks into `~/.claude/hooks/` and prints the `settings.json` c
|
||||
scripts/setup-formatters.sh <project-dir> <ext> [<ext> ...]
|
||||
```
|
||||
|
||||
## WezTerm Profile Theme
|
||||
|
||||
Sets the WezTerm terminal theme when a Claude session starts or resumes, by emitting an OSC 1337 `SetUserVar` escape sequence. WezTerm fires its `user-var-changed` Lua event and applies the matching color scheme and background image from `wezterm.lua`.
|
||||
|
||||
**Derives profile name** from `CLAUDE_CONFIG_DIR` (e.g. `~/.claude-octopus` → `octopus`). No-ops for the default profile.
|
||||
|
||||
**Writes to `/dev/tty`** to reach WezTerm directly, bypassing Claude Code's stdout capture. Safe in non-WezTerm terminals — the sequence is silently ignored.
|
||||
|
||||
**Configure per profile** in `~/.claude-<name>/settings.json`:
|
||||
```json
|
||||
"SessionStart": [
|
||||
{ "hooks": [{ "type": "command", "command": "~/.claude/hooks/set-wezterm-profile.sh" }] }
|
||||
]
|
||||
```
|
||||
|
||||
## Adding New Hooks
|
||||
|
||||
1. Create the script in `hooks/`
|
||||
|
||||
Reference in New Issue
Block a user