Chris F

The AI writes the tool. The tool does the work.

Chris F · · How I do it · 3 min read

In short: I don't want Claude to do the same chore every day. I want Claude to write a small program that does the chore, keep it in git, and let a timer or CI run it. Claude comes back only when the tool breaks or needs to grow. The test: could an engineer with no AI run everything from the README, the Makefile and the logs?

Flow: I did it twice, Claude writes a script with a usage line and tests, it is kept in git, runs on a timer or in CI and leaves logs; only if it breaks or grows does Claude change it.
Claude is in the loop when the tool is made or changed, not every time it runs.

Context

I am a software engineer by habit. The things I trust are repeatable: a script with a usage line, a make target, a CI job, a systemd timer. They do the same thing every time, they leave logs, and they don't have opinions.

When I started using Claude Code seriously at home, I noticed I was asking it to do the same jobs over and over. Rebuild the intranet pages. Check which backups ran. Count the hours my robot simulation had logged this week. Each time it worked, and each time it cost a conversation, a context window and my attention. And each time it was done slightly differently, because a model is not a script.

Asking the AI every time: a conversation, a context window and my attention, and a slightly different result each time. A kept program: a file in a repo, run by a timer or CI with no conversation, the same every time with logs.
Doing the chore by chat versus keeping a tool.

So I set a rule: anything I do twice becomes a program. Not a snippet in a scratch folder: a file in a repo, with a usage line, an entry in the tools index, and ideally a test.

There is a second reason that matters more to me than cost. I want my setup to keep working if the AI is not around: if I hit a usage limit, if the service is down, or if I decide to stop using it. The model is where judgment lives. The tools are where routine lives. I want the routine to run on its own.

A black Unimate PUMA industrial robot arm beside its controller box and an old monitor, on display in a museum.
Industrial arms like this Unimate PUMA earned their keep by doing one job the same way every time. That is what I want from routine tools.
Photo: Theoprakt, CC BY-SA 3.0, via Wikimedia Commons (resized)

Detail

What "a kept program" looks like

Every tool has the same small shape. The top of the file says what it is and how to call it:

#!/usr/bin/env python3
"""Rebuild every drawing PNG from its checked-in source, without AI.

    drawings build [NAME...]   rebuild all, or the named ones
    drawings check             exit 1 if a PNG no longer matches its source
    drawings list              each drawing: name, PNG, source
"""

The picture at the top of this post was made by that tool. It reads a small YAML file of boxes and arrows and writes a PNG. No model is involved when it runs. Claude wrote it, and Claude adds a feature when I ask for one, but a timer could rebuild every drawing tonight with nobody watching.

The other common shape is a make target, so the entry points are discoverable:

make build     # drafts -> HTML
make check     # front matter, length, privacy word list
make test

Where they run

The tools in git run three ways: on a timer for backups, nightly copies and weekly reports; in CI to build and deploy after the gates, only on change; or by hand.
Three places the tools run, none of which needs a model.

Deterministic first, model where judgment is needed

Some jobs really do need a model: summarizing, writing, deciding what matters. The pattern there is to keep the model's part as small as possible and wrap it in code that checks the result. For example, a script asks a model for a short text, then code checks its length and shape and refuses anything that doesn't fit. The model does the part only a model can do; everything around it is ordinary code.

A script asks for a short text, the model writes it, and code checks its length and shape: if it fits it is used, if not it is refused.
Keep the model's part small and check its output with code.

Lessons

The test I use

When a job is done, I ask: if Claude vanished tomorrow, could someone with only the repo run this? README tells them what it is. Makefile tells them how. Logs tell them what happened. If the answer is no, the job isn't done.

That has quietly changed how I use AI. Less "do this for me". More "build me the thing that does this, and make it boring".


Drafted with Claude.