Skip to content

Context

Last chapter you earned the right to trust Pi a little, because you could finally see it - the four tools, the sub-1,000-token prompt, the live context stacking up turn by turn. That transparency is Pi’s whole pitch. But watching a meter fill isn’t the same as controlling what fills it, and stash isn’t a one-sitting job. It’s a week of real work, spread across mornings you didn’t plan for and refactors that run longer than you expected.

This chapter is about staying in charge of that span. Nothing here is exotic - a handful of session commands, one file convention, and the judgment of when to reach for each. To make that judgment concrete, we’ll follow one thread of stash work through all three lessons rather than list features in the abstract.

You’ve shipped one fix to stash and you understand the loop. Real work on it now looks like this:

  • This morning, you come back to yesterday’s session about the extractor bug and pick it up without re-explaining a thing.
  • Full-text search on stash misses accented characters - a real, open rough spot - and there are two reasonable ways to fix it. You fork the session so you can try both without betting on one upfront.
  • You settle on an approach and keep going, but the readability-extractor rewrite that follows runs long. The window fills, Pi compacts the thread mid-refactor, and you learn what survives that and what doesn’t.
  • By the end of the week you’re tired of typing the same three stash-specific rules into every new session - don’t touch .env, use stash migrate instead of raw SQL, the extractor’s tests live in tests/extractor/ - so you write them down once, in a file Pi reads on every session before you say a word.

Each lesson leaves you with the problem the next one solves. Read them in order and it’s a story; drop into one from search and it still stands on its own.

By the end you’ll treat Pi’s context window the way you treat memory in any long-running program - a resource you watch, spend on purpose, and reclaim before it runs out. That habit is what lets you run Pi across a week of work on stash without every new morning starting from zero, or every long session going hazy right when it matters most.

Start where the week does - picking up yesterday’s session, and forking today’s real decision.