I Built a Tool That Stops AI Coding Assistants From Forgetting Your Project
Every new chat with an AI coding assistant starts the same way. You open Cursor or Claude Code and explain your project's conventions again. Then you explain why you chose one library over another, and the gotcha that broke production last month.
The assistant can see your code, but it has no idea why the code is the way it is.
Where the idea came from
I run a small automation business, and I'd built a scraper that pulls pain points from Hacker News threads. One thread stood out: "How are you LLM-coding in an established code base?" It had 70 points and 66 comments. Developers were swapping workarounds, and the most common one was manually telling the AI to update its own notes after a change. Nobody had automated it.
That was the product: a system that takes those notes after every commit, so you don't have to.
The plan
- A git post-commit hook fires after every commit and grabs the diff.
- The diff goes to an n8n workflow, which asks an AI model one question: did this commit reveal anything worth remembering?
- If yes, a
CONTEXT.mdfile gets updated. If it's a typo fix or a formatting change, nothing happens. - The same content is copied into Cursor's rules folder, so it loads automatically in every chat.
It sounded like an afternoon of work. It took much longer.
The six bugs, one at a time
Each of these looked like the last bug until I fixed it and found the next one.
1. Git that couldn't be found
n8n ran as a Windows service under a different account than mine. Git worked fine in my terminal, but the service couldn't see it. I added it to PATH, rebooted twice, and it still didn't work, so I stopped fighting the service and moved git out of n8n entirely. The git hook now runs as me, and n8n only receives the result.
2. A file that "wasn't writable"
n8n's own file node refused to write, even though a plain terminal command could. The cause was n8n's internal write check, which I bypassed.
3. JSON that broke on real code
Pasting a raw git diff into a hand-written JSON string fails the moment the diff contains a quote or a newline. The fix was to build the request as an object and let the platform escape everything.
4. A command line that was too long
My workaround for the file problem passed AI output through a PowerShell command, which broke as soon as the content got long.
5. Data that wasn't what it looked like
The diff arrived at n8n perfectly, but my code decoded it into garbage. n8n was storing binary data on disk and handing me a reference (literally the text "filesystem-v2"), not the content. Once I used the proper helper function, real text appeared.
6. A design that only worked on my machine
The first version assumed n8n and my repo lived on the same computer. I redesigned it so the hook sends everything up and writes the response back locally. Now it works whether n8n runs on a laptop, a VPS, or the cloud.
The moment of truth
My first before-and-after test looked identical. I asked Cursor why my retry logic used jitter, made a commit explaining the reason, and asked again. Same generic answer.
The problem was Cursor, not the automation. It doesn't load a file called CONTEXT.md just because of its name. Once the hook also wrote to Cursor's rules folder, I asked in a brand new chat with no tagging, and the answer referenced my actual reasoning.
Here's that before-and-after, recorded start to finish:
What I learned
- Don't trust "it works on my machine" until it runs somewhere else.
- When a bug survives your best fix, question the layer below it. Most of my problems were in the environment, not the code.
- Test with the exact question you'll demo. My first test would have made a terrible video.
What's next
The tool only adds notes for now and never retires outdated ones. Pruning stale entries is next, along with output formats for other AI coding tools.
Related build logs:
Pinterest Autopilot V4: another workflow where the environment, not the code, caused most of the pain.
Figma Drift Watcher: how a design-change monitor got built on top of a rate-limited API.
Want to skip the build?
I packaged the workflow so you can set it up without rebuilding the whole system yourself.
Get Context Auto-Maintainer →Prefer to see it first? Watch the before-and-after demo on YouTube.
More posts: back to the Blaze Automates blog for other build logs.