Pablo Rivera Conde

AI Thinking Is the New Compiling

Classic XKCD post. In it two people appear sword-fighting on their chairs. Somebody asks them to go back to work, and they are replying the code is still compiling; excuse the other person accepts

Mandatory XKCD reference

Back in university, one teacher told us about when he was studying, and the campus had a mainframe to do the calculations for all the students. They had slots of time to use, and the system was slow, so they had to be really sure that compilation was going to be worth spending their time on it.

I spend my university times in the early 2000s. Computers were good enough to compile the Java applications we were working on, so the story felt dated.

But, nowadays we are facing a quite similar scenario. Now we don’t have a problem with compilation or building time, as those processes happen blazingly fast. But we are getting used to the commodity of AI. And AI needs time to gather context, evaluate and give a response… And all of a sudden we are again in this old-fashioned situation that professor told us once.

So here we are, slacking off while we get a response. We lose focus, grab the phone, and remember half an hour after we were waiting for Claude to end. Right now the main solution goes through working in tasks in parallel, but a git repo doesn’t allow that… or it does?

I was lucky because in my pre-AI workflow I was already using git worktrees. It is a hidden-but-old feature in git in which you can have different branches checked out in different dirs, at the same time. So you can work on multiple branches, or have staged changes in them, without having issues while switching between them. It’s funny that an old feature like this is gaining traction because of AI. We are surrounded by treasures we didn’t make the effort to find.

Git worktrees are not perfect. In fact there are some pain points from even the command line itself, that makes it hard to use. I created a wrapper script on top of git worktrees to streamline my project setup. In this script, I:

So with just a wadd feat/new-ticket I had the setup ready to go.

I’m currently changing my setup and I discovered Worktrunk. It replaces completely my script (everything I was doing Worktrunk does it, or can be configured to do it). I found it a natural improvement from my scripts, and has some extra features I want to explore (like deterministic ports to be able to have multiple branches running at the same time).

The usage is simple. It allows you to know fast your worktrees status: How many you have, their git status, and the ability to switch to any branch from another, making easy the context-switch. The UI is compact and direct, and the CLI commands easy to understand.

$ wt list
Branch       Status        HEAD±    main↕  Remote⇅  Commit    Age   Message
@ feature-api  +   ↕⇡     +54   -5   ↑4  ↓1   ⇡3      6814f02a  30m   Add API tests
^ main             ^⇅                         ⇡1  ⇣1  41ee0834  4d    Merge fix-auth: hardened to…
+ fix-auth         ↕|                ↑2  ↓1     |     b772e68b  5h    Add secure token storage

○ Showing 3 worktrees, 1 with changes, 2 ahead, 1 column hidden

AI workflows are complicated because everything might change in a new model version, but knowing your tooling and make it yours, and cognitivally aligned to you was and will be key. Git worktrees were useful to me in the past and now they are even more useful. So, even if working in parallel stops being a necessity I’ll keep using them.

#workflow #genai

Reply to this post by email ↪