hooks-reference
Skill2 starsChanged 8 months agoMITView on GitHub
Twilio development skill: hooks-reference
- Deletes or force-pushes
- Commits and pushes
In this repository66 other files it gives its agents.
- adversarial-reviewSkill
- agent-connectSkill
- agent-teams-guideSkill
- agent-testingSkill
- android-sdkSkill
- brainstormSkill
- branded-callingSkill
- callbacksSkill
- compliance-regulatorySkill
- conferenceSkill
- context-engineeringSkill
- context-hubSkill
- conversational-intelligenceSkill
- conversation-relay-referenceSkill
- conversation-relaySkill
- conversationrelaySkill
- conversations-v2Skill
- customer-memorySkill
- deepgramSkill
- deep-validationSkill
- elastic-sip-trunkingSkill
- env-doctorSkill
- event-streamsSkill
- getting-startedSkill
- iamSkill
- ios-sdkSkill
- ivr-crawlerSkill
- ivr-migratorSkill
- lookupSkill
- media-streamsSkill
- memory-systemsSkill
- messaging-services-referenceSkill
- messaging-servicesSkill
- messagingSkill
- multi-agent-patternsSkill
- operational-gotchasSkill
- paymentsSkill
- paySkill
- phone-numbersSkill
- proxySkill
- real-time-transcriptionSkill
- recordingsSkill
- segmentSkill
- sendgrid-emailSkill
- sip-byocSkill
- sipSkill
- sync-referenceSkill
- syncSkill
- taskrouter-referenceSkill
- taskrouterSkill
- tdd-workflowSkill
- tool-boundariesSkill
- twilio-cliSkill
- twilio-invariantsSkill
- verify-referenceSkill
- verifySkill
- video-patternsSkill
- videoSkill
- voice-insightsSkill
- voice-referenceSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 38
Fix the hook, don't bypass the system: If a hook is blocking legitimate work:
- Very specific: line 40
Check the bypass tier in .claude/rules/bypass-governance.md — Tier 1 bypasses require user approval
- Distinctive: line 62
Test files without ABOUTME comments
- Very specific: line 85
All bypass invocations emit bypass_used events for audit.
- Very specific: line 89
All hook scripts are in .claude/hooks/ and can be modified to adjust behavior.
- Very specific: line 93
When a Claude Code session ends, archive-plan.sh preserves the current plan file.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
name: hooks-reference description: Reference for project hook configuration. Use when understanding pre/post tool hooks, modifying quality gates, or debugging why a hook blocked an action.
Claude Code Hooks Reference
This project uses Claude Code hooks (configured in .claude/settings.json) to enforce coding standards automatically.
Active Hooks
| Hook | Event | Purpose |
pre-write-validate.sh | PreToolUse (Write/Edit) | Blocks credentials, magic test numbers, learnings bulk-clear, worktree isolation; warns on naming |
pre-bash-validate.sh | PreToolUse (Bash) | Blocks --no-verify, worktree commits, pending-actions, validates deploy |
post-write.sh | PostToolUse (Write/Edit) | Auto-lints JS/TS files, tracks files to .session-files, increments tool-call counter |
flywheel-doc-check.sh | PostToolUse (Write/Edit) | Suggests doc updates based on 4 sources (git status, commits, session-files, pattern-db) |
post-bash.sh | PostToolUse (Bash) | Logs deploy/test completions, increments tool-call counter |
subagent-log.sh | SubagentStop | Logs workflow activity, triggers flywheel |
teammate-idle-check.sh | TeammateIdle | Quality gate before teammate goes idle |
task-completed-check.sh | TaskCompleted | TDD/coverage/credential gate on task completion |
session-checklist.sh | Stop | Warns about uncommitted changes, unpushed commits, stale learnings, MEMORY.md size |
archive-plan.sh | Stop | Archives plan files with metadata |
notify-ready.sh | Stop | Desktop notification when done |
pre-compact.sh | PreCompact | Creates compaction marker for post-compact-summary |
session-start-log.sh | SessionStart (all) | Logs session starts, 8 bootstrap checks (env, CLI, stale session, exercises, updates, context hub, codebase smoke test, MEMORY.md auto-prune), context loading, resets session tracking |
post-compact-summary.sh | SessionStart (compact) | Extracts compaction summary from transcript |
_meta-mode.sh | (sourced by other hooks) | Helper: detects .meta/ directory, sets environment-aware paths |
flywheel-session-summary.sh | (sourced by other hooks) | Helper: generates session summary for flywheel processing |
When a Hook Blocks You
Fix the hook, don't bypass the system. If a hook is blocking legitimate work:
- Open a separate Claude window and fix the hook behavior
- Check the bypass tier in
.claude/rules/bypass-governance.md— Tier 1 bypasses require user approval - NEVER rename
.meta/to disable meta mode — this breaks all session routing
What Gets Blocked (Exit Code 2)
- Hardcoded Twilio credentials (
AC...,SK..., auth tokens) git commit --no-verifyorgit commit -ngit commitwith unaddressed pending-actions.json (override:SKIP_PENDING_ACTIONS=true)git commitwith TypeScript compilation errors in staged.ts/.tsxfiles (override:SKIP_TSC_CHECK=true)- File writes to repo paths when not in a worktree (override:
CLAUDE_ALLOW_MAIN_WRITE=true) git commitwhen not in a worktree (override:CLAUDE_ALLOW_MAIN_WRITE=true)git push --forceto main/master- Deployment when tests fail
- Deployment when coverage < 80% (statements or branches)
- Deployment when linting fails
- New function files without ABOUTME comments
- Twilio magic test numbers (
+15005550xxx) in non-test files
What Gets Warned (Non-blocking)
- Non-evergreen naming patterns (
ImprovedX,NewHandler,BetterY,EnhancedZ) - High-risk assertions in CLAUDE.md files without citations
- Test files without ABOUTME comments
.meta/references in staged changes (potential leakage)
Commit Checklist
On every git commit, the hook displays a reminder checklist:
- Updated
.meta/todo.md? - Captured learnings in
.claude/learnings.md? - Design decision documented if architectural?
Bypass Governance
Hook bypasses are tiered by risk. See .claude/rules/bypass-governance.md for the full reference.
Tier 1 — Require user confirmation before use:
CLAUDE_ALLOW_MAIN_WRITE— Worktree isolation (pre-write + pre-bash)CLAUDE_ALLOW_PRODUCTION_WRITE— Meta-mode isolation (pre-write)SKIP_PIPELINE_GATE— TDD requirement for new functions (pre-write)SKIP_COVERAGE_CHECK— Coverage regression + test deletion (pre-bash)
Tier 2 — Autonomous, logged to events.jsonl:
SKIP_TSC_CHECK,SKIP_PENDING_ACTIONS,SKIP_META_HOOK_CHECK,SKIP_PATH_CHECK,SKIP_LEARNINGS_GUARD
All bypass invocations emit bypass_used events for audit.
Hook Scripts Location
All hook scripts are in .claude/hooks/ and can be modified to adjust behavior.
Plan Archival
When a Claude Code session ends, archive-plan.sh preserves the current plan file.
Environment-aware archival:
| Environment | Writes To | Purpose |
Meta-development (.meta/ exists) | .meta/plans/ | Local plans (gitignored) |
Shipped product (no .meta/) | .claude/archive/plans/ | User plans (committed) |
What gets archived:
- Plans modified within the last hour (likely from current session)
- Plan content with added metadata header (timestamp, branch, project, source)
- Descriptive filename:
YYYY-MM-DD-HHMMSS-plan-title-slug.md
Metadata captured:
archived: 2026-02-01T15:30:45-08:00
branch: main
project: twilio-feature-factory
source: ~/.claude/plans/deep-nibbling-castle.md
title: Plan Title From First HeadingDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

