How to Make Claude's Code Improve on its Mistakes

is an incredibly powerful coding agent, which you can use to perform many cognitive tasks on your computer. However, continuing education is still a profession we strive to educate agents. In addition, continuous learning is an activity that people are incredibly good at.
Don't just think about any activity you've been doing for a long time. In almost all cases, you will get better at that job over time, learn from your mistakes and improve on them. This is not just a matter of remembering what works and what doesn't. It's about building a sense of duty, which you get more easily by doing it over time.
In this article, I'll discuss how you can get continuous learning in common with your coding agents. Continuous learning of agents is still an unsolved challenge, but I will go through how I can make my coding agents learn from their mistakes and improve over time. Furthermore, the content I'm going to include in this article will make your agents better at the jobs you specifically want them to do well, whether it's making shareholder presentations, troubleshooting bugs in your specific codebase, or something completely different.
Why we need to read regularly
We need to keep learning because we always want to be better at what we do. Imagine if you have been a programmer for many years, and you still make basic mistakes, like forgetting the colons after the if statement in Python.
Obviously, making such mistakes continuously is not helpful, which is why we want to avoid them. We want to be better at work, be more successful at it, and thus be able to solve difficult problems.
Working at a job for a long time will help you develop an intuition for the job, and help you solve more advanced problems in that area.
You can think of a new coding agent as a new employee. Obviously, they will make mistakes at first, since they don't understand the preferences or the codebase. However, if you tell a new employee how to do something, you expect them to learn that over time.
If you don't take specific steps to make your coding agents remember such things, they will probably forget them, which is why you need to take active steps to achieve continuous learning for your coding agents.
How to Get Continuous Learning
In this section, I will include some strategies that I use every day to achieve continuous learning. These strategies come from talking to others who work in the same field, inspiration from the OpenClaw repository, and my own experiments.
General information command
A simple and effective way to make Claude Code learn from its mistakes is the general knowledge command. This is a simple command (also known as a skill, a lay-out file that contains information) to learn from a particular piece of music.
I usually use this command whenever I finish a dialog from Claude Code, I do one task. For example, if I:
- Finished using the feature
- You have solved the error
- He made a presentation
- Finished checking production logs
I simply run my command with:
/generalize-knowledge
This works because I saved a standard info command, which is a warning like the one below:
Generalize all the knowledge from this thread into claude.md and agents.md.
Write down any information that would be useful for a future agent working
in this repository. Also note down any issues you encountered, and how you
resolved them.
Write the tasks you performed to the done-tasks.md file with time and date,
and a summary of the tasks.
In short, I tell the model to learn from their mistakes and write down anything that can be useful for future collaborations.
I also made the agent log the work it did, so I have one file that contains everything I did. This isn't really necessary, but I find it nice to have this kind of summary available.
Also note that this assumes that you always do one operation in the Claude code chain, which you should do for best results. This also applies to all other coding agents available, simply because the single thread function helps the agents stay focused and avoid the noise that fills their context.
Everyday thoughts
To build on the last stage, you can also have daily display settings. If for example you have multiple agents running throughout the day, you can have a cron job (a command scheduled to run at a specific time), to go through all your agent's coding logs for the last 24 hours, and write any useful information. This builds on the general information command, but works at a higher level, as an agent traversing your logs will not only have access to one thread, but everything you're working on.
This can be helpful, as a different perspective can lead to different notes being written, which will help you and your coding agents work more efficiently.
Skills
Skills is another concept I would like to include, which really helps contribute to continuous learning and helps Claude Code learn from its mistakes. The previous sections I covered, mostly write to the standard files CLAUDE.MD, AGENTS.MD, WARP.MD. Skills, however, are specific files that tell the agent how to perform certain tasks.
This is almost the same as the general information command, but is slightly different as the standard files note common errors and solutions, while the skills cover more specific topics. Some examples of skills are:
- How an agent should act when filtering your email
- How an agent should do when sorting your calendar
- How to use a specific API or package. This is especially important for small and unknown APIs and packages that are not well covered in the previous training of LLMs.
- How to troubleshoot a specific repository
As you can tell, the skills are specific. So, whenever you start working on a new package, API, or new functionality in general, I urge you to create a capability for that. The skill should cover everything that is useful to know when working with an API or at work. Including:
- How to interpret given tasks within a given topic
- How to deal with and solve tasks
- Mistakes made in the past, and how they were resolved
The more information you keep, the better. Your coding agent will usually load this skill when you start working on a related job.
For example, if you ask your agent to sort your email, it will hard-load the ability to filter the email, so it knows how to do it. This helps your coding agent avoid previous mistakes made when filtering your email.
The conclusion
In this article, I've covered how Claude Code and other coding agents learn from their mistakes. I have discussed three main strategies that I should use, including making a general information command, reading agent logs every day, and actively using skills when working on tasks. I believe that learning from your mistakes is very important, both for humans and machines. If you can successfully make your coding agents learn from their mistakes, you will be more efficient at using them, and thus gain a greater advantage compared to other agents who do not learn from their mistakes.
👉 My Free eBook and Webinar:
🚀 10x Your Engineering with LLMs (Free 3-Day Email Course)
📚 Get my free ebook Vision Language Models
💻 My webinar on Vision Language Models
👉 Find me on social media:
💌 Stack
🐦 X / Twitter



