Get the guide to build your first AI agent directly in your inbox with a newsletter signup:
I finished reading a book called Scarcity Brain.
Long story short, it starts with why slot machines are addictive and all the other areas in life where the same pattern makes us addicted to something.
Knowing those rules serves 2 purposes
Breaking bad habits
Building new good habits
I decided to apply them to the second point, so I asked myself: How do I become addicted to coding?
What are the rules to become addicted
The book defines a scarcity loop that keeps us addicted. The rules are 3:
Opportunity: The action is available to you, without friction. Slot machines are available in many restaurants and bars, not only in casinos
Unpredictable reward: Doing the actions doesn’t guarantee results, but you also have some results. That’s why there’s more than 1 winner in any lottery game, and why slot machines don’t give only 1 big prize, but many smaller prizes.
Quick repetition: You can repeat fast. That’s why slot machines were made digital, because pressing a button and slots in a screen was faster than pulling a bar and physical reels.
Now coding already had ingredients to get addicted to coding, but AI just added steroids to it:
Opportunity: Anyone with a computer could code, but you had to learn a bit about it. Now AI writes code from natural language, and you can even send prompts from your phone.
Friction is smaller now. You can start an iteration of the Scarcity loop with a quick prompt and go to sleep, or go commute to work, and the next phase of the loop will be ready for you.
Unpredictable reward: Sending a build command didn’t guarantee the code would compile. You may find bugs, or it may work; it’s a bit unpredictable. Now AI makes the results of a prompt unpredictable too, so you want to see if the prompt results were good and if the code will work as expected
That “maybe” hooks us addicted to sending the next prompt. Especially when it looks like this time will be the right one, but it’s not.
Quick repetition: The write-build-verify loop of coding was tedious, and any small productivity trick that tightened the feedback loop was a huge productivity win and made coding feel better. Now with AI you can run many more feedback loops in parallel, making the limit your AI usage limits and your wallet.
We can even queue prompts one after another, or scale horizontally with more agents working in parallel that will do the work and provide us the results.
You can get addicted to AI coding because it turns a difficult problem into a fast sequence of uncertain but potentially valuable results
Create your own loop for software coding
First, we have to create the opportunity.
Choose a real problem with a visible outcome. Don’t build for the sake of building, but break down the work into milestones.
The same way agile methodologies aim for working software and a visible outcome from each ticket, you want something visible for each agent session.
Then, we have to create rewards.
Besides the predictable rewards of advancing in your plan, you want unpredictable rewards provided by AI.
All AI outputs are unpredictable rewards. Discovering all the alternative solutions to solve a problem and picking one is a reward from a design session. Finishing the code implementation and launching your software to test if it works as expected is another unpredictable reward
Finally, we have to make repetition fast.
Coding experiences with fast models like Cursor with Composer is one alternative. You just stay in that session iterating rapidly with AI. But if you’re using models that take around 15 minutes per prompt, you’ll want to have multiple agents working.
To have many agents working without switching from one to another all the time, you have to give them permissions and teach them to do many steps, like running the builds and tests, inspecting logs, iterating, etc.
Fast repetition doesn’t mean switching from one agent to another for small internal steps. The real feedback loop is running our software and testing if it works or not. The faster we can make that iteration, the more addicted we become to working on it.
Don’t code for the sake of coding
A great power comes with a great responsibility.
Now that you’re becoming addicted to coding, you should know that “tokenmaxxing” (wasting tokens without any real outcome) is not the point of this article.
This is about getting you to code and to enjoy coding. But coding some software you don’t even want to use is useless.
Instead, you need to define your goals, and once you’ve met them, you should define what’s “enough”
There’s right answer is not about coding more or less. It’s about what’s enough to meet your goals.
So at the beginning of each coding session, write the 3 things you need to achieve. Don’t add more features to your software because htey are cheap to build now. Prioritize them.
AI is very good at generating artifacts, and this creates another problem.
We may think we are getting “more throughput” because we generate more PRs or more docs, but the reality is that we are decreasing our real delivery throughput compared to using AI correctly.
This is a loss disguised as a win. If you create more review work, more future rework, and more on-call problems for a feature that people don’t use, then that was not a win, even if it looks like it at the beginning.
Conclusion
We’ve learned the 3 rules to become addicted to anything, and we’ve applied them to coding.
AI makes coding more addictive by design, but if you’re procrastinating when you start coding, then apply the 3 rules:
Create opportunities to code more often, and remove opportunities to distract yourself with anything else
Surprise yourself with the alternatives that AI proposes that you would have never thought of yourself
Launch agents in parallel to constantly trigger new iterations of the loop that keeps you hooked on coding.
Happy coding!
If you found value in this post:
❤️ Click the heart to help others find it.
✉️ Subscribe to get the next one in your inbox.
💬 Leave a comment with your biggest takeaway
♻️ Share it with your peers
Today’s article will allow you to move faster through the phases of our system to become productive engineers and get promoted faster
I’m building this system below for paid subscribers. Thanks for your continued support!











