Skip to content
cccskills
FreePublished on GitHub

clear-context

Survive a /clear or context limit. Save writes a verified handoff; after the clear, restore state, verify and continue. Works in every harness.

The English summary is being prepared. Showing the original description.

hybridlabor-api/aos6 stars(GitHub 6 + cccskills 0)

Run score Not tested

See how to install

Files included (1)

  • SKILL.md4.8 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

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)

  1. Collect facts, do not recall them. Run read-only commands and write only what they return: git status -sb and git log --oneline -5 for 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 -fl for background workers, the running services you care about, disk space when a run was heavy. Anything you cannot verify goes under "Unverified".
  2. Write the handoff to ~/.aos/briefs/handoff-<harness>-<project-slug>-<YYYY-MM-DD-HHMM>.md (slug from .aos/project.json, else the repository name of git 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 decisions and 5 Do not touch
    • 6 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.
  3. 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).
  4. 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.
  5. Finish with one line: Handoff saved: <path>. Now type /clear, then /clear-context. Do not clear anything yourself.

Mode 2: /clear-context (run right after /clear; also with resume)

  1. Find the handoff: read ~/.aos/briefs/LATEST-<project-slug>.md. If it is missing, list ~/.aos/briefs/handoff-* and take the newest for this project. Say its age; if older than 24 hours, warn that the state may have moved.
  2. Cross-check with unified memory:
    • deja wip in the project directory (what the last session was doing; it only knows the session start, so it can be older than the handoff).
    • memB recall for the project slug and the handoff's main nouns (the decisions you stored).
    • Optional: deja handoff --to <this harness> builds a handoff from the indexed transcript; use it only to fill gaps, the handoff file wins on conflict.
  3. Re-verify the live state: run the commands in the handoff's section 6, then compare with sections 1 and 2. List every difference (new commits, finished or died workers, merged or closed PRs, changed versions) before doing anything.
  4. Report in at most 10 lines: what is done, what is running, what changed since the handoff, the next step from section 3, and which step needs an approval word.
  5. Stop and wait for the human. A handoff is context, not permission: never run a guarded command (push, publish, merge, delete, deploy) because the file says it was planned; ask for the approval word the project requires.

Notes

  • Unified memory roles: handoff file = authoritative state; memB = decisions and rules, searchable across sessions and harnesses; deja = transcript index (deja wip, deja search, deja handoff, deja resume <id>).
  • A SessionStart hook that prints the LATEST-<slug>.md path (the memB hook already prints deja wip) would make step 1 automatic; the hook never reads the file's content into the context by itself.
  • Same idea for agent-to-agent hand-over: write the handoff, then start the other harness with Read <path> and continue.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Use when manage multiple local CLI agents via tmux sessions (start/stop/monitor/assign) with cron-friendly scheduling.

The English summary is being prepared. Showing the original description.

hybridlabor-api/aos6Updated Oct 28, 2026

Use when a hybrid memory system that provides persistent, searchable knowledge management for AI agents (Architecture, Patterns, Decisions).

The English summary is being prepared. Showing the original description.

hybridlabor-api/aos6Updated Oct 28, 2026

How BDB structures multi-agent build pipelines: the seven-node dispatcher graph /fabric-graph runs. Use for lifecycle framing.

The English summary is being prepared. Showing the original description.

hybridlabor-api/aos6Updated Oct 28, 2026

Design tools for AI agents. Use when building agent tools: covers schema, error handling, and avoiding hallucination and silent failure.

The English summary is being prepared. Showing the original description.

hybridlabor-api/aos6Updated Oct 28, 2026

Harness patterns for coding agents — memory, permissions, context engineering, delegation, skills, hooks, bootstrap.

The English summary is being prepared. Showing the original description.

hybridlabor-api/aos6Updated Oct 28, 2026

agenttrail: the live map of a multi-agent build. Use when a /fabric pipeline runs, a plan-canvas approve lands, or agents run for a human to watch.

The English summary is being prepared. Showing the original description.

hybridlabor-api/aos6Updated Oct 28, 2026

See all skills by hybridlabor-api

Report a problem with this skill