PreToolUse hook for the Bash tool. When the user writes a pipeline whose
left side changes state (git push, kubectl apply, curl -X PUT, ...) and
whose exit status is then consumed by && / || / an if-condition, the
hook exits 2 and surfaces an advisory naming the masking command and
suggesting ${PIPESTATUS[0]} or dropping the pipe.
Always exits 0 on parse failure, missing python3, empty input, malformed
JSON, or anything it does not recognise — a hook that breaks Bash is
worse than the bug it prevents.
Real-process tests in hooks/tests/ feed JSON on stdin as a subprocess and
include mutation cases (six targeted matcher breakages) to prove each
assertion can actually fail.
Injects a reminder to read the project's memory/gotchas-minimax.md when a prompt mentions
MiniMax or mm-worktree-task, once per session, with the real resolved path. Supervising
MiniMax units has repeatable failure modes (claimed-green dodges, fakes-only tests, a unit
routing around a permission gate) and the write-ups only help if they are opened.
Never blocks: always exits 0 on missing jq, malformed stdin or an unwritable TMPDIR.
Installed into both custom config homes (anthropic + minimax).
Claude-Session: https://claude.ai/code/session_014KNyfHmHpMbdMrHZXDRkAp
Add a sentinel-file escape hatch: if `.claude/skip-plan-file-check`
exists in the project's cwd, the ExitPlanMode hook exits 0 without
demanding a local *-PLAN.md file.
Needed by projects (e.g. agent-runtimes) that manage plans via an
external system (work-items CP) rather than local repo files.
- pre-compact-backup.sh: derive transcript path from session_id+cwd (no
longer relies on transcript_path field that Claude Code stopped providing);
register each backup in tracking.json after saving
- extract-transcripts.py: new script managing tracking.json — register,
list, extract conversation text, mark-processed modes
- list-transcripts-here.sh: thin wrapper for extract-transcripts --list
using $(pwd); needed because SKILL.md bang commands reject $() substitution
- install-hooks.sh: now also symlinks skill-helper scripts into
~/.claude/scripts/ via a curated SKILL_HELPERS list
- Memory docs: new script-extract-transcripts.md, script-list-transcripts-here.md;
updated skill-log.md, script-install-hooks.md, MEMORY.md index
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Includes: spec-driven and test-driven development best practices,
reproduce-before-fixing debugging workflow, require-plan-file hook,
find-project-root script, session logs, memory files for decisions/
gotchas/process-lessons, and updates to existing best practice topics.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PostToolUse hook auto-formats files after Edit/Write/MultiEdit with
git-blob checkpoints for safe revert. Pre-commit hook for staged files.
Canonical formatter scripts for py, sh, ts, sql, json (+ symlinks for
js, yaml, md). Install and setup scripts for project opt-in.
Includes best-practices/linting.md, HOOKS.md docs, README.md, and
session log.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Hook source of truth now in hooks/, symlinked from ~/.claude/hooks/.
HOOKS.md covers what each hook does and installation steps.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>