Neo-Olympia / Shield

Nothing Lost
In A Rewrite

Long sessions get compacted, laptops sleep, terminals close, and a rewrite can silently drop a lesson. Shield is the set of layers that makes sure none of that costs work.

304backup files, kept apart
154tests of the restore hook
151real session logs compared

What Goes Wrong

Seven Ways To Lose The Thread

Each one is real. The right-hand column is what survives it.

ThreatWhat happensWhat survives
CompactionThe conversation is summarised when the context is full. Details, run IDs and paths can fall out, and of the skills only the first part of each comes back.The always-loaded rules, project memory, everything on disk.
Idle compactionA conversation of over 200K tokens that sits idle for about 54 minutes is summarised just before the cache expires, while you are away. Switched off here since 11 November.Same as a compaction.
Usage limitNot the same as the context limit. Running agents can fail. In a normal terminal a workflow pauses and carries on after the reset, as long as the reset is within a day.Journals and files.
Laptop asleepProcesses pause; calls in flight fail and agents restart.Everything. The session carries on after waking.
Terminal closed, Windows restartThe process and the background workflows are gone.Journals and files; the same session comes back with claude --continue.
Temp cleanupThe scratchpad under Temp can disappear, scripts included.Only what is stored outside Temp.
A new sessionA workflow can only be resumed inside the session that started it.The journal, which can be read by hand.

Measured on 10 November: the lid was closed in the middle of an 11-agent run and opened again two hours later. One agent restarted and lost its first attempt; the nine that had finished stayed finished, and the run completed without help.

Seven Layers

Built Up As A Project Grows

Not every session needs all of them: short sessions need none, medium ones a brain update and three lines of status. The full set is for long or costly work, such as many-agent workflows, multi-phase builds and work that spans days.

State on disk

Decisions, status, contracts and scripts live in files, never only in the conversation. The brain leads.

A resume card

One file per big project: the “do now” steps on top, run IDs, exact resume commands, key paths. Kept under about 9,000 characters, because the hook's limit is 10,000.

The restore hook

A script that runs after every compaction and puts the right brain and card back. Described below.

Project memory

A memory file plus a start-here note that points to the brain and the card. It loads in every new session in that folder.

A fixed dev folder

Contracts, read scripts and workflow scripts in a folder of their own, outside Temp.

Snapshots

A zip of the skill, code, workflows and settings before risky steps and before every pause. Written with Python's zipfile and tested with testzip().

A health check

One command that compiles everything, parses the JSON, checks the workflows and lists what changed since the last snapshot. The answer is GREEN or RED.

The Restore Hook

After A Compaction, The Right Guide Comes Back

A SessionStart hook with the matcher “compact”. It prints, within the 10,000-character limit, what the session has to read next. If a card is longer than fits, it continues as “part 2” with the line to start reading from, so nothing is cut off.

How it chooses the brain

  • A map entry for the working folder wins, which keeps production folders safe.
  • If the folder says nothing specific, it looks in the session log for the project brain that was last edited, and falls back to the last one read.
  • A session that mostly worked on guides, not projects, gets no project at all.
  • In doubt it names several brains instead of guessing.

What it prints

  • Which brain to read, and the resume card if there is one.
  • The method guides this session used.
  • A reminder to read TheGeneral, the toolbox and the index again in full. That is deliberately double: they come back on their own, at a cost of about ten thousand tokens.

Tested with 154 tests and compared with 151 real session logs, plus two adversarial reviews. In the automatic compactions of 11 and 12 November nothing was lost on disk, and the start-here note in project memory did the pointing. What does go missing is what was just read and not yet used; that is read again.

Session shield, sections 2 and 3

Backups And The Loss Check

Copy First, Then Count

A guide is rewritten only after a copy is safe, and a script then proves what happened to every line.

Copy

Before a rewrite, the old guide goes to the backup vault, kept apart from the live files.

Count

verlies_check.py takes every non-empty line of the old file and looks for it word for word in the new files. What does not come back is listed.

Review

Those lines are read one by one: rewritten, brought up to date, or really gone? Nothing is summarised or dropped without the owner's agreement.

On 12 November a rewrite left 53 of 324 lines that had not come back word for word. After the review 321 were accounted for, and the rest were old headings.

A rewrite, caught by the script

What may not disappear

  • Lessons, with their date and cause.
  • The owner's own words.
  • Rules and specs.

What may

  • Outdated status.
  • Finished plans.
  • Anything the owner has agreed to drop.

Reporting Changes

A Change Is Explained In Plain Words

After any change to a guide or the toolbox, the owner gets a short report: how many lines there were before, how many are still word for word (checked by the script), and every new or changed line explained.

What problem

The incident or gap the line answers.

The fix

What the line now says or does.

The use

What it makes easier or safer.

Without it

What would happen if the line were not there.

A big round of changes to several guides, or to the always-loaded files, also gets a page with the text before and after, a verdict per change and the evidence behind it.

Leaving And Coming Back

Before You Close The Laptop

Before leaving

  • Laptop on, with the charger in. Ideally pause Windows Update for a day.
  • A closed lid is a pause and usually goes well. Cheapest is to close it just after an agent has finished: as many started as results in the journal.
  • Before a clear: nothing running, the arguments for the next steps in a file, the text of any alarm on the card, and what to type afterwards written down.

Coming back

  • After a compaction, read the card from the top; after a long run of small edits, rewrite it in one clean go first.
  • A closed terminal: claude --continue brings the same session back.
  • A workflow resumes only in that same session, with an unchanged script and unchanged arguments.
  • Proven on 12 November: plan, brief and card on disk, a clear, and five minutes from reading to starting again with the same plan.
NextThe start → Back to the start