/knowledge:savefrom knowledge
Deliberately save session state before exit. Updates session-state.md, persists learnings, journals a summary, and commits the vault.
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.
Run this before ending a session to deliberately preserve context. This is the editorial counterpart to the PreCompact hook's crash dump.
Two inputs feed this phase:
session-state.md — anything earlier
fast-saves queued for editorial processing. Read this first.For each lesson: decide where it belongs — the project's instruction file — whichever of AGENTS.md / CLAUDE.md already exists (AGENTS.md if neither). Never create the other one: with both present, Claude Code loads ONLY CLAUDE.md, so a new file silently shadows (or is shadowed by) the old — for values, a feedback-.md
file for behavioral rules, project-.md for project context, a new file for new
knowledge. Write it to the proper location now.
After processing, clear the Pending Lessons section of session-state.md.
The queue is empty. A lesson that survives in Pending Lessons after /knowledge:save
is a bug — it either should have been promoted to a vault file or consciously
deferred with a note.
A promise to remember without a file write is a lie.
Read .knowledge/meta/session-state.md and update it:
/knowledge:fast-save step 1). The file opens with
## HUMAN DIRECTIONS IN FORCE (every standing operator direction, verbatim and dated, Urgent first, each with the
state it demands; these outrank every hold an agent invented), then ## OPEN ASKS & AWAITED DECISIONS, then
## HOLDS (each with why / until / lifted-by). Write pointers, not narrative, and keep it to at most 15 KB. A save that drops a human
direction or an Urgent item is a failed save..knowledge/meta/session-history.md if the history section is getting long)Keep session-state.md within 15 KB. It's read on every boot, and bloat here
costs tokens on every future session. Then run the contract check and fix the file until it prints 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")
Run /knowledge:journal with:
s/sessionRun /knowledge:checkpoint (or invoke its script directly) with a descriptive commit message:
Bash(command="SCRIPTS=$(ls -d ~/.claude/plugins/cache/*/knowledge/*/node_modules/@agiterra/knowledge-tools/scripts 2>/dev/null | sort -V | tail -1); bash \"$SCRIPTS/checkpoint.sh\" --cwd . --message 'Session save: [brief description]'")
Checkpoint handles the mechanics: journal.py backup, git add, git commit if changes, git push if origin exists. Idempotent — skips silently on no-op.
Tell the agent (yourself) what was saved:
/exit or ending a session/knowledge:handoff (save state for the twin to inherit)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