<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Hooks on Nick Liu - Software Engineer</title>
    <link>/tags/hooks/</link>
    <description>Recent content in Hooks on Nick Liu - Software Engineer</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <managingEditor>nickboy@users.noreply.github.com (Nick Liu)</managingEditor>
    <webMaster>nickboy@users.noreply.github.com (Nick Liu)</webMaster>
    <copyright>2026 Nick Liu</copyright>
    <lastBuildDate>Sun, 10 May 2026 22:48:37 -0700</lastBuildDate><atom:link href="/tags/hooks/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Holding HTTP open for 590 seconds so a Stream Deck key can approve a tool call</title>
      <link>/posts/permission-round-trip/</link>
      <pubDate>Sun, 10 May 2026 00:00:00 +0000</pubDate>
      <author>nickboy@users.noreply.github.com (Nick Liu)</author>
      <guid>/posts/permission-round-trip/</guid>
      <description>&lt;div class=&#34;lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl&#34;&gt;&#xA;  &#xA;Claude Code wants to run a shell command. I want to press a physical Stream Deck key — the YES key, two inches to the left of my keyboard — to approve it. The hook gets exactly one HTTP response to decide allow vs deny. The key press might land in 200 milliseconds; it might land seven minutes later, after I&#39;ve been pulled into a meeting and come back. The trick is that Claude Code&#39;s hook timeout is 600 seconds, which turns out to be just enough headroom to hold the HTTP response open the whole time and let a hardware button write the answer.&#xA;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;p&gt;(Setup, for anyone who hasn&amp;rsquo;t seen this stack before: Claude Code is Anthropic&amp;rsquo;s terminal CLI for Claude, and one of its hook events — &lt;code&gt;PreToolUse&lt;/code&gt; — is a script Claude spawns and waits on before running a tool like &lt;code&gt;Bash&lt;/code&gt; or &lt;code&gt;Edit&lt;/code&gt;. The script&amp;rsquo;s stdout decides &amp;ldquo;allow&amp;rdquo; / &amp;ldquo;deny&amp;rdquo; / &amp;ldquo;ask&amp;rdquo;. Stream Deck is Elgato&amp;rsquo;s USB grid of programmable LCD keys. The plumbing I&amp;rsquo;m describing here lives in a daemon — a background process at &lt;code&gt;127.0.0.1:9127&lt;/code&gt; — that the hook script POSTs to and that the Stream Deck plugin connects to over WebSocket. For the hooks docs themselves and the four other gotchas in that layer, see &lt;a href=&#34;/posts/claude-code-hooks-reality/&#34; &gt;the hooks-reality post&lt;/a&gt;.)&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>The Claude Code hooks docs are wrong. Here&#39;s what&#39;s actually on the wire.</title>
      <link>/posts/claude-code-hooks-reality/</link>
      <pubDate>Sun, 10 May 2026 00:00:00 +0000</pubDate>
      <author>nickboy@users.noreply.github.com (Nick Liu)</author>
      <guid>/posts/claude-code-hooks-reality/</guid>
      <description>&lt;div class=&#34;lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl&#34;&gt;&#xA;  &#xA;I wrote a daemon to listen to Claude Code hooks. My first version read `$CLAUDE_HOOK_PAYLOAD` and logged empty bodies for two days straight. The payload was sitting on stdin the whole time.&#xA;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;p&gt;This post is the five gotchas I hit while wiring up &lt;a href=&#34;https://github.com/nickboy/claudedeck&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;ClaudeDeck&lt;/a&gt; — a Stream Deck plugin (a small program that runs inside Elgato&amp;rsquo;s Stream Deck app on the USB grid of programmable LCD keys) that talks to Claude Code over its hooks system. Claude Code is Anthropic&amp;rsquo;s terminal CLI for Claude — &lt;code&gt;claude&lt;/code&gt; in your shell — and its hooks are user-defined scripts it spawns at certain points in a session (before a tool call, on session start, on prompt submit). My daemon is a long-running background process the plugin and the hooks both talk to over a local socket. None of the gotchas are exotic. All of them cost me hours. Each one is a place where the docs were either silent, ambiguous, or contradicted by tribal knowledge I picked up from other people&amp;rsquo;s projects.&lt;/p&gt;</description>
      
    </item>
    
  </channel>
</rss>
