hooks · worldflowai — Claude Code rule: what it does and how to install
The hooks rule defines actions before and after tool calls, plus a final session check. It helps run code checks and review Git-related changes.
MIT ★ 6,739 updated 2026-01-23
/plugin marketplace add WorldFlowAI/everything-claude-code
/plugin install everything-claude-code@everything-claude-codeWhat hooks does
Before a tool runs, PreToolUse can suggest using tmux for long commands, open Zed before git push, or stop unnecessary .md and .txt files from being created. After edits, Prettier formats JS/TS files, while changes to .ts and .tsx trigger tsc. Other hooks warn about console.log and record the PR URL with the GitHub Actions status.
At session end, the rule scans modified files for console.log. It also recommends TodoWrite for multi-step work, making skipped tasks and misunderstood instructions easier to spot. Auto-accept permissions are reserved for trusted, well-defined plans; exploratory work calls for disabling them. Do not use dangerously-skip-permissions; configure allowedTools in ~/.claude.json instead.
What it helps with
- remind the agent to use tmux for long-running commands
- review changes before
git push - format JS/TS files after edits
- check modified files for
console.logat session end - track missed steps in multi-step tasks
Example prompts for the agent
- Review my changes in Zed before pushing to Git.
- Run the TypeScript check after editing
.tsand.tsxfiles. - Check the modified files for
console.logbefore the session ends.
How to install hooks
1Plugin marketplace
/plugin marketplace add WorldFlowAI/everything-claude-code/plugin install everything-claude-code@everything-claude-code2Manually: put the files in place
.claude/rules/hooks.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/hooks.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/hooks.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/hooks.mdManually: put the files in place
.clinerules/hooks.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about hooks
How do I install hooks in Claude Code?
Run /plugin marketplace add WorldFlowAI/everything-claude-code, then /plugin install everything-claude-code@everything-claude-code. Use the .claude/rules/hooks.md file afterward.
What does the hooks rule do?
It defines actions before and after tool calls and at session end, including formatting code, checking TypeScript, and scanning for console.log.
When should I enable auto-accept permissions?
Only for trusted plans with clearly defined steps. Disable it for exploratory work, and do not use dangerously-skip-permissions.
Source text
hooks.md · MIT
# Hooks System ## Hook Types - **PreToolUse**: Before tool execution (validation, parameter modification) - **PostToolUse**: After tool execution (auto-format, checks) - **Stop**: When session ends (final verification) ## Current Hooks (in ~/.claude/settings.json) ### PreToolUse - **tmux reminder**: Suggests tmux for long-running commands (npm, pnpm, yarn, cargo, etc.) - **git push review**: Opens Zed for review before push - **doc blocker**: Blocks creation of unnecessary .md/.txt files ### PostToolUse - **PR creation**: Logs PR URL and GitHub Actions status - **Prettier**: Auto-formats JS/TS files after edit - **TypeScript check**: Runs tsc after editing .ts/.tsx files - **console.log warning**: Warns about console.log in edited files ### Stop - **console.log audit**: Checks all modified files for console.log before session ends ## Auto-Accept Permissions Use with caution: - Enable for trusted, well-defined plans - Disable for exploratory work - Never use dangerously-skip-permissions flag - Configure `allowedTools` in `~/.claude.json` instead ## TodoWrite Best Practices Use TodoWrite tool to: - Track progress on multi-step tasks - Verify understanding of instructions - Enable real-time steering - Show granular implementation steps Todo list reveals: - Out of order steps - Missing items - Extra unnecessary items - Wrong granularity - Misinterpreted requirements
© Affaan Mustafa · MIT · WorldFlowAI/everything-claude-code
Similar IDE rules
All IDE rules for Agent setup: memory, context, orchestration →hooks by other authors comes first.