Advanced Tip: How to use Git history to improve AI agent skills
Building AI agent skills is the highest-value thing to learn with AI agents right now. Skills are what make an AI agent do your work, your way, instead of th...
Building AI agent skills is the highest-value thing to learn with AI agents right now. Skills are what make an AI agent do your work, your way, instead of the same average output everyone else gets from the same model.
But the skill you first write is rarely the good one. A skill gets good the way a new hire does. You use it on real work, you correct what it gets wrong, and it comes a little closer each time. The improving is the real work, and it is where most people stop too early.
If you are new to skills, read my previous article on what a skill is, the four levels it can grow into, and the five ways to create one: Building AI agent skills is the most important thing you can learn right now. There are 4 levels of skill complexity.
This article is about improving a skill you already have, and one advanced way to do it fast.
The usual way, and why it slips
The usual way to improve a skill is one correction at a time, in the middle of doing the actual work. The skill gets something wrong, you notice, and you tell Claude Code directly to update the skill so it does not happen again. That is two jobs at once: getting the work done, and teaching the skill to Claude Code. Your attention is on the task, so the teaching sometimes slips. You have to remember to stop and give the feedback, every time, while your real goal is shipping the thing in front of you. It works when you always remember.
So what if you could just focus on the work, and improve the skill afterward?
The smarter way: learn from your Git history
One way is to always use Git version control to track your changes, and then use that Git history as the source for improving the skill. If you commit as you go, your history already holds every correction you ever made. The first draft you committed is the agent’s work. Every commit after that is your correction, with the diff showing exactly what changed and the message showing what you asked for. You could point Claude Code to walk through the Git history to pick up anything worth learning to improve the skill.
If you do not use Git yet, that is the one habit to start with. It is free, it takes minutes to set up, and you do not need to learn any of it by hand. As you will see below, Claude Code can run every Git command for you.
That is the advanced tip. The rest of this article is how to do it.
What you need before this works
Two things make this work:
- You commit your work with Git, and each meaningful step is its own commit.
- Your commit messages record what happened. Mine log the prompt I ran and a short summary of what changed, so the message alone tells the story of that step.
If you have those, your repo is already a dataset. You do not need to build anything new.
A worked example: my LinkedIn post skill
The skills I will use to show this are my /linkedin-post and related skills. The same approach works for any skill you teach by correction.
The whole tactic is two prompts in plain English. I never wrote a single Git command. Claude Code worked those out on its own. That is the part to take away: you do not need to know how to dig through Git history. You need to know what to ask for.
Prompt 1: find where the work began
I picked one article I had taken from first draft to finished post, a GoDaddy vs Cloudflare piece. I pointed Claude Code at the folder with one instruction:
find the commit where this article folder was first created
That is the whole prompt. No flags, no Git syntax. Claude Code worked out the Git commands on its own and found the exact commit where I first ran /linkedin-post to draft that article from a cohort WhatsApp chat.

Prompt 2: one subagent per commit
Once it had the starting commit, I gave it the second instruction. This is the one that does the work, verbatim:
starting from commit a109acb, use one subagent per commit to look at the commit message, file changes and my manual edits to identify general patterns worth learning to improve /linkedin-post, /linkedin-cover-image and /linkedin-post-from-article skills
I described the outcome I wanted, in the same words I would use explaining it to a person.

Claude Code listed every commit from a109acb to now that touched this work. Eleven commits. Then it launched one subagent per commit, in parallel. Each subagent read its own commit: the message, the file changes, and the manual edits I had made. Each returned the generalizable lessons for whichever skill that commit belonged to.
One commit per subagent matters for two reasons. Each subagent gets a clean, small context instead of trying to hold the whole history at once, so it reads the changes carefully. And eleven of them run at the same time, so the whole pass finishes in about the time one would.
What it found
The most useful output was the set of edits that recurred across commits. A one-off edit might be a mood. The same edit showing up in four different commits is a rule.

Look at how well Claude Code pins down a voice here. These are rules I follow on instinct and had never written down. It did not get them from anything I told it. It reverse-engineered them from the edits I had already made, and named them more clearly than I could have.
It also caught something the content rules were missing. Several of my edits were pure grammar: number agreement, “whereas” versus “where”, a dropped “that”. So it proposed a separate proofreading pass, because the voice rules were never going to catch mechanics.
I read each proposed rule, kept the ones that matched how I actually think, and let Claude Code write them into the skill files.
Why this beats the one-at-a-time loop
The in-the-moment loop has two limits. It sees only the edit in front of it, so it cannot tell a one-off change from a habit. And it makes you teach while you work, so the teaching is the part that slips.
Mining the whole history fixes both. It sees every correction at once, so the habits stand out: the edits you want the skill to stop making you do. And the teaching moves to its own pass. You do the work and commit, which you would do anyway, then improve the skill later. Nothing slips, because nothing is competing with the work.
The expert is still in the loop
It is worth being clear about who does what here, because it is easy to read this as “the AI improved itself.”
The edits are mine. Every correction in that history is a judgment I made about what good writing looks like. Git recorded them. The subagents read the record and spotted the patterns. I reviewed every proposed rule before it went into a skill, and threw out the ones that were wrong.
The AI changed the speed and scale of finding the patterns, not the source of the judgment. The expert stays in the loop. Git is the memory of what the expert already decided.
Honest limitations
A few things to know before you try this:
- It needs clean commits. If you commit the AI draft and your edits together in one commit, the subagent cannot tell which lines were the AI’s and which were yours. Commit the generated draft first, edit, then commit again.
- One subagent per commit costs tokens. For a piece with eleven commits, that is eleven agents. Worth running once in a while on your most-edited skill, not after every post.
- You still review. The subagents propose rules. They do not get to write your skill unsupervised.
What to do with this
So here is what to do with it. Pick the skill you have corrected the most, point Claude Code at the full history of that work, and let it tell you what you keep fixing. Writing is just where I started; it works for anything you teach by correction.
And if you take only one habit from this, make it this: commit the AI’s draft before you edit it. That single separation is what turns your version control into a record of your judgment, the one thing the AI cannot come up with on its own.
If you would like to learn the foundations of working with Claude Code and AI agents, join my upcoming workshop. The next two cohorts are on 18 June and 2 July. It is built for non-techies with no prior knowledge of Claude Code or Terminal.
Details: https://boonkgim.com/workshops/foundations-claude-code/
#AI #ClaudeCode #AIAgents #AgenticAI #BuildInPublic
Enjoyed this? Subscribe for more.
Practical insights on AI, growth, and independent learning. No spam.
More in AI Agents
Most marketers know Inbound and Outbound Marketing. But have you heard of... Rebound Marketing?
No? That’s because I just coined it.
DeepWiki: AI-Generated Docs for Any GitHub Repo
If you're using open-source software, one of the most common problems is outdated or poor documentation.
Klarna’s latest move to bring back some humans for customer experience after their ambitious AI...
It’s progress.
"How do I know if an AI agent skill is safe or malicious?"
I have been hearing this question very often recently. So I thought why not write about it.
No, Karpathy Didn’t Say Vibe Coding Doesn’t Work
This starkly contrasts with my own experience.
Why Your OpenClaw Agent Is One Message Away from Getting Hacked?
A stranger sent a very long, sophisticated-looking message to her agent. It was filled with detailed research instructions about finance news, complete with ...
Most marketers know Inbound and Outbound Marketing. But have you heard of... Rebound Marketing?
No? That’s because I just coined it.
Klarna’s latest move to bring back some humans for customer experience after their ambitious AI...
It’s progress.
No, Karpathy Didn’t Say Vibe Coding Doesn’t Work
This starkly contrasts with my own experience.
DeepWiki: AI-Generated Docs for Any GitHub Repo
If you're using open-source software, one of the most common problems is outdated or poor documentation.
"How do I know if an AI agent skill is safe or malicious?"
I have been hearing this question very often recently. So I thought why not write about it.
Why Your OpenClaw Agent Is One Message Away from Getting Hacked?
A stranger sent a very long, sophisticated-looking message to her agent. It was filled with detailed research instructions about finance news, complete with ...