Skip to the workspace
Pebellslearn by building
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.

vibe coding / Keep Sessions Fresh

Explore each scene at your own pace.

01 · The rule

The rule

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.
Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.