Why your AI coding agent contradicts itself in session 5 (and the three-file fix)
Disclosure: this article was drafted with an AI assistant (Claude). #ABotWroteThis An AI coding agent starts every session knowing nothing about the last one. That one fact explains most of the "the agent contradicts itself" complaints. It is not a bad model. It has no memory, and you are the only thing connecting session 1 to session 5. Here is a setup that moves that memory out of your head and…
An AI coding agent starts every session with no knowledge of the previous session, which is the reason most users experience contradictions. The solution lies in storing the project context in files that the agent can reference, rather than relying on memory. There are three key files: Master prompt, Session line, and CLAUDE.md.
The master prompt outlines the project's background, Rarely Scaffold files, and every session; the session line contains the scope for the day and instructions to read the PROGRESS.md file first; and CLAUDE.md contains conventions that differ from the agent's defaults. Additionally, decisions are logged in DECISIONS.md with a date, decision, why, alternatives considered, and when to revisit the decision.
Finally, PROGRESS.md is used to track the project's status and next action, ensuring that risky work is planned, approved, and built in a structured manner.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.