Claude Code writes yesterday's code because nobody gave it today's

RoutineCode Team·2026-11-22·

To make Claude Code follow your project conventions, put them where the agent reads them at the start of every session. That means a CLAUDE.md file for rules, skills for repeatable procedures, and a check that runs your build and tests before any task counts as done.

The model already knows how to code. What it doesn't know is how your project codes, or which version of your framework you're actually on.

The rest of this post explains why that gap exists and what you can do about it today.

The symptom: plausible code, outdated patterns

One of last month's most-reacted LinkedIn posts on this topic came from Kamil Mysliwiec, the creator of NestJS. He was introducing official NestJS agent skills. His reason was blunt: agents learned NestJS from older versions, so they reach for yesterday's APIs.

The post drew 1,869 reactions and 69 comments. That is a lot of developers recognizing the same problem.

Around the same time, Pallavi Singh described Claude Code as a five-layer engineering system. CLAUDE.md rules and skills were among the layers. Her post drew 798 reactions and 68 comments. A Korean-language post titled, roughly, "I found a good harness" shared Everything Claude Code and picked up 498 reactions.

Read together, the three posts make the same point from different angles. People aren't asking whether the agent can write code. They're asking whether it writes their code.

The failure mode is familiar:

  • It calls an API the framework has since moved away from.
  • It uses a pattern your team replaced months ago.
  • It ignores the helper you wrote so nobody would hand-roll that logic again.
  • It says "done" while the build is red.

None of this looks broken in the diff. That is exactly what makes it costly. The code is plausible. It compiles in the agent's head. It just isn't how your project works anymore.

The cause: training data is a snapshot, and the past outnumbers the present

A model learns from code that existed before its training cutoff.

Any framework that has been around for a while has a long public history. Older versions had years to pile up tutorials, forum answers, blog posts, and open-source repositories. The current version has had far less time.

When the agent picks the most likely way to write something, "most likely" leans toward what was common, not what is current. That is the mechanism behind Kamil's observation.

Your own project makes this worse in one specific way: its conventions were never in the training data at all.

Your folder structure. Your error-handling rule. The decision last quarter to drop a library. The reason a certain shortcut keeps breaking in CI. None of that is public. The agent can't recall what it never saw.

So it guesses. Confidently.

The principle behind everything we build applies here: intelligence is grounded in data. Without it, you get confident guessing.

A coding agent without your project's knowledge isn't dumb. It's ungrounded. The fix isn't a smarter model. It's putting the right data in front of the model at the moment it decides.

The method: what you can do today, with any agent

None of this requires a specific product. It works with plain Claude Code, and the ideas carry over to other coding agents.

1. Keep a rules file the agent reads every session

In Claude Code, that file is CLAUDE.md at the root of your repository. The agent loads it at the start of a session, so whatever is in it shapes every decision that follows.

Keep it short and specific. A long essay about code quality gets diluted. A few hard facts don't.

Start with what the model is most likely to get wrong:

## Stack
- <framework> <exact version>. Use current APIs only.
- <language/runtime> <exact version>.

## Conventions
- Do <current pattern>, not <old pattern>.
  See <path/to/reference-file> for the canonical example.
- All <kind of logic> goes through <your helper>.

## Done means
- <build command> passes.
- <test command> passes.

Pinning the exact version matters more than it looks. It tells the model which slice of its memory to trust.

2. Name the replacement, not just the ban

"Don't use the old pattern" leaves the model to guess again, one step later.

Say what to use instead, and point to a real file in your repo that already does it right. A concrete example in your own codebase beats a paragraph of description. The agent can read it, and it reflects your actual style.

3. Turn repeated procedures into skills

Rules state what is true. Skills describe how to do a recurring job: add an endpoint, write a migration, create a new module the way your team does it.

A good skill is small. It covers one job, lists the steps in order, and points to examples. The agent pulls it in when the task matches, instead of carrying every procedure in context all the time.

Kamil's NestJS skills are this idea published by the framework's own author. The people who know the current version best wrote down how to use it.

If your framework or library ships official skills, start there. Then write your own for the procedures only your project has.

4. Record decisions and failure causes

Sessions end, and the agent forgets.

The most valuable project knowledge isn't in any style guide. It's the decisions: why you chose one approach over another, and why the obvious fix failed last time.

When you make a decision or hit a failure worth remembering, write one line about it somewhere the next session will read. A wrong turn you document once is a wrong turn the agent doesn't take again.

5. Don't accept "done" without evidence

This is the harness part, and it's the one most people skip.

A rule the agent can ignore is a suggestion. A build that fails is a fact.

Make "done" mean that the build ran, the tests ran, and the output is visible. If the agent claims success without showing it, the task isn't finished. It's a claim.

This also catches what your rules missed. Stale knowledge that slips past CLAUDE.md often fails loudly in the build or the tests. That failure is far cheaper than finding the same problem in review, or in production.

6. Prune what's out of date

Your rules file can go stale too.

If CLAUDE.md still describes last year's conventions, you've recreated the original problem inside your own repository. When a convention changes, update the file in the same change. Treat it like code, because the agent does.

RoutineCode works on the same principle

RoutineCode is a Claude Code plugin we build. It applies the steps above; it doesn't replace them.

Before it declares a task done, it actually runs the build and tests and treats their output as the evidence. It records project rules, decisions, and failure causes so they survive the end of a session and come back in the next one. It also splits work by risk. Repetitive tasks go to smaller models, and only risky changes get a deep review.

It installs with npm install -g @routinecrew/routinecode --@routinecrew:registry=https://registry.npmjs.org. Details are in the first comment.

If you'd rather build this yourself with CLAUDE.md, skills, and your own checks, the method above is the whole idea. The plugin is one way to make it routine.

What changes, and how to check it

There are no impressive numbers here. You can check each of these yourself on your next task.

Diffs use the version you pinned. Search the agent's changes for the old API or pattern you banned. It should be absent, and where it would have appeared, the replacement you named should be there instead.

"Done" comes with proof. Every completed task should show build and test output. If it doesn't, you can see that immediately.

The next session remembers. Ask a fresh session about a decision you recorded last week. It should know it without being reminded.

Failures become debuggable. When the agent still gets something wrong, the cause is usually one of three things: a missing rule, a stale rule, or a skipped check. Each one is something you can fix in a file. That beats arguing with a model.

What this won't do is make the agent know things nobody wrote down. Grounding only works with data that exists. The work is writing it down, keeping it current, and checking against it.

The model brings general skill. Your repository has to bring the facts.


#ClaudeCode #AIAgents #SoftwareEngineering #DeveloperTools

#claudecode#aiagents#softwareengineering#developertools

Want posts like this weekly?

Subscribe for AI dev-workflow insights.