Hello Everyone! 👋 Welcome back to Part 3 of the Mastering Claude Code Series.
In our previous post, we took a deep dive into the 3-Layer Architecture of Claude Code (The Brain, The Harness, and The Tools). We saw how they work together, and why understanding this is crucial for mastering AI-assisted development.
But before we dive back into the next set of foundational concepts, let’s hit pause for a moment. ⏸️
Whenever you learn something completely new and paradigm-shifting (like the fact that the AI model is stateless and doesn’t actually touch your files directly), it’s completely natural to have questions.
So, instead of just rushing forward to continue the foundation, let’s first address and explore some of the most burning doubts you might have from the previous part. Clearing these up will make everything that follows much easier to understand! 💡

In our last post, we explained that when the AI “forgets” something, it’s often because that information was pushed out of the Context Window.
“The AI did not forget in the human sense. The reality is that the relevant information was simply no longer present in the reconstructed context package.”
While that is directionally correct, it is only half the story.
When an AI model seems to ignore your instructions or forget a rule, there are actually two entirely different mechanisms at play.
Mixing them up is a huge mistake if you want to master AI.
This is what we talked about previously. As the conversation gets too long, older information is literally removed, truncated, or heavily summarized by the harness to save space.
This is the silent killer of AI productivity.
In this scenario, your instruction is still inside the context package. It hasn’t disappeared or been deleted. However, the context window has become so bloated with giant code files, error logs, and long conversations that your one small rule gets completely buried.
Let’s understand this with a simple human example: Imagine you are a chef in a busy kitchen.
What happens? You didn’t “forget” how to read, and the instruction wasn’t deleted from the paper. But because there was so much other loud, distracting information, your brain naturally under-weighted that tiny instruction. It lost its importance.
This is exactly how an AI model’s “attention mechanism” works.
💡 The Big Takeaway: When your AI misbehaves, you must diagnose it like an engineer:
Did my instruction get physically pushed out of the context (Absence), or did it just get drowned out by too much noise (Dilution)?
This is a fantastic question. You might be thinking: “I put my strict rules in the CLAUDE.md file. I know for a fact that the harness keeps this file in the context package at all times. It is never absent. So why does the AI still ignore it?”
If it’s not an Absence problem, it is definitely a Dilution problem. Even if your CLAUDE.md is physically inside the context, your rules are still missing the mark for three specific reasons:
AI models have a strong “recency bias.” This means they naturally give much more weight and importance to the most recent messages.
If your CLAUDE.md file was loaded at the very beginning of the session (Turn 1), and you are now on Turn 50, that static instruction feels “old” to the model’s attention mechanism. It is technically there, but the model cares significantly more about what you just typed 5 seconds ago.
In any given prompt, the model is receiving a lot of competing instructions all at once:
CLAUDE.md rulesAll these inputs are fighting to “win” the model’s attention. If your CLAUDE.md rule is poorly written or buried, it simply loses the tug of war against the other inputs.
Traditional programming code is deterministic: If X, then execute Y. It is a 100% mathematical guarantee.
AI models do not work this way. They are probabilistic. When you give the AI a rule, it creates a strong statistical tendency for the AI to follow it, but it is never a 100% guarantee.
If saying it once in a CLAUDE.md file isn’t enough, how do we actually force the AI to listen? We have to use smart engineering mitigations to beat the Dilution problem:
TODO.md / SESSION_LOG.md): Do not rely on the AI’s internal context window to remember your project state. Create physical tracker files in your directory and instruct the AI to explicitly read them before taking any action.Note: Even with all these tricks, missing a rule in a massive, complex project is still possible. Context management is an actively researched area in AI, not a fully solved problem!
If you think this is just a personal theory, don’t worry. The exact challenges (and solutions) we just discussed are some of the most actively researched topics in the AI industry right now.
Here is proof from across the internet that the greatest AI minds are fighting the same battles:
AGENTS.md and CLAUDE.md Standard: Using a dedicated instructional markdown file is now an industry-standard best practice (recommended by platforms like Cursor and GitHub Copilot) to feed rules directly into the context window, rather than relying on internal model “memory.”TODO.md and SESSION_LOG.md files as external “durable memory” for AI agents, specifically because the internal context is entirely stateless.CLAUDE.md files into smaller linked documents (like testing.md). Why? To reduce noise and increase the Salience of the active rule.The bottom line? The system isn’t broken—it just requires you to stop treating it like a human with a memory, and start treating it like a machine with an attention budget!
If you want to truly master AI, you need to learn a new term.
Forget “Prompt Engineering”, the future is Context Engineering.
Anthropic (the creators of Claude) officially uses this term.
Here is the difference:
Earlier, we called it “Dilution” or “Low Salience”. The official industry term is Context Rot.
Under the hood, Transformer AI models use an attention mechanism that creates massive pairwise relationships between tokens.
Simply put: the bigger the context window gets, the more calculations the model has to do, and its precision naturally drops.
The context is technically there, but the model becomes “blind” to the specifics.
The amazing thing is that Anthropic has built-in system solutions for this, and they perfectly match the patterns we’ve been discussing!
NOTES.md or CLAUDE.md. We independently discovered this when we started using TODO.md and SESSION_LOG.md!grep or searching).Did you know advanced agents have built-in memory file systems?
In their system instructions, they are given a very specific, aggressive rule:
“ALWAYS VIEW YOUR MEMORY DIRECTORY BEFORE DOING ANYTHING ELSE… ASSUME INTERRUPTION: Your context window might be reset at any moment.”
The AI is literally trained to assume it will get amnesia at any second, so it must write everything important down in a physical file!
If there are so many mitigations, why does the AI still sometimes miss a rule?
Because the AI still has to choose what to write down in its memory files. If a compaction (auto-summarization) happens before the AI decides to write down a critical rule you mentioned, that rule is gone forever.
It is a best-effort system, not a guaranteed system.
Anthropic has an official guide called the “Multisession Software Development Pattern.”
Their recommended workflow is exactly what we have been figuring out together:
We independently discovered the exact engineering patterns that the creators of the AI themselves recommend!
You are no longer just a user talking to a chatbot. You are now a Context Engineer.
To wrap up our deep dive into the foundations:
TODO.md files, inject repeated reminders (hooks), and don’t be afraid to clear your conversation (compaction) to keep the context clean.We have officially finished sharpening the axe. You now know exactly how the AI brain works, its limitations, and how to engineer its context.