An AI server project
For nearly 20 years I’ve hand-maintained an Ubuntu Linux server for somebits.com. Every few years I had to recreate it from scratch, a tedious process involving a couple of days of forensics, editing config files, watching logs... so boring. And often stressful because I was doing it only after the old server had died.
No more. I now have a brand new server running NixOS. Here’s the thing. I don’t really know Nix. I played with it once for about an hour and thought “this is cool but too much to learn”.
Thanks to Claude Code and Opus I don’t have to learn it. The AI knows it already. And I think NixOS is a good match for an AI. The whole thing is declarative, you configure the server with some basic text files. AIs are good at writing text and testing the results!
The result worked spectacularly: way better than I expected. I thought I’d tinker with this for a week and learn how poorly AIs are at this complex a task. Instead it got it done for me in about a day and I was ready to switch over. I’m confident Claude did a better job than I would have myself, and much much faster.
The project took 270M tokens, 6M of which were actual work (the rest is cache). Claude values that at about $200 although I did it all in my $20/mo plan.
How I worked with Claude
In the past I haven’t trusted Claude to do complex things with live sites but this time I was setting up a brand new server so was willing to go full YOLO. The more work it did, the better.
I first wrote a page-long README explaining what I wanted to Claude and asking it to come up with a design document. I described the server, pointed it to my old notes, copied off some config files for it to look at, and told Claude I wanted it to do as much work itself as possible. I also suggested Nix. We talked back and forth for awhile and it drafted a 15 page design document. Too much to read! But I skimmed it and suggested some changes. Honestly it was Claude itself that was going to be reading this thing frequently. This whole design process took an hour or two back and forth.
Then I started a new Claude session and asked it to create a work plan. It came up with about 12 pages of specific tasks, each labelled as to whether Claude could do it or I could. (In general I only gave it access to the new server so I had to manually do things to DNS entries, the old server, etc.) One key thing it started doing here was asking for more data from the server, writing scripts for me to run to collect things it wanted to inspect. It made good choices. Again this took a couple of hours.
Then I fired off Claude sessions over a day or so to do the actual work. The work plan was helpful here: each Claude session new what to do or what to tell me to do for it. And I had some idea what it was going to do. Mostly it stuck to the plan and resisted the urge to add things to it: we did create a future work document for new ideas that came up. This process took maybe 4 hours? Some of the time was spent waiting for long network test jobs to finish.
The actual building of the Nix config files went remarkably quickly. The real work was all the testing, particularly in the final phases. Claude was way more thorough than I would have been which was reassuring. OTOH I don’t really know how complete those tests are. They seemed pretty good to me.
I started new Claude sessions every hour or two, after major work. The context window gets full. And anecdotally AIs get dumber as the context gets longer. Automatic compaction is supposed to help with that but I don’t trust it. I’d prefer Claude to dump its thinking into permanent documents that it rereads in a new session, that way I can read them too. The design and work plan docs were the big ones.
Claude Code also keeps a memory. Most of it is technical notes but it’s also developing a theory of my own personality.
- He wants to be able to verify things himself
- He values finding what was missed over being reassured
- He gives blanket “work alone” permission for a stretch and expects a plain report at the end
I still need to have one more session with Claude to tell it to summarize the work it did and document things. It created a lot of scripts, some of which I will want to use. Again these docs are partly for me, partly information for future AI agents.
Thoughts on using AI for devops
This is the first project where I really trusted Claude Code to do things, as an agent, to make server changes and lots of network requests. It worked fine. Great, actually!
This is also the first project where I think Claude did a better job of the work than I would have. First, I don’t know Nix, and while I could have learned it on the fly it would have taken a lot of time and I wouldn’t have been good at it. Also Claude was just much more organized and thoughtful about server setup tasks and how to verify they worked correctly. And it thought of a lot of things I wouldn’t have, like the subtleties of the new server having an IPv6 address.
The magic thing here is how self-directed Claude/Opus was. It came up with its own idea about how to figure out what was on the server. Then came up with its own tests, like a complete set of 150,000 URLs (from Apache logs) to verify and then a 6000 URL sample to run for development work and a 22 URL sample for a smoke test. It wanted to actually test all 150,000 for a final ch eck and I told it that was too much so it whittled it down to 17,000 URLs that would test all the important paths through the server configs.
I’m trying to think what didn’t go well and not coming up with a lot. Opus is awfully wordy though, it’s a bit exhausting to talk to. Maybe I’ll find out something big went wrong in the next few days.
I do need to double back and learn to read the nix configuration files, or at least understand them. Maybe I’ll find something awful in them but on first look they are reasonable.
If I were a working sysadmin I’d be real nervous about my job now. I guess most of them already are. There’s still room for a human in the loop, at least for now. I felt like I had to manage Claude’s work, I gave it a lot of guidance in how to do certain things, and I was riding it pretty hard to verify its work. But the job I did was more like someone managing devops folks with 5+ years experience than being that devops person. This suits me fine, but it is alarming for my industry.