DEV Community

Cover image for Your AI agent should not decide when to commit
Ian
Ian

Posted on

Your AI agent should not decide when to commit

This one covers November 26 to December 3. It was a week about who gets the last word: my workflow kit now refuses a Claude session's commit or push unless I asked for it, and the same kit moved from shell scripts to Node so it runs on Windows the way it runs on a Mac. The rest went into my framework, which now loads every handler one way, and into keeping my machines in step when one of them is asleep.

A commit needs the owner's word

workkit is my workflow kit for Claude Code: GitHub issues as the work list, labels as the pipeline, hooks that enforce the rules. One rule had always been prose: don't commit or push unless I ask. Prose is a suggestion. Given enough sessions, an agent will read "should we commit?" as a yes, or decide a finished task means the commit is next.

Since version 0.109, the rule is a check. Each message I send is read once for four order words, and each order adds a one-time grant to the session's pass:

  • "commit" grants one commit.
  • "push" grants one push.
  • "ship" grants a repo's whole ship: the commit, the release commit and the pushes.
  • "file" grants one new issue.

The reading has two speeds. A line holding only the word, like commit or Ship., counts at once with no model asked. Any other mention goes to a small model (Haiku, low effort, a 100-token reply, eight seconds in all) that answers with one JSON object: a count per word, and the words I said no to. A no wins, so ship on one line and actually dont ship on the next gives no ship. "should we ship" orders nothing. If the model cannot be reached, an order counts zero, since an order nobody could read orders nothing.

The grant is used up in git's own commit-msg and pre-push hooks, not in the chat. That matters: the hook judges the real commit and push, never the text of the command that ran them. A follow-up release made the spend a locked edit, so two calls racing for one word cannot both get through. An issue carrying the agent:ok label is my word given in advance, and a commit that closes only such issues opens the ship by itself.

It is a seatbelt, not a vault. The docs say plainly that it does not make a pass hard to forge. What it stops is the default: an agent committing because committing felt like the next step.

Why it matters: an agent can move as fast as it likes on everything that is easy to undo. Commits and pushes now wait for a word I actually typed.

From shell to Node

The other big push was Windows. Over three releases the kit moved from shell to Node:

  • 0.105: the workkit command is Node. Its shell entry, 19 verb files and five shell libraries are gone, and Windows gets a workkit.cmd so it starts from cmd and PowerShell.
  • 0.106: the gh shim is a Node program, and git's hooks, the git shim and npm's script shell each start one Node check. jq is no longer needed.
  • 0.107: every stand-in program the test suite writes is Node, so about 110 cases that used to skip on Windows run there now, with no C# compiler needed.

The part I like is how small the replacements are. The hooks start no rm, wc, tail or mkdir, which a Windows PATH may lack. A marker is ended by writing it empty. A journal's size is its stat's. Its tail is read by byte ranges. A write makes its own folders. The morning brief reads Claude Code's changelog with Node's fetch, bounded at 20 seconds, instead of curl. And a test now holds the list of files allowed to start a shell, so a new one cannot creep back in.

The 9am job also runs on Windows now, as a Task Scheduler task, and Git Bash's spelling of a home folder (/c/Users/name) is read as the real home instead of a folder under the drive root.

Why it matters: "works on my Mac" was the whole support story. Now the kit needs Node 22.22 where it used to need bash and jq, and each program checks that floor itself.

The test runner grew too. noDisplay() skips a case that opens a window on a Linux machine with no display. workkit test out runs suites a build wrote into a git-ignored folder. And workkit ship watch no longer ends with no answer when GitHub errors mid-watch: it watches again, and a run that ended green answers green.

One way to load a handler

omega is my framework for shipping a website, backend, desktop app and browser extension from one project. Its biggest change this week (on main, not in a release yet) is breaking on purpose.

Every file-based handler on every target is now an ES module with one default export: the backend's 195 route, schema and event handlers, the MCP file, desktop's hooks and its tray and menu files, and the extension's hooks. There is no dual read. A module.exports file is refused by name, and the by-hand step is in the breaking-changes doc.

How it works: two loaders, one per family, both calling one devkit check, defaultExport. The follow-up brought four more kinds of file under it, including each target's test/_init.js, which must now be a synchronous factory. One that returned a promise used to run no setup and give no error. Now it is refused.

The same batch let one file do a job three did before. A target with no brand image of its own takes the brand's assets/logo/brandmark.svg: the web build derives the favicon set and social image from it (cached by hash), desktop its app icon, the extension its icon sizes. The old icon bridge and the manager's separate favicons step are gone.

Why it matters: a framework that accepts two shapes forever tests two loaders and writes "either works" in every doc. One shape, refused loudly otherwise, is cheaper for everyone after the migration.

Machines that catch up

One private story, from the scripts that set up my machines. A sync pushes each update to every other machine over SSH. A laptop that was asleep just missed it, and stayed a release behind until I noticed.

Now the sync remembers each machine it could not reach, and a job on the machine that ran it retries only those every 15 minutes until each one answers. The same week, my Claude sign-in became one sign-in across all of them: a switch on any machine reaches the others, and the newest switch wins.

Why it matters: a fleet you have to remember to fix by hand is not a fleet.

Next week I want omega's ES-module change in a tagged release. How do you keep an agent from committing on its own? Comments are open.

Top comments (1)

Collapse
 
alicexixi85 profile image
Dejun (Alice) Chen •

Spending the grant in commit-msg and pre-push instead of in the chat is the part I'd copy. We gate irreversible public posts the same way: the approval is a file the owner answers outside the conversation, and the executor checks that file, not the chat history. Curious how you handle an unspent grant: if I type commit and the session compacts or restarts before it's used, does the pass survive, or does it expire with the session?