Đoạn xem trước bài giảng

AI Agent Memory Between Sessions: Session Handoff, PROGRESS.md and Bootstrap Contract

How an AI coding agent remembers a project across sessions: compaction vs context reset, session handoff, PROGRESS.md, git checkpoints, decision log, warm start and init.sh. Context recovery cost metric.

cross-session continuity session handoff bootstrap contract warm start
Bạn sẽ học gì trong bài giảng này
  • Implement continuity artefacts and reduce re-exploration time to almost zero.
  • Design a bootstrap contract that verifies the agent's readiness rather than relying on guesswork.
  • Measure recovery cost before and after — and see the difference in hard numbers.

Phần đầu bài giảng

Fifteen minutes to remember yesterday

  • An engineer arrives each morning with their memory completely wiped
  • They're brilliant, but can't recall yesterday's decisions
  • They have to re-read the code and piece together the history
  • An agent that has lost its context behaves exactly the same way

Picture an engineer who turns up at work every morning with their memory of the previous day completely wiped. They're brilliant, but they don't remember which architecture option was chosen yesterday or why the others were ruled out, which files have already been rewritten, or where the tests stand. They have to re-read the code, reconstruct the history, and only then carry on working. This is exactly how an agent behaves once it's lost its context: fifteen to twenty minutes go on reconnaissance, and decisions get made all over again — often against what was already settled yesterday.

The agent repeats its recon and argues with its past self

  • Thirty minutes of work — and the context runs dry
  • The new session knows none of the decisions, changed files or test status
  • Fifteen minutes go on repeating the reconnaissance
  • The cure isn't more memory — it's a logbook

Thirty minutes of work, and the agent is already arguing with itself. It had built most of the feature, then the context ran out, and the new session doesn't remember which decisions were taken, why option B was chosen, which files have been changed, or where the tests stand. It spends fifteen minutes re-running the reconnaissance and, more likely than not, goes against the previous approach. The right mental model here is a brilliant engineer with total amnesia every morning. And the fix isn't giving the agent more memory — it's introducing a logbook: a set of files that capture the state between sessions.

Why growing the context window doesn't solve the problem

  • Even a million tokens get exhausted by complex tasks
  • Code, decision history, tool output, conversation — it all grows
  • Needs grow faster than windows do
  • This is an architecture problem, not a capacity question

Think of an exam: no matter how many hours you're given, a genuinely hard question will still eat the time right up to the last minute. It's the same with an agent's context window: give it a million tokens if you like — a complex task will exhaust that too. The agent reads the codebase, accumulates a history of decisions, takes in tool output and holds the whole conversation, and all of it grows faster than model windows do. You can't buy reliability simply by raising the token limit — sooner or later the exam clock runs out, and the question isn't whether that moment arrives, but what you've prepared for when it does.

Bài giảng đầy đủ dành cho thuê bao

Còn 24 slide nữa trong phiên bản đầy đủ.

Video, toàn bộ slide, ghi chú, bài kiểm tra, gia sư AI và phỏng vấn sẽ mở sau khi đăng nhập và đăng ký thuê bao.

Đăng nhập hoặc đăng ký Đăng ký thuê bao

Nội dung bài giảng

  1. Fifteen minutes to remember yesterday
  2. The agent repeats its recon and argues with its past self
  3. Why growing the context window doesn't solve the problem
  4. Compaction keeps the 'what' but loses the 'why'
  5. Context anxiety: the agent rushes like a student racing the bell
  6. ❓ Checkpoint: compact or reset?
  7. What compaction keeps — and what a reset wipes clean
  8. A practical criterion: the sixty percent mark of the window
  9. 💡 Walkthrough: forty percent and a single session — that's compaction
  10. The four continuity artefacts
  11. PROGRESS.md — where we are now
  12. DECISIONS.md — why we did it this way
  13. Git commits as free checkpoints
  14. Fifteen minutes versus three: work out your cost of amnesia
  15. Fifteen minutes versus three: work out your cost of amnesia
  16. Four fields that are enough for a complete handoff
  17. Coming up next: initialisation as a separate phase
  18. 🛠 'Add search' — and the agent has already spent half an hour getting to grips with the project
  19. Implementation and initialisation optimise different things
  20. Pitfalls: code accumulated without verification
  21. The bootstrap contract: four readiness conditions
  22. Myth: initialisation is a waste of time at the start
  23. Myth: initialisation is a waste of time at the start
  24. Approach A versus approach B: who wins over four sessions
  25. Approach A versus approach B: who wins over four sessions
  26. End-to-end project: step three — the payment backend logbook
  27. From amnesia to discipline — and on to scope

Bài viết liên quan đến bài học này

Tất cả bài giảng của khóa học

  1. What Is Harness Engineering? Why AI Coding Agents Fail Because of the Environment
  2. Error Accumulation in AI Agents: Why 95% Per-Step Accuracy Fails by Step 10
  3. AI Agent Reliability Metrics: MTBF, MTTR, Blast Radius and Little's Law
  4. Why AI Agents Fail in Production: Five Failure Layers and a Diagnostic Loop
  5. What an AI Agent Harness Is Made Of: Instructions, Tools, Environment, State, Feedback Loops
  6. Repository Map for AI Coding Agents: Project Structure and State Without Memory
  7. AGENTS.md Best Practices: Why a Giant Instructions File Fails and How to Build a Router
  8. AI Agent Memory Between Sessions: Session Handoff, PROGRESS.md and Bootstrap Contract
  9. feature_list.json for AI Agents: WIP=1, Feature Status and verify.sh Verification
  10. Agent Says 'Done' but the Feature Is Broken: Verification Gap and Definition of Done
  11. All Tests Pass, Feature Is Broken: E2E Tests and Architecture Rules for AI Agents
  12. AI Agent Observability: Sprint Contracts, Evaluator Rubrics and Clean Session Exit
  13. Autonomous AI Coding Agent for Hours: Loop Engineering and Stop Conditions
  14. Graph Engineering for AI Agents: When a Single Loop Is Not Enough and You Need a Task Graph
  15. Building an AI Agent Harness From Scratch: AGENTS.md, feature_list.json, verify.sh and an Autonomous Loop