/knowledge:recyclefrom knowledge
Save session state, then clear and re-boot in place. The lightweight alternative to handoff — same process, fresh context, vault as continuity.
Ships in knowledge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fast-save, clear, boot. In place. No spawn, no quiz, no swap.
This is the everyday alternative to /knowledge:handoff. Handoff spawns a twin
and quizzes it before cutover — insurance against a broken boot. Recycle trusts
the vault: if save persisted the state and boot can restore it, there's no need
for a second process to prove the first one works.
Before anything else in this skill, invoke /knowledge:fast-save using
the Skill tool. This is not optional and not paraphrasable. Use this exact
call:
Skill(skill="knowledge:fast-save")
Wait for it to complete. Verify session-state.md was updated and committed. Do NOT proceed to Phase 2 until fast-save has run and succeeded.
The state you are about to recycle into must carry everything that matters — or there is no point in recycling (the operator, 2026-10-01). The successor knows ONLY what that file says. In particular, the session-state contract (canonical text: fast-save step 1) requires:
## HUMAN DIRECTIONS IN FORCE is the first section. Every standing operator direction, verbatim and dated.
Urgent items go first, each with the state it demands (lane running: yes (id) / no (why; restart time)).
Urgent overrides every hold. A successor that inherits your holds but not the human direction will obey the hold.## OPEN ASKS & AWAITED DECISIONS — every open ask and every decision you are waiting on.## HOLDS — every hold with why / until / lifted-by. A hold missing one of the three does not carry.A recycle that drops a human direction or an Urgent item is a failed recycle, even if the boot succeeds.
Gate: run fast-save's contract check now. Proceed to Phase 2 only on CONTRACT OK:
Bash(command="f=.knowledge/meta/session-state.md; h=$(grep -m1 '^## ' \"$f\"); n=$(wc -c < \"$f\" | tr -d ' '); miss=''; grep -q '^## OPEN ASKS & AWAITED DECISIONS' \"$f\" || miss=\"$miss asks\"; grep -q '^## HOLDS' \"$f\" || miss=\"$miss holds\"; if [ \"$h\" = '## HUMAN DIRECTIONS IN FORCE' ] && [ \"$n\" -le 15360 ] && [ -z \"$miss\" ]; then echo \"CONTRACT OK ($n B)\"; else echo \"CONTRACT FAIL: first section '${h:-none}', size $n B (limit 15360), missing:${miss:- nothing}\"; fi")
On CONTRACT FAIL: fix session-state.md, re-checkpoint, and re-run the check. Do not clear your context first.
Recycle trigger. Recycle at the next clean stopping point once context passes 40% of your runtime's own window: 400k on a 1M Claude window, about 103k on Codex (about 258k window). Grok uses a 75% floor, because a Grok session already boots at about 117k. This is never a hard abort. (Raised from 20% on 2026-10-01: a 20% line sat below a successor's own boot size, so every session recycled again within a few turns.)
If you skip this step, the next-you boots into stale state. Recycle's entire purpose is preserving context for the fresh window — fast-save IS the preservation. Skipping it is exactly the bug this skill was fixed to prevent (shipped 2026-05-18 after the prior framing — "run checkpoint, editorial scan is wasted" — caused two agents in one session to lose context).
What fast-save does:
session-state.md with what the next-you needs to pick upIf you want a heavier persist (journal entry + full editorial review), run
/knowledge:save manually before /knowledge:recycle instead. Recycle's
default is fast-save because the speed matches the moment.
Use GNU screen's stuff command to queue input to your own session. The STY
env var tells you your screen session name. TWO host-specific gotchas break a
naive screen -X stuff — both bit brioche on the patisserie host 2026-07-03,
and both must be resolved in the SAME command:
screen looks in the default macOS temp dir
(/var/folders/.../.screen) and finds no socket, while the real one is under
$HOME/.screen (where personai-launch/cc-launch create it). Set
SCREENDIR=${SCREENDIR:-$HOME/.screen}.screen on PATH can resolve to macOS's /usr/bin/screen
(4.x, because /etc/zprofile's path_helper reorders PATH), and a 4.x binary
against a 5.x socket throws stuff → "Operation not supported on socket"
EVEN with SCREENDIR correct. Use the SAME binary that made the socket —
prefer /opt/homebrew/bin/screen.Resolve both inline, then stuff clear:
Bash(command="SCR=$(command -v /opt/homebrew/bin/screen 2>/dev/null || command -v screen); SCREENDIR=\"${SCREENDIR:-$HOME/.screen}\" \"$SCR\" -S \"${STY#*.}\" -X stuff '/clear\r'")
Then queue the boot command (same prefix):
Bash(command="SCR=$(command -v /opt/homebrew/bin/screen 2>/dev/null || command -v screen); SCREENDIR=\"${SCREENDIR:-$HOME/.screen}\" \"$SCR\" -S \"${STY#*.}\" -X stuff '/knowledge:boot\r'")
If STY is not set, OR the stuff still errors ("Operation not supported on
socket" / "No screen session found") on a host where the binary/SCREENDIR fix
doesn't apply, fall back to crew pane_send of /clear to your own pane if the
crew plugin is loaded; otherwise report that recycle can't self-clear on this
host and rely on the harness's auto-compaction (a fast-save already preserved
state, so nothing is lost).
After sending, end your response immediately. Do not add more tool calls — the CLI needs to process the queued input. The next thing you'll see is the boot output in your fresh context.
/knowledge:save (journal
entry + heavier editorial) is available manually for when it matters; not the
default cadence at every recycle. Fixed 2026-05-18 after the bug bit two
agents in one session./usr/bin/screen 4.x) and SCREENDIR set (see Phase 2's two
gotchas). The naive screen -X stuff failed on patisserie 2026-07-03. Phase 2
now resolves both inline; pane_send is the documented fallback when it still
can't stuff. (This is the same wrong-screen-binary class as
crew's remote-screen verification recipe — homebrew screen + SCREENDIR.)/knowledge:boot manually.What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (agiterra/knowledge-claude-code) — no native marketplace selected
npx claudepluginhub p/agiterra-knowledge17 skills in this plugin
/associateAssociate — Fast Keyword AssociationsLightweight keyword-only association search — fast (<100ms), no vector embeddings, no LLM. Returns quick context associations from the knowledge vault./bootKnowledge BootFull boot sequence — restores session state and memory continuity after context compaction./calibrateCalibrate — Compression Test BatteryMeasure decompression fidelity after compaction. Creates or runs a compression test battery tailored to the knowledge vault.Other plugins' skills for the same job