Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Prompting and Context  ›  Capstone Project

Keep Sessions Fresh

Context 12 minLong sessions drift as the context fills with outdated material, so keep a project notes file and restart with it when warning signs appear.

Keep Sessions Fresh

Two hours into one long conversation about Kitty, the assistant starts slipping. It brings back a rounding bug you fixed an hour ago. It mentions a function you deleted. It forgets that payments are never split. Nothing is broken in the tool; the conversation has simply grown cluttered with old code, dropped ideas and superseded decisions.

The rule

When a session drifts, save what matters and start fresh.

An assistant can take in only a limited amount of text at once, often called its context window. In a very long session, early details may fall out of that window or get less attention, while outdated versions of your code stay in view. The result is drift. Its warning signs:

  • a bug you already fixed comes back;
  • a rule you stated earlier is ignored;
  • it refers to code that no longer exists;
  • it contradicts something it said before.

Two habits keep sessions fresh. First, keep a project notes file in the repository: stack, rules, decisions and the current slice. Some assistants can be set up to read such a file automatically; with any assistant, you can paste it at the start of a session. Second, start a new session for each slice, beginning with the notes and only the files that slice needs.

# Kitty: project notes

## Stack
Python, SQLite through the sqlite3 module, server-rendered HTML forms.

## Rules
- Money is whole paise (int). Never floats.
- Payments are separate from expenses and are never split.
- Every query is limited to the current user's flat.

## Decisions
- Leftover paise go one each to flatmates in name order.

## Current slice
Settle-up: payments table and record_payment() done. Next: the form.

The shortcut

Watch for the warning signs. The moment you see one, do not argue with the drifting session for ten more messages. Update the notes, then restart with notes, the relevant files and the next single step.

Rescuing a drifting Kitty sessionStep 1 of 4
  1. Notice

    The assistant's new code stores amounts as floats, which the notes forbid. That is a forgotten rule: drift.

The trap is trusting a summary blindly. If a hand-off summary drops a decision, the next session inherits the gap and treats it as settled.

Drills

Answer fast — trust the rule.

quick drill

Which is a warning sign that a long session has drifted?

quick drill

What belongs in a project notes file?

quick drill

Why should you read an assistant-drafted hand-off summary before saving it?

quick drill

Why can very long conversations lose details?

Remember

  • Rule: when a session drifts, save what matters and start fresh.
  • Shortcut: at the first warning sign, update the notes and restart with notes, files and one step.
  • Trap: saving a hand-off summary without checking it.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainWrite the hand-off

You have finished the payments table for Kitty's settle-up feature and will continue tomorrow. Write the hand-off update you would save to the project notes, and explain how you would use it to start the next session.