@Khazix0918: https://x.com/Khazix0918/status/2070403772703285575

X AI KOLs Timeline Tools

Summary

This article introduces six ways to use Hooks in Claude Code, including permission pop-ups, startup schedule announcements, summary cards, automatic file organization, sedentary reminders, and long task notifications, demonstrating how event-driven automation can improve the efficiency of AI workflows.

https://t.co/iZWbAk0MRj
Original Article
View Cached Full Text

Cached at: 06/26/26, 10:09 AM

Want to play with Loop Engineering? Start with these 6 Hook playbooks.

Loop Engineering is getting more and more popular lately. Several friends have asked me how to get started with this stuff—where should we even begin designing a loop?

It’s a really interesting question. If I had to point to one thing, it’d be something I’ve mentioned over and over in my previous articles.

Hook.

Almost every Agent has something called a Hook. Claude Code and Codex’s automation features both rely on it behind the scenes.

“Loop” means a cycle. In any loop, there’s a most basic, fundamental element: the trigger. In other words, if some event happens, execute some command.

It’s a lot like smart home systems we have today. For example, at 10 AM the curtains open; when it detects I’ve left home, it turns off all the lights. Etcetera.

That trigger condition is a Hook.

Hooks are everywhere in daily life, too. When you arrive at the office, your phone automatically switches to work mode. Your morning alarm goes off on its own. These are all Hooks.

Same inside an Agent. You can set specific rules on Hooks to automate all sorts of things.

For example: before the AI edits or modifies a file, first check if the command has any risk.

After code modification, automatically run lint to check quality.

And when running a long task, you switch to another page to do something else—it sends a push notification when it’s done.

Of course, Hooks can do far more than that.

In Claude Code, it’s the same. Attach Hooks to the moments you care about, predefine when to do what.

When something happens, it runs by itself. You don’t even need to be in front of the screen.

Open Claude Code, type /hooks at the bottom, and you’ll see this interface.

Hit Enter, and it will list all available Hook events.

I remember when I first looked at it earlier this year there were only 13. Now there are nearly 30—more than double.

But don’t be intimidated by the number 30. In daily use, you’ll probably only need a handful of common ones.

Here, I’ve also put together six Hook playbooks I find particularly fun. Hope this serves as a starting point and gives you some ideas.

1. Permission Popup Reminder

Many of you might have experienced this: you give Claude Code a command, switch to another tab to do something else.

Ten minutes later you come back—it hasn’t started executing yet. It’s stuck at the permission request step.

All you need is to tell Claude Code:

“Configure a notification Hook for me: whenever I need to authorize something, use the system’s built-in tool to pop up a reminder.”

Send it to the AI, and it will set it up for you.

After configuration, you can have Claude Code test it. When authorization is needed, a popup will appear in the top-right corner. No more wasting time when you switch away and the AI just hangs.

Someone will surely ask: “If it pops up every time authorization is needed, won’t that waste a lot of tokens?”

Most Hooks are essentially just code—hardcoded rule scripts. So when they run, they have almost nothing to do with the AI, and thus consume almost no tokens.

Of course, Hooks can do much more than just popping windows. There are other things I find even more fun and interesting.

2. Daily Schedule Broadcast on Startup

Sometimes when we open Claude Code, we’re greeted with a cold, lifeless interface. Not fun.

You can type in the dialog:

“Create a session-start Hook. Whenever I open or resume Claude Code, output an energetic greeting. Tell me today’s weather in Chaoyang District, Beijing—whether it will rain, whether I need an umbrella. Use the Feishu CLI to pull my schedule for the day. Make the content interesting.”

Reopen Claude Code, and this reminder automatically pops up, adding a bit of warmth to the otherwise dry terminal.

Of course, that’s just an appetizer.

Next up is what I consider the most practical one.

3. Summary Card

One evening, I wanted to find a solution Claude Code had helped me modify last week. I scrolled through half an hour of chat history—couldn’t find it.

I sat there thinking for a long time: what on earth did I ask it to do that day? Couldn’t remember after a long while.

Because my Agent usage is too fragmented. I have at least 4–5 long-running projects I’m iterating on. Often they run in parallel. Even larger projects like AIHOT sometimes have branches and run three instances concurrently.

So I’m constantly confirming this, confirming that, back and forth—turning into an “Agent Chicken Master.” By the end of the day, I might not even remember what happened.

And many truly valuable conclusions are buried in those long conversations. Once the context is compressed, or I type a /clear command, finding them later is painful.

So I created a Hook. I sent this message to him:

“Write a Hook for me: when context is about to be compressed, generate a summary card recording the current context’s key content for later review. Save the file to a location accessible across projects. After summarization, print it to Claude Code for easy viewing.”

From then on, right before the context gets compressed and lost, it quickly generates a summary card.

This is hugely important. Long chat history has a very high cost to revisit—you simply don’t want to scroll through it.

But this is different. It’s essentially a work diary written by AI on your behalf.

Later, if you want to recall what you did on a certain day, you don’t need to scroll through tens of thousands of words of conversation. Just skim these cards. One or two minutes is enough to see what happened that day.

It greatly frees up mental capacity. Very useful. You can even add a scheduled Hook, e.g., every Friday, automatically compile these summary diaries into a weekly report.

You know the value of that.

4. Automatic File Organization

Another Hook playbook I personally love.

A while ago, I was cleaning up my Downloads folder. It was a mess—screenshots, documents, PDFs all mixed together. Every time I needed something, I’d spend ages looking.

Then I suddenly thought: why not let Claude Code do this for me? Manually organizing every time felt so dumb.

So I made a Hook with a very simple logic: designate a folder. Every time a new file is dropped in, it checks what it is and what’s inside, then automatically renames it and moves it to the right place.

But file organization can’t be done with simple code alone. So here I used a combo: Hook + Skill.

Claude itself had a great analogy: Hook is the doorbell, Skill is the person who actually does the work once the door opens.

The doorbell rings—something new has arrived. But how to handle it still requires the model’s capabilities: recognizing file content, deciding which category it belongs to, renaming according to rules, moving to the corresponding folder, etc. For all that, using Skills is the most convenient.

Skills are also very easy. You just tell Claude Code to write one for you. Since everyone’s needs are different, writing your own is best.

Once this Hook is set up, you just leave Claude Code running, and it silently monitors that folder in the background.

Whenever a new file comes in, it waits a few seconds to confirm the transfer is complete, then starts working—automatically processing it.

Whether it’s a PDF or an image, it can identify the content. Meeting notes go to the meeting folder, invoices go to the reimbursement folder. Screenshots are renamed with understandable names based on their content, then moved to the appropriate folder.

You don’t need to do anything during the whole process. Just drop the file in, and it organizes itself.

That feeling is amazing.

Think about it—this pattern isn’t limited to cleaning up messy download folders.

You could monitor a work project folder, for example. New files get automatically renamed by client name and date, etc. There are many interesting automated variations.

5. Sedentary Reminder

It feels great having AI work for you, but there’s a side effect: it’s so enjoyable that you sit for ten-plus hours straight.

Last week, one day I opened Claude Code at 9 AM to fix a small feature.

When I looked up again, it was 4 PM.

At that moment, I felt like I was back in school ten years ago playing Civilization 6.

Then I realized this isn’t just me. Many people who code with AI experience this.

In the past, we were addicted to gaming; now we’re addicted to Vibe Coding.

So I thought: let’s make a little sedentary reminder. Sure, Apple Watch also has a sedentary reminder—every hour—but when you’re deep in Vibe Coding, you sometimes don’t feel it.

Since I’m already sitting in front of the computer all day, why not just push a notification on the computer?

So I briefly described the requirement: once Claude Code starts, after an hour passes, have it send a notification reminding me to take a break.

Health is important; your body is your greatest asset. When you’re in the zone with Vibe Coding, you simply don’t remember to stand up and move around. Having such a little reminder is very effective.

Here I also remind everyone: let AI boost your efficiency, but also take good care of yourself. If you’ve been sitting for a while, get up and move.

Later I’m even thinking of making a hardware version—more forceful…

Like, directly disabling my keyboard or something—forcing me to stand up = =

6. Long Task Completion Push Notification

And here’s another personal must-have.

Yesterday I went to record a variety show hosted by Director Yan Min. Before it started, I asked Claude Code to help me build a relatively large feature—something to be used on stage, and somewhat urgent.

I sat in front of the computer, watching it output results line by line. Everything seemed normal, so I went to do other things. About ten minutes later I suddenly remembered: “I wonder if it’s finished?” I went back to the computer—still running.

This back-and-forth happened several times.

I thought: I need it to call me directly when it’s done.

So I asked Claude Code to research whether there’s a way to notify me when it finishes, ideally with a sound distinguishable from common app notifications.

Then it told me about Bark.

It’s a push notification tool you can download directly from the App Store.

Free, no registration needed. After installation, it gives you a push URL. Just let the AI configure it for you.

So I had Claude Code write a Hook that calls Bark.

Now it’s wonderful.

My phone and watch receive the message simultaneously. You can even customize the notification sound, making it distinct from WeChat, Feishu, SMS, etc. Just by hearing the sound, you know the AI has finished its task, so you can switch back to check the results. And it’s in Chinese.

The experience is fantastic.

With this, you can confidently leave your computer to do other things, without worrying about periodically checking back.

This playbook is also easy to extend. For example, a relaxed notification sound for successful tasks, and a distinct one for failures—so you know to check back.

When input is needed, the push message clearly states what it’s waiting for.

Final Thoughts

I believe more and more AI workflows in the future will be event-driven.

A new day starts, it bootstraps you. A file appears, it processes it. Context is nearly full, it archives. A task is completed, it notifies you. The day ends, it auto-summarizes.

Even now on GitHub, many projects use Agents to monitor issues. When someone raises an issue, the Agent automatically fixes it, pushes the fix, and replies to the thread automatically…

This isn’t rocket science. It’s about gradually transforming AI from a passive chat box into a part of your work and life.

Of course, I don’t recommend going overboard from the start.

Once Hooks start integrating into your real workflow, you must pay attention to stability and boundaries—especially actions involving file moves, deletions, renames, or form filling. Don’t let it run wild in your important folders right away.

But as long as you design the boundaries well, it will be incredibly useful.

A Prompt solves one conversation.

A Skill solves one type of capability.

A Hook solves one moment.

From conversation to capability, from moment to loop.

AI is increasingly becoming a system that runs for you.

Giving you time to do more interesting things.

Similar Articles

@li9292: Thanks to Teacher Kazik for introducing the Hook approach. Let me also share two of my daily use cases: **Case 1: Passive Observation** In my thought project, I just want to know what Claude is doing. ```json "PostToolUse": [{ "matcher": "Agent|Skil… ```

X AI KOLs Timeline

Share two ways to use Claude Hooks: passively observe and record tool call logs, and actively intervene to implement a learning mode state machine. Emphasize that Hooks as hard constraints are more reliable than prompts.

@vincemask: Many people don’t know when to use Hooks. My rule is simple: anything you find yourself repeatedly reminding Claude about should be taken out of the prompt and handed to a Hook. For example: 1. Formatting code after every edit 2. Running lint/tests before every commit 3. ...

X AI KOLs Timeline

This post explains when to use Hooks to codify repetitive rules in Claude AI programming assistance (such as auto-formatting, pre-commit checks, etc.), suggesting that stable, repetitive, and easily forgotten processes should be moved from the Prompt to be executed by default in the environment.

@uniswap12: I'm truly impressed by how far Claude Code can be used. Matt Van Horn recently wrote a long article revealing all his tips and workflows for using Claude Code. This article sparked considerable discussion in the developer community because what he showed goes far beyond 'using AI...'

X AI KOLs Timeline

Matt Van Horn shares advanced workflows for using Claude Code: first plan in detail via plan.md, then use voice input and multi-window parallel execution, demonstrating how to deeply integrate AI into the development process, greatly improving efficiency.

@ZionFeng3364: https://x.com/ZionFeng3364/status/2062702195750191182

X AI KOLs Timeline

This article introduces how to use Claude Code's Skill feature to build a personal workflow in ten minutes, turning repetitive tasks into triggerable automated processes, and demonstrates three abilities: installing Skills, writing Skills, and combining Skills.