Skip to main content
ariefrse.my
HomeSkillsProjectsAI WorkWritingContact
Resume
All writing

Note · Agentic engineering

Teaching AI assistants to remember past mistakes

Agents forget between sessions. The repo does not. Every regression a reviewer catches becomes a constraint the next session starts with.

July 3, 2026 · 4 min read

Agents forget between sessions. The repo does not.

On my HRMS project a seeder bug, duplicate employee IDs from an un-deduplicated pluck, silently broke CI. The fix was one line.

The durable fix was a standing section in the repo's CLAUDE.md that every agent session loads before touching code:

## Known CI Footguns: Never Re-introduce
1. Seeder dedup: always ->unique() on pluck('employeeId') in
   MockDataSeeder: duplicate IDs will break seeding silently
2. Leave calendar scoping: non-approver roles must only see
   their own leaves; global scoping breaks this
3. Staging Docker BuildKit cache is flaky, pre-existing,
   unrelated to code changes

The rule is simple: every regression a reviewer catches becomes a constraint the next agent session starts with, instead of a mistake it gets to repeat.

Why this beats a wiki

It lives next to the code it protects, so it cannot drift out of the workflow. Agents read it whether they remember to or not, because loading it is not their decision.

Each entry is a constraint, not a post-mortem. Agents act on imperatives far better than on narratives. "Always call ->unique()" is actionable. "We once had an incident where duplicate IDs caused problems" is a story.

It stays short. If the list grows past a screen, entries get promoted into lint rules or tests, which are harder still to ignore. A long list of rules is a list nobody reads, including the machine.

What I learned

Do not fight an AI assistant's forgetfulness. Design around it. The repo remembers so the agent does not have to, and a mistake written down as a constraint only ever happens once.

Keeping the list short is the discipline that makes the rest of it work.

agentscontext-engineeringci

Share

XLinkedInWhatsAppThreads

Related

  • Letting an AI hunt for the bugs humans skim pastParity bugs are exactly what humans skim and agents grind through. The most valuable finding was the fix a human had to revert.
  • Write the plan before the codeOne day of writing notes bought a 196-file MVP the next day, because the agent spent zero time guessing what I meant.
  • Running agents in parallel is about waiting, not typingThe productivity is not in agents typing faster. It is in never sitting idle while something runs.

© 2026 Muhammad Arief Roseli

GitHubLinkedInSnapInvois