Claude Code hooks and the two techniques worth copying

{
  "hooks": {
    "Notification": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "notify-send \"Claude Code\" \"wants your attention\""
          }
        ]
      }
    ]
  }
}

That’s a Claude Code hooks config, a few lines of JSON in ~/.claude/settings.json, and it’s the cheapest of the four techniques in Eivind Kjosbakken’s post on maximizing Claude Code over on Towards Data Science. The Notification event fires whenever the agent asks a question or wants permission to run something, and the command above pops a desktop notification on Linux. On macOS the same block points at osascript instead. Either way, you stop watching the terminal.

His four techniques are OpenClaw (coding agents as bots in Slack or Discord, driven by cron or by messages), active use of hooks, the high-effort Ultracode mode, and a prompt rule that makes the agent close every response with your tasks and a recap. I run two of these daily and I’m picky about the other two, because they spend tokens in ways that only pay off on some jobs. On billable WordPress work there’s a real line between “sounds productive” and “I can invoice this”.

Claude Code hooks and the checkbox rule

These two cost nothing to set up, and within a day they change how the tool feels to use.

Make the agent interrupt you

The author’s version plays a sound when Claude asks a question or finishes a task. The events are already named for you. Notification covers questions and permission requests, which on a client repo full of plugins is most of the waiting. If you want a ping when a task finishes too, copy the block, change the key to Stop, and point the command at a sound file with paplay. The hooks guide in the Claude Code docs walks through the settings format. The reference lists every event, along with the JSON each one passes to your command on stdin.

Bash and Edit permission prompts arrive constantly on a site with a decade of plugin history, and a thread you don’t notice just sits there. The notification hands that dead time back to you. I’ve only run this on Linux and macOS, so if you’re on Windows I don’t know what the equivalent looks like.

The checkbox rule in CLAUDE.md

End every response with a section titled "For you":
- [ ] one line per thing I must do, test, or decide
Then a recap of at most three sentences:
what changed, and what is still unverified.

The checkbox format comes from the source post, and I tightened the wording to fit my work. It works for an embarrassing reason. The agent writes a lot of text and I don’t read all of it, so a question buried mid-scroll gets missed until an hour later. A checkbox list at the bottom survives a skim.

For WordPress and WooCommerce jobs I added one requirement: the list must cover verification as well as decisions. Flush the object cache after a schema change, re-save permalinks when a rewrite rule moved, check the order confirmation email after touching checkout hooks. Those are the steps that bite when skipped, and now they arrive as checkboxes instead of prose. If you run several threads at once, this is also how you pick one back up after twenty minutes elsewhere; I wrote about running parallel sessions in more detail.

The token advice, with a client-work filter

The argument for Ultracode and heavy token spend is that performance scales with tokens. The author’s worked example is a fast model finishing in ten minutes but costing an hour and a half of corrections, versus roughly forty minutes total with the heavier setup. Those numbers are his illustration rather than a benchmark. The shape of it is still right when two things hold: the task has to be well specified, and you have to be able to tell correct output from confident output.

Client WordPress work often fails the second one. The repo is a stack of plugins from different vendors overriding each other’s filters, and correcting the agent turns out to be cheap compared with reviewing a diff big enough to hide a regression. A swarm of subagents makes that diff bigger. My split is high effort for planning, review, and unfamiliar code, default effort for routine edits in code I already know.

The other thing that decides it is a cheap way to verify output. Extra tokens with nothing checking the work buy more confident prose, and the bugs stay where they were. A repo with WP-CLI smoke checks or PHPUnit tests gives the extra effort something to push against; a repo with neither is better served by building the loop first, which is the argument I made when I wrote about the test loop.

The overnight bot, or just cron

OpenClaw, as the post describes it, runs coding agents as bots in Slack or Discord, either on a schedule or when someone sends it a message. The examples are good: an agent that reviews a pull request when you’re tagged, one that walks the product nightly and reports issues, one that triages bugs. That earns its place on a team that already lives in chat.

For solo WordPress maintenance I’d start with the dumb version. Put server cron on whatever box runs your tooling, with a non-interactive prompt like claude -p "run wp plugin list --update=available and wp core check-update, then write a short risk summary to maintenance.md". You skip a new service, another set of bot keys, and a process to babysit. I’m not sure the chat bot pays for itself at one person, though the PR review ping probably does once there’s a team reading the channel.

If you want this wired up for a specific store or plugin repo, the hook config, the CLAUDE.md rule, and a nightly review cron are all small setup jobs I take on. Send me the repo and I’ll sketch what fits.

Whatever runs unattended should get its own checkout on a branch, a key that can read the repo but can’t push to production, and instructions to write a report rather than commit. Nightly agents are worth running once the worst thing they can do is hand you a wrong summary at six in the morning.

author avatar
Ahmad Wael
I'm a WordPress and WooCommerce developer with 15+ years of experience building custom e-commerce solutions and plugins. I specialize in PHP development, following WordPress coding standards to deliver clean, maintainable code. Currently, I'm exploring AI and e-commerce by building multi-agent systems and SaaS products that integrate technologies like Google Gemini API with WordPress platforms, approaching every project with a commitment to performance, security, and exceptional user experience.

Leave a Comment