Building a /reload Command for Claude Code

I often want to reload Claude Code mid-session to pick up changes to MCP servers, hooks, or other settings. The default workflow is a little clunky: I need to manually exit, then restart, then tell Claude that I restarted.

As a result, I wanted a /reload command that I could run to restart Claude and automatically continue the conversation. Also, by making it a command, Claude can actually invoke it itself when it detects a need to reload. This allows Claude to restart itself when needed without human intervention, so it can run more autonomously.

I figured this out when making (yet another) Google Drive MCP. I wanted to have Claude build it and automatically reload to test it.

Initial exploration

Since I was in Claude Code already, I worked on this with Claude. I figured we could find an approach that worked and then codify.

First attempt: Exit with a special code

Claude's initial idea was to have the skill exit Claude with some special exit code. Perhaps exit 42 to signal "please reload", and a wrapper script to listen for that code. This would work well since I already typically run Claude via short custom commands, so we could hook into that.

I asked about reasonable or semantic exit codes, and Claude suggested using 129 rather than an arbitrary code.

Exit code details Claude says: SIGHUP (signal 1) is the Unix convention for "reload configuration". Daemons like nginx and Apache reload their config on SIGHUP rather than terminating. And exit code 128+N is the shell convention for "terminated by signal N." So 129 would mean "reload requested" -- semantically correct and following established Unix patterns.

However, merely exiting from a Bash tool use doesn't work. Bash commands run in subprocesses, so exiting the subprocess with a special code just kills that subshell.

Second attempt: Find a built-in flag

We looked at Claude Code's docs and --help for a way to pass an exit code to /exit, but there's no /exit <code>, /reload, or /restart built-in.

Read on →

External Monitor Brightness Control on Mac

About a decade ago I wrote about my night working computer setup, covering tools like Dark Reader and f.lux. One thing I mentioned but never solved was external monitor brightness. I had resigned myself to fumbling through physical buttons and monitor menus whenever I wanted to dim my screens at night…

It turns out there's been a solution this whole time: most external monitors support a protocol called DDC/CI that lets software control hardware brightness over the display cable.

Read on →

Making Infinite Scroll Work with Client-Side Filtering

I've been building Chrome extensions that filter content on websites with infinite scroll, and I ran into a problem: when you hide most of the items with CSS, the page becomes too short to scroll, so no new content loads.

This came up in two separate extensions I built - one for filtering posts on Nextdoor, another for filtering RSS entries on Feedbin. After some trial and error, I found an approach that seems to work reasonably well.

The Problem

Many websites use infinite scroll. As you scroll down, they automatically fetch and append more content. This typically works by detecting when you've scrolled near the bottom of the page.

When you add client-side filtering (hiding items based on tags, keywords, etc.), you run into a problem:

  1. You hide items with display: none
  2. Hidden items don't take up space
  3. The page becomes too short to scroll
  4. The infinite scroll loader never triggers
  5. No new content loads
  6. User is stuck with whatever items weren't filtered out on first load

This is pronounced when there is heavy filtering.

Read on →

Vibe Coding 24/7 On A Screen For Ants

Given the increasing effectiveness and autonomy of coding agents, I wanted a good way of working with them when not at my computer. I found a setup that works pretty well for me, so I wanted to share it in case it's helpful for someone else.

I've been using Claude Code as my primary agentic coding tool for about 6 months now, so all examples here will use that, although I'm guessing it could be used with others. Claude Code has been solid and continually improving, especially with Opus 4.5. (But I guess ask me in a few months… :D)

Tailscale

The key part of a setup like this is having some computer that has Claude Code set up, and then being able to securely connect to it.

My current overall approach is to set up a secure network through Tailscale so I can SSH to it.

Mermaid diagram: tailscale-ssh-flow

I set up my main computer (currently M3 Max Macbook Pro) to run Tailscale. First, run the Tailscale daemon with $ sudo tailscaled. (This changed my computer's hostname for some reason, which was not super desirable.)

Then configure your computer to accept SSH connections from anyone in your tailnet (basically your authenticated devices):

$ tailscale set --ssh

It seems like Tailscale has two (three!) Mac interfaces:

  • a native Mac app (used for connecting to the Tailscale network)
  • the same, but installable through the app store
  • and one that's a CLI interface.

You need the CLI version to be able to run the tailscale ssh command, and the versions seem to need to agree with one another or you get warnings and possibly issues:

Read on →

Avoid Losing Work with Jujutsu (jj) for AI Coding Agents

Someone in the Indy Hackers Slack shared the following post:

My first Gemini CLI experience: "I messed up. I accidentally removed your untracked files with git clean, which wasn't my intention. I'm truly sorry. Since they weren't in git, I can't restore them easily."

— rands (@rands@mastodon.social) View on Mastodon

I had also run into this problem while coding with AI agents. This seemed like an opportune time to write up some thoughts to hopefully save others some time and agony.

Sometimes this issue happens to me because I get too confident in the current work direction and have not committed in a while. And then one or two prompts later, I have a broken or confusing set of changes.

Or, as Rands's post mentions, sometimes the AI agent purposely or accidentally reverts some changes and can't recover them. Also, when Claude Code compacts context, it clears the terminal, so it often can't remember changes, and then we would be unlikely to recover.

Enter jj

To try to combat this problem, I've been setting up and using Jujutsu (henceforth jj) instances for the repos that I have. jj snapshots the working copy whenever you run a jj command, so you can use its history to see and restore changes that might have otherwise gotten lost. It also works fairly seamlessly with git, which basically all of my projects use at this point. It also doesn't affect other users of your projects. So in my mind there are basically no downsides to setting it up.

Read on →