Hey, Luca here! Welcome to a 🔒 weekly essay 🔒 from Refactoring.
Every week I write an article about how to ship fast and make good software, and interview a world-class tech leader. I also build and maintain Tolaria in the open, publishing my workflows and learnings here.
Refactoring is read every week by 170,000+ engineers and managers from all over the world!
Two weeks ago we came together in the Refactoring Community for our very first monthly AI Club session!
More than 30 people joined, and 5 volunteered to share recent learnings about using AI at work. Then everyone got the opportunity to ask questions and build on their ideas.
In this edition I will post a recap of the awesome ideas that were shared!
🚜 The “combine harvester” pattern for long AI tasks
🌙 Overnight procedures that catch what rules can’t enforce
📓 A daily rhythm for noticing what we’re learning
🎫 Using AI to make sense of messy stakeholder tickets
🔀 Staged automation of a complex upstream merge
Let’s dive in!
The AI Club is run monthly and facilitated by professional coaches. It is exclusive for paid members of Refactoring, who get access to our private community.
Get the full version of Refactoring to join the next AI Club, on Jun 5th!
1) 🚜 The combine harvester pattern for long AI tasks
Matej Vitasek, CTO, shared how he has been successful at having agents run through long, multi-hour tasks, by having them maintain their state in a markdown file that gets updated as the task goes on.
The markdown file holds:
The instructions
The progress so far
What should happen next
As the task evolves, the file evolves too. You can also make the agent stop after a batch of work, reflect on what could have been done better, and update the process before continuing.
The benefit, as Matej described it, is that the work doesn’t have to happen in one sitting.
Anyone can pick the task back up at a later time and the agent can resume from the markdown file rather than starting over or losing context. For tasks that are too big to fit in a single session — or that you want to step away from and come back to — the markdown becomes a simple working memory.
It’s a small, low-tech pattern, but it works and it’s portable across multiple models and agents.
2) 🌙 Overnight procedures to catch what rules can’t enforce
I personally shared something that is working well for me and I don’t see talked about often: running daily, often overnight, procedures that look back at what happened during the day and try to catch judgment-based things that wouldn’t have been picked up by rules in the moment.
I call these guards.
My starting point is—I believe—the same as everyone: I write rules in the AGENTS.md / CLAUDE.md file, and try to enforce some things via CI and hooks: test coverage, static analysis, code health, and so on.
But there are things that are hard to gate:
Did this change need an architecture decision record?
Has an opportunity to refactor been missed?
Is performance drifting over time?
These are judgment calls, and agents will sometimes ignore rules about them, or simply make mistakes.
So I have set up various procedures that run once a day, each focused on a specific concern. Like, in the cases above:




