margin: an agent review tool
It’s been two years since the last post, so …, what held me back? Primarily, a wonderful daughter found her way into my life, grounding me and giving a lot of purpose to life. Who would have thought, right? But that did not mean I have been slacking. wastebin has been chugging along, binge my binary installer and weave my final zk web frontend have seen the light of day, I finished the meater readout project, which was a great help for the first half year after birth of my daughter, etc. I just never came around writing about these things which would only interest five people in the world anyway.
Now with agentic software development finding its way into people’s lives, that interest will approach zero. Software has become a commodity and frankly speaking: it’s alright. I love the puzzle aspects of programming and the good feeling of coming up with a clean and easy to understand architecture. But I also enjoy that LLM agents free me of the boring things around software development and computer usage in general: writing CI pipelines, dealing with frontend peculiarities, understanding nginx issues, digging into Neovim Lua plugin details. At the end it makes no difference if I copy paste a StackOverflow snippet into my config or an agent. Long story short: I’m fine with AI. More people than ever can make great software with limited time and money spent. Yes, the fear is real that we are inundated with crap but at the end of the day, it will also raise the bar for mediocrity. There will always be a place for really great software.
Because to this day agent coding is still a tool with enough sharp edges, a human still has to stay in the loop. But as any human can tell: talking to a bot in a chat interface is not staying in the loop, it’s a disgrace. Reviewing either means understanding and approving every little or huge chunk of generated code (remember King-Size Homer and his drinking bird?) which just does not scale. Or reviewing means going full auto-mode and checking the diff on disk. However, that quickly becomes annoying because telling Claude what to change where is a chore and will still miss important details. Another popular method is opening (draft) PRs on GitHub or your-forge-of-choice but it feels schizophrenic and wastes tokens on unnecessary round trips. And it depends on GitHub not having one of its outages again.
With that said: margin tries to address the annoying review by simply annotating lines of diffs and handing those over to an agent “in the box”. Here is a screenshot to give you a rough idea:
The interface is as simple as it gets: you go through the diff of changes, and
either on a line or after selecting multiple lines with v, hit a or Enter
to enter required changes. Behind the scenes, margin manages an annotation log
in the hidden .margin directory that the agent can read and modify itself.
Once done either hit C to hand over all annotations to a headless Claude
session or call the /margin-review skill to address them in your open session.
The skill will open the annotations, find what to change where and resolve them.
The top toolbar can be reached with Shift-Tab and allows to switch between the
commit list, the file list and all annotations. Of course, there are the usual
goodies you find in a “modern” diff-based TUI tool like showing more/less context
with +/-, split view, syntax highlighting, intra-line highlighting, shelling
out to $EDITOR etc.
However, I see your eyes rolling because the tool is mostly generated code but that’s where we are today. I could have written that thing myself but it would have taken orders of magnitude more time that I rather spend with my daughter. Nevertheless, I took the time to type all these words. See you in two years!