clear-context
Installation
SKILL.md
clear-context: lose the chat, keep the work
A long session fills the context window. /clear empties it, so everything that is only in the chat is gone. This skill moves the state into three places that survive: a handoff file (authoritative), memB (decisions, searchable) and deja (the transcript index). After the clear it rebuilds the picture and re-checks it against reality instead of trusting it.
Mode 1: /clear-context save [note] (run before /clear)
- Collect facts, do not recall them. Run read-only commands and write only what they return:
git status -sbandgit log --oneline -5for each worktree you worked in,git worktree list,gh pr list --state open(if gh exists), the version of every package you released (npm view <pkg> dist-tags --prefer-online),pgrep -flfor background workers, the running services you care about, disk space when a run was heavy. Anything you cannot verify goes under "Unverified". - Write the handoff to
~/.aos/briefs/handoff-<harness>-<project-slug>-<YYYY-MM-DD-HHMM>.md(slug from.aos/project.json, else the repository name ofgit remote get-url origin, else the folder name; a worktree must use the repository name, so every worktree finds the same pointer). Use exactly these sections, each short and concrete, with absolute paths and command lines a stranger can run:0 Rules that cost time(permission and approval rules, how workers are started, secrets handling, limits)1 State of the world (verified <time>)(releases, open PRs, branches/worktrees with their commits, incidents and how they were fixed)2 Running now(table: worker, task, worktree/branch, where the output lands, how to check it)3 Next steps in order(numbered; mark every step that needs a human approval word)4 Open decisionsand5 Do not touch6 Verify first (read-only)(the exact commands to re-check sections 1 and 2) Never write secrets, tokens, key values or file contents that may hold them. Name the file and variable where a secret lives, never the value. Do not paste whole logs.
- Update the pointer: copy the file to
~/.aos/briefs/LATEST-<project-slug>.md(a copy, not a symlink, so it survives tools that do not follow links). - Store the decisions in unified memory: ingest the handoff into memB (skill
memb-ingest, or the memB MCP store call) with the project slug, and add 5 to 10 one-sentence decisions as separate notes (why we chose X, what we rejected, which rule Tim gave). deja needs no step: it indexes the transcripts on its own. - Finish with one line:
Handoff saved: <path>. Now type /clear, then /clear-context.Do not clear anything yourself.