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.

Works in

3
Claude Code hooks ideas
1.8k
upvotes on the source threads
4
Reddit threads
3
weekend-sized builds

Build time vs. demand

Bar length = upvotes on the Reddit threads behind each idea

3 Claude Code hooks ideas

Most upvoted first. Open a card for build steps and 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

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?

Token budget guard: A hook that stops a runaway loop before it burns through your plan or your API bill. It is sized at weekend, and the threads behind it have 1.3k upvotes.

More vibe coding ideas

By agent and by build type

Your next idea is already validated.

You just haven't seen it yet.