Skip to main content
rule CX Codex

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

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add WorldFlowAI/everything-claude-code
/plugin install everything-claude-code@everything-claude-code
Open on GitHub

What 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.log at 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 .ts and .tsx files.
  • Check the modified files for console.log before the session ends.

How to install hooks

1Plugin marketplace

/plugin marketplace add WorldFlowAI/everything-claude-code
/plugin install everything-claude-code@everything-claude-code

2Manually: put the files in place

.claude/rules/hooks.md

The paths frontmatter field limits the files

Step 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.

hooks official github A GitHub Copilot rule on writing hooks: config under .github/hooks/, Bash and PowerShell scripts, exit codes, and how to block an action. CX Codex +1 ★ 41,430repo stars eslint sanjeed5 A Cursor rule for configuring ESLint in JavaScript and TypeScript projects. It covers stricter checks, common coding mistakes, and formatting conflicts with Prettier. CX Codex +1 ★ 3,589repo stars linting-expert carlrannaberg linting-expert is a Claude Code subagent for code linting, formatting, and static analysis. It joins requests about coding standards, security checks, and CI/CD quality gates. CX Codex ★ 763repo stars lsp-format-code blackwell-systems lsp-format-code — a skill for Claude Code formats source files or selected line ranges via language servers. Runs right after code generation or before git commits to normalize whitespace. CX Codex +1 ★ 182repo stars eslint-prettier-config patricio0312rev eslint-prettier-config sets up ESLint and Prettier in a TypeScript and React project: configs, rules, scripts and a pre-commit hook. CX Codex +1 1,100installs spatie-javascript Spatie spatie-javascript applies Spatie's JavaScript and TypeScript coding conventions across projects, configures Prettier, and enforces clean syntax in Vue or TS files. CX Codex +1 580installs typescript siviter-xyz typescript is a Claude Code skill that sets standards for writing and changing TypeScript. It activates for TypeScript and TypeScript React files. CX Codex +1 239installs

From the same set29

The whole set →
patterns patterns sets standard TypeScript interfaces for APIs and repositories, provides a useDebounce hook, and defines a workflow for evaluating skeleton repos. CX Codex +1 ★ 6,739repo stars verify The verify command checks the build, types, lint, tests, logs, and Git state. Use it before a commit or pull request. CX Codex +1 ★ 6,739repo stars performance performance — a Claude Code rule that matches model to task and keeps heavy refactors away from the tail of the context window. CX Codex +1 ★ 6,739repo stars coding-style coding-style is a Claude Code rule for code structure and quality checks. It applies while an agent writes or changes code. CX Codex +1 ★ 6,739repo stars agents Defines nine agents in ~/.claude/agents/ for different development tasks: planning, design, testing, code review, and more. Run them in parallel for independent work. CX Codex +1 ★ 6,739repo stars checkpoint Saves named Git checkpoints during a Claude Code workflow and compares changed files, test results, and test coverage against earlier marks. CX Codex +1 ★ 6,739repo stars learn The learn slash command turns reusable lessons from the current session into skills. Run it after a difficult fix, debugging session, or project-specific discovery. CX Codex +1 ★ 6,739repo stars setup-pm setup-pm — a command to configure which package manager (npm, pnpm, yarn, or bun) Claude Code uses in your project or globally. Use it when you want to enforce a specific manager across your workflow. CX Codex +1 ★ 6,739repo stars

Project sponsors

Companies that keep this analytics open