My AI Coding Assistant Has Amnesia (And It's Costing Me)
By Chetan Dhandal
I opened a new Claude chat on Wednesday morning to add email verification to our authentication system.
"Use JWT tokens," the AI suggested, generating clean, production-ready code in seconds.
Perfect. Exactly what we needed.
Except we'd spent all of Monday arguing about JWT vs session tokens and ultimately decided on session tokens for this specific use case. I'd even had that exact conversation with Claude. On Monday. In a different chat window.
Wednesday's Claude had no memory of Monday's Claude. Or Monday's architectural decisions. Or any of the context that made session tokens the right choice for our system.
I've started thinking of my AI coding assistant as the world's most brilliant intern who wakes up with complete amnesia every single morning.
When Brilliance Meets Memory Loss
Here's what makes this particularly frustrating: the code quality is exceptional.
My AI assistant can write in any language, implement any pattern, follow best practices I didn't even know existed. It's faster than me, often more thorough than me, and never gets tired.
But every new chat session, it's Day One all over again.
It remembers how to code. It just doesn't remember what we're building.
Last month, I watched this play out across a single week:
- Monday: Designed a user authentication system. After discussion, we went with JWT tokens. The code was elegant, well-tested, perfect.
- Tuesday: Needed to add password reset functionality. Opened a new chat. Without thinking, I described the feature. The AI delivered a complete solution using database-backed session tokens,a completely different authentication approach.
- Wednesday: Email verification time. New chat. The AI suggested a third approach: OAuth tokens.
Each solution was technically flawless. Combining them would create an architectural trainwreck.
And here's the scary part: I almost didn't catch it. I was moving so fast, generating so much code, that I nearly shipped three incompatible authentication systems in a single application.
The Problem Nobody's Talking About
We're all celebrating the productivity gains. And they're real,I'm shipping features in hours that used to take days.
But there's a hidden cost nobody warned me about: architectural drift at AI speed.
With human teammates, there's institutional memory. When Sarah joins the team, she learns our patterns. When Mike makes a mistake, he remembers it (usually). Over time, the team develops a shared understanding of how we build things.
AI has none of that.
Every interaction is isolated. It doesn't know:
- The architectural decision we made last week
- The coding standards we agreed on yesterday
- The technical debt we're actively avoiding
- The business constraint that drove our technology choice
So each AI-generated piece of code is individually excellent but collectively inconsistent.
I've caught AI-generated code switching:
- From camelCase to snake_case in the same file
- Error handling patterns between modules
- Database access methods (mixing ORM and raw SQL)
- Validation approaches (sometimes client-side, sometimes server-side, sometimes both)
The result is what I call a "beautiful Frankenstein." Each part is well-crafted. Together, they don't quite fit.
My New Bottleneck Isn't Typing
For my entire career, typing speed was the bottleneck. How fast could I translate ideas into code?
AI eliminated that bottleneck completely.
And revealed a much more painful one: the limits of my own comprehension.
I can't maintain a system I don't fully understand. And AI is generating code faster than I can build a mental model of it.
With human-written code,even messy human code,I could rely on patterns. Developers tend toward consistency. We copy-paste. We reuse solutions. This creates predictability, even in codebases with multiple contributors.
AI doesn't have those habits. Each generation is fresh, unconstrained by what came before. The code is often better, but it's also less predictable.
So the bottleneck has shifted from my fingers to my brain. And my brain can't scale to match AI's output.
What I'm Doing About It (That Actually Works)
I'm not giving up on AI. That would be like giving up on electricity because you got shocked once.
Instead, I've had to completely rethink my role.
I'm no longer a code writer. I'm a context provider and architectural guardian.
Here's what's working:
1. Project Charters: The AI's Memory Prosthetic
Before any significant AI coding session, I now start with a charter. Every time. No exceptions.
It's a document I paste into the chat that contains:
# Project: Customer Portal v2
## What We're Building
A self-service customer portal for managing subscriptions and billing
## Our Stack
- Frontend: Next.js 14, TypeScript, Tailwind
- Backend: Node.js, NestJS, PostgreSQL
- Auth: Session-based (NOT JWT - decision made in ADR-023)
## Architectural Principles
1. Clean Architecture layers - keep business logic separate
2. All external services go through adapters
3. Error handling uses our custom ErrorHandler class
4. Database queries use TypeORM - no raw SQL
## Code Standards
- Variables: camelCase
- Files: kebab-case
- Async: always async/await, never callbacks
- Testing: Jest, minimum 80% coverage
Think of it as handing the amnesiac intern an employee handbook every morning.
Does it feel redundant? Yes. Does it work? Absolutely.
Since I started doing this, the consistency of AI-generated code improved dramatically.
2. I Design, AI Builds
My workflow has completely flipped.
Old way:
- Open AI chat
- Describe feature
- Generate code
- Hope it fits with everything else
New way:
- Design the architecture first (what components, how they connect, what patterns)
- Document the design clearly
- Give AI the architecture + the charter
- AI generates the implementation
- I verify it matches the design
The key insight: AI is brilliant at implementation, mediocre at architecture.
So I do architecture. AI does implementation.
3. Architecture Decision Records (My Secret Weapon)
Every significant decision now gets documented in an ADR. Not for compliance. For AI.
When I made the decision to use session-based auth instead of JWT, I created ADR-023:
# ADR-023: Session-Based Authentication
## Context
We need secure authentication for the customer portal. Initial consideration was JWT.
## Decision
Using session-based authentication with Redis session store.
## Reasons
1. We need server-side logout (JWT can't do this cleanly)
2. Session data includes user preferences (would exceed JWT size limits)
3. Redis is already in our stack for caching
4. Easier to invalidate sessions on security events
## Alternatives Considered
- JWT: Can't server-side logout, size limitations
- Database sessions: Too slow for our scale
Now when I start an AI session related to auth, I include: "Follow the auth approach in ADR-023."
The AI generates session-based auth. Every time. Consistently.
4. Ruthless Code Review
I review every line AI generates. Not for bugs (it's usually bug-free). For architectural alignment.
Questions I ask:
- Does this match our existing patterns?
- Does it follow the standards in our charter?
- Will the next developer (or next AI session) understand this?
- Does it introduce dependencies we don't want?
If the answer to any of these is "no," I reject it. Even if it works. Even if it's technically better.
Consistency beats optimization when you're building systems you need to maintain.
The Real Transformation
This isn't just about working with AI better. It's about becoming a different kind of developer.
My value isn't in typing speed anymore. It's in:
- System thinking: Understanding how pieces fit together
- Decision making: Choosing the right patterns for our context
- Context preservation: Maintaining the institutional memory AI lacks
- Architectural vision: Seeing the cathedral while AI builds the bricks
I'm less like a solo coder and more like an orchestra conductor.
The AI can play any instrument brilliantly. But without my direction,my score, my tempo, my vision,it's just talented musicians playing different songs.
With my direction, it's a symphony.
What I Wish I'd Known Sooner
If I could go back to my first day using AI coding assistants, I'd tell myself:
Stop treating AI like a senior developer. Start treating it like an exceptional junior who needs clear direction.
That mental shift changes everything. You wouldn't give a junior developer vague requirements and expect a perfect system. You'd give them:
- Clear architecture
- Documented standards
- Specific patterns to follow
- Context about why we do things this way
Do the same with AI.
The developers who thrive in this new era won't be the fastest coders. They'll be the best architects, the clearest communicators, the most rigorous reviewers.
They'll be the ones who understand that AI solved the typing problem but created the context problem.
And they'll be the ones who solved the context problem with charters, ADRs, architectural thinking, and ruthless consistency.
The amnesiac intern isn't going away. It's getting more capable every month.
The question is: will you keep trying to work around the amnesia, or will you build systems that work with it?
I chose the latter. And honestly? I'm shipping faster and building better systems than ever before.
Just with a completely different workflow than I ever imagined.
How are you handling the context problem with AI coding assistants? I'd love to hear what's working for you.
Enjoyed this?
Abhanga delivers one essay like this every Saturday.