Claude Code hooks worth building

Hooks are shell commands Claude Code runs at fixed points: before a tool call, after an edit, when a session stops.

Looking for ones that already exist? See Claude Code setup on aistack.sh, our directory of tested AI tool stacks.

Works in

7
Claude Code hooks ideas
11k
upvotes on the source threads
12
Reddit threads
7
weekend-sized builds

Build time vs. demand

Bar length = upvotes on the Reddit threads behind each idea

7 Claude Code hooks ideas

Most upvoted first. Open a card for build steps and threads

▲ 5.6k
3 Reddit threads
Hook

Agent status light

Turns a lamp, menu bar icon or cursor badge red when the agent needs you and green when it's done.

Claude Code logoWeekendFree, $39 light kit
How to build it
  1. 1Send working, waiting and done states from hooks to a small local daemon.
  2. 2Map each state to a color on a smart bulb, USB light or menu bar icon.
  3. 3Sell a ready-to-use light that sets itself up with one command.
Notification hookStop hookBluetooth or USB lightBuyer: Developers who switch windows while agents run

The Reddit threads

▲ 1.8k
1 Reddit thread
Hook

Session receipt

Prints or saves a receipt when a session ends: cost by model, tokens, files changed and time spent.

Claude Code logoWeekendFree, $5/mo history
How to build it
  1. 1On SessionEnd, total the session's tokens and cost per model from its log.
  2. 2Add files changed from git and time spent from timestamps.
  3. 3Sell a history that exports receipts per client for invoices.
SessionEnd hookSession JSONL logsReceipt printer or MarkdownBuyer: Freelancers billing clients for agent work

The Reddit threads

▲ 1.6k
3 Reddit threads
Hook

Destructive command guard

Blocks rm -rf, DROP TABLE, force pushes and disk wipes before they run, even with permissions skipped.

Claude Code logoWeekendFree, $8/mo team rules
How to build it
  1. 1Parse every Bash call and match it against destructive patterns, not plain strings.
  2. 2Block with exit code 2 and tell the agent the safe alternative.
  3. 3Sell shared rule sets for databases, cloud CLIs and disk tools.
PreToolUse hookShell command parserAllowlist fileBuyer: Anyone running agents with broad permissions

The Reddit threads

▲ 1.3k
2 Reddit threads
Hook

Token budget guard

A hook that stops a runaway loop before it burns through your plan or your API bill.

Claude Code logoWeekendFree, paid team policies
How to build it
  1. 1On every PreToolUse event, sum the session's token use from its log.
  2. 2Exit with code 2 and a clear message once the session passes its budget.
  3. 3Sell shared budgets and Slack alerts to teams.
PreToolUse hookNode or BashSession JSONL logsBuyer: Teams on API billing

The Reddit threads

▲ 322
1 Reddit thread
Hook

Secrets guard

Blocks the agent from reading .env files, keys and credentials unless you allow it.

Claude Code logoWeekendFree, $6/mo team policies
How to build it
  1. 1Match Read, Grep and Bash calls against secret file patterns.
  2. 2Block with exit code 2 and log every attempt.
  3. 3Sell central policies and audit exports to teams.
PreToolUse hookGlob rulesAudit logBuyer: Teams with production secrets on laptops

The Reddit threads

▲ 267
1 Reddit thread
Hook

Rejected-idea filter

Stops the agent writing your corrections into names, comments and commits, like "without backoff".

Claude Code logoWeekendFree, builds an audience
How to build it
  1. 1After each edit and commit, scan new names, comments and messages for phrases like "without X".
  2. 2Block and ask the agent to rename when one turns up.
  3. 3Publish it in a plugin marketplace to grow a following.
PostToolUse hookCommit message checkPhrase listBuyer: Developers who care about a clean git history

The Reddit threads

▲ 152
1 Reddit thread
Hook

Ask-before-editing hook

Makes the agent list its assumptions and ask questions before its first edit on a vague task.

Claude Code logoWeekendFree, builds an audience
How to build it
  1. 1On UserPromptSubmit, flag short prompts that name no files.
  2. 2On the first Edit or Write call, block once and ask Claude for its assumptions.
  3. 3Ship it in a plugin marketplace to grow a following.
UserPromptSubmit hookPreToolUse hookBuyer: Developers tired of wrong-direction edits

The Reddit threads

The threads behind them

Most upvoted Reddit posts

BID MCP server

Ask your agent what to build next

Connect Business Ideas Database to Claude Code, Codex or Cursor and search validated ideas, Reddit proof and keyword data without leaving the terminal.

# Claude Code
❯ claude mcp add --transport http bid \
https://businessideasdb.com/api/mcp \
--header "Authorization: Bearer $BID_KEY"
✓ Connected: search_ideas, get_idea
# then just ask
❯ find me a dev tool idea with real demand

Questions

What are Claude Code hooks?

Hooks are shell commands that Claude Code runs automatically at set points in a session, such as before a tool call (PreToolUse), after one (PostToolUse), when you submit a prompt, or when Claude finishes (Stop). They live in settings.json and can block a tool call.

Should I build a hook or a skill?

A skill is instructions Claude chooses to follow. A hook is code that always runs, whatever Claude decides. Use a hook for rules that must hold every time, like formatting, tests or blocking edits to certain files.

What is the easiest Claude Code hooks idea to start with?

Agent status light: Turns a lamp, menu bar icon or cursor badge red when the agent needs you and green when it's done. It is sized at weekend, and the threads behind it have 5.6k upvotes.

More vibe coding ideas

By agent and by build type

Your next idea is already validated.

You just haven't seen it yet.