Friday, 4 September 2026
Anthropic shipped "function hooks" for Claude Code, which the presenter calls the best feature yet. Unlike the older shell hooks, function hooks act like Express.js middleware: they can rewrite prompts and tool inputs, short-circuit calls with a cached store, override built-in tools, ask the user questions, add UI rows and panels, and call models or HTTP endpoints. You turn them on with CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 claude, which unlocks a built-in plugin-authoring skill that writes the hooks for you from a plain-English description. Demos include automatic secret redaction, a live Vercel deploy status bar, an Exa search override, and a text-to-speech turn summary.
- Hooks exist to add deterministic control because CLAUDE.md rules fade as context fills up, prompts get sloppy, and Claude drifts from defined workflows.
- Old shell hooks couldn't rewrite prompts, append context, draw UI, ask questions, add or edit tools, or remember anything between runs; function hooks address all of these.
- The mental model is Express.js middleware: match a tool call, inspect it, then block, rewrite, short-circuit, or pass it through (e.g. swapping npm for pnpm in Bash commands).
- Function hooks come with a store, so a web fetch can return a cached copy of a URL already fetched, and there's a separate store that persists across sessions and restarts.
- You can override default tools entirely: intercept WebSearch, route to the Exa API if a key exists, fall back to the built-in tool on failure, and uninstall the Exa MCP server.
- A redaction hook strips secrets, emails and IPs from the session transcript by entropy detection, storing the real secret in memory under an ID and substituting it back in only when the request is made.
- Hooks can draw UI: a demo showed a Vercel deploy status row moving through queued/building/ready with elapsed time and a hide/show toggle, plus a per-plugin live data panel.
- Other suggested uses: dry-run gating for data analysis, prompting a refactor when files exceed 1,000 lines, compliance audit logging of every event, confirming newsletter sends, and using $model and $http to pull company knowledge base context or generate a PR comprehension quiz.
Concrete example of replacing a built-in tool's implementation, with fallbacks, letting you drop an MCP server entirely.
So what I can do instead is I can override the web search tool by middlewareing it, whereby it will intercept the tool, see if I have an Exa API key set. If I don't, it will default to the normal web search tool.
A working demo of the most practically useful pattern: Claude uses a real API key without ever seeing or logging it.
You will see it was automatically redacted, the secret, as soon as I pressed enter, and it got replaced with an ID... And when this request is made, then the hook automatically rewrites it to the correct secret.
Function hooks basically take hooks to the next level and make Claude Code even more hackable and customizable.
All the things that you may have been putting in your CLAUDE.md files, you can start removing and putting into really well-defined hooks.json instead.
Claude Code will generate a quiz for you to make sure that you correctly understand the changes that it made before it actually allows you to open up a PR.
Scott Tolinski surveyed nearly 1,300 developers and interviewed a psychologist, a burnout researcher, and several veteran programmers about what heavy AI prompting is doing to people. The pattern in the responses: 46% regularly prompt past when they meant to stop, 65% feel pressure to produce more because AI makes it possible, 59% think their skills are diminishing, and 54% enjoy coding less than before. The explanation offered is that agent prompting works like a variable reward system — slot-machine dopamine — and that the time AI saves comes back as more review, more decisions, and a higher baseline expectation rather than rest. The video argues fixes like hard stop times and offline rituals only work if your job actually lets you stop.
- A viral tweet about a developer hospitalized after staying up burning tokens before a model was pulled, plus Adam Elmore's post about the worst burnout of his 17-year career, prompted the survey; Adam described losing the excitement to wake up and work for the first time in 15+ years.
- Of the ~1,300 respondents, 46% said they regularly blow past their intended stopping point; among that group 58% reported moderate or greater sleep changes versus just 17% of those who stopped on time — the strongest relationship in the survey, though correlation not causation.
- Dr. Courtney Tolinski frames AI prompting as a variable reward system like a slot machine: the chance of a perfect solution drives 'let me just do it one more time,' releasing dopamine and feeding an addictive cycle, and chronic anxiety can somatize into headaches, muscle tightness, and stomach problems.
- 65% of respondents feel pressure to produce more often or daily because AI makes it possible; researcher Miranda Heath notes the work shifts from coding to reviewing and decision-making while managers treat AI as a magic bullet and raise capacity expectations.
- 59% put their own coding skills on the diminishing side and 54% report less enjoyment — and in the data these are largely the same people; Dr. Tolinski ties this to neuroplasticity, comparing it to an instrument you haven't played in 15 years.
- Mark Erikson deliberately runs a slower workflow — planning docs, research, review of most code himself — treating the AI as a very smart junior dev so he stays the one accountable for the result.
- Two in three respondents run only one or two agents; as agent count rises, both enjoyment and sleep disturbance go up, while reported skill loss goes down — but the data at four to five agents is too thin to conclude anything.
- The advice (time limits, lights on a timer, phones without prompting apps, walks, community) mostly comes from people who set their own schedules; with employment for developers aged 22–25 down close to 20% from its 2022 peak per the 2026 AI Index, junior devs may not feel safe enforcing boundaries.
The clearest mechanical explanation in the video for why developers can't put the agent down, delivered by a licensed psychologist right after the sleep data.
It's a variable reward system, which is more like a slot machine, right? Where sometimes you're getting a reward, but most of the time you're not... there's this concept of, 'Well, let me just do it one more time.' And that keeps you hooked... and that in turn induces dopamine, which feeds this addictive cycle.
A concrete reframe that explains why one heavy AI user came out of the manic phase without burning out — the urgency evaporated once he saw everyone had the same tools.
I thought instead of I'm going to build 40 products cuz now I have this god-like power. I thought, whoa, so does everybody else and nobody's buying anything anymore cuz they're all just building it... I've had to change the shape of my ambition a little bit from being broad to being deep.
If it is possible to go faster, we must go faster... but it brings up the questions of why are we trying to go this fast in the first place?
AI gives you a result, but a result isn't an answer yet. It becomes one when a person evaluates it and takes responsibility for it.
I don't want to miss my kids' childhood because I ripped some extra tokens on something that didn't end up mattering.