Save session to CONTEXT-llm.md with conversation summary. Use when saving work, checkpointing progress, preserving session state. Triggers include "save context", "save session", "checkpoint", "save my progress".
61
73%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./skills/agentic-harness/save-context/SKILL.mdSave current session state to .context/session/CONTEXT-{stream}-llm.md with LLM-optimized format.
Target: 1200-1500 tokens MAX | Speed: 3-5 seconds
CRITICAL: After EVERY AskUserQuestion call, check if answers are empty/blank. Known harness bug affecting several agentic CLIs: outside Plan Mode, the AskUserQuestion tool can silently return empty answers without showing UI.
If answers are empty: DO NOT proceed with assumptions. Instead:
rtk for ALL shell commandsBash: rtk ls .context/session/ + rtk ls -t .context/session/CONTEXT-*llm.mdStream resolution: First word of $ARGUMENTS = stream name (^[a-zA-Z0-9_-]{1,50}$), rest = description. Empty → reuse prior /load-context stream or AskUserQuestion.
From conversation (last 15-20 messages):
next/todo/pending/remaining keywords for survival priority)Write CONTEXT file using template, then upsert .context/session/INDEX.md via scripts/upsert-index.sh.
Stream naming: "default" → .context/session/CONTEXT-llm.md, "{name}" → .context/session/CONTEXT-{name}-llm.md
.context/session/done/If status is done or parked → move file to .context/session/done/ subfolder:
Bash: mkdir -p .context/session/done && mv .context/session/CONTEXT-{stream}-llm.md .context/session/done/Report: "Archived to .context/session/done/ (status: {status})"
See references/reference.md for CONTEXT file template, quality self-check, status mapping, done/ archival rules, and INDEX.md upsert logic.
NEVER overwrite an existing context file without reading it first — Silent overwrites lose prior session decisions. Why: The INDEX.md may reference decisions that inform current architecture; discarding them breaks traceability.
# BAD - blind overwrite, prior decisions gone with no diff
echo "$new_summary" > .context/session/CONTEXT-llm.md
# GOOD - read first, merge forward, then write
old=$(cat .context/session/CONTEXT-llm.md 2>/dev/null || echo "")
# ...fold decisions still relevant from $old into the new summary...
echo "$merged_summary" > .context/session/CONTEXT-llm.mdNEVER save with a generic or missing stream name when multiple streams are active — Ambiguous names cause the wrong file to be loaded next session. Why: CONTEXT-llm.md collides across unrelated workstreams and forces manual disambiguation.
# BAD - two unrelated workstreams both save to the default stream
/save-context # auth-refactor work lands in CONTEXT-llm.md
/save-context # billing-migration work overwrites it minutes later
# GOOD - each workstream gets its own named stream
/save-context auth-refactor "JWT middleware extraction done"
/save-context billing-migration "Stripe webhook handler drafted"NEVER skip the INDEX.md upsert step — Omitting it leaves the index out of sync. Why: load-context relies on INDEX.md to discover the latest file; a stale index means the wrong snapshot is loaded.
NEVER archive to done/ prematurely — Moving an active context to done/ hides it from future loads. Why: Auto-archive is only correct when status is explicitly done or parked; applying it to in-progress work severs continuity.
NEVER exceed the 1500-token budget — Bloated context files slow down load and waste model capacity. Why: The target is 1200-1500 tokens; beyond that the signal-to-noise ratio degrades and compaction may truncate critical sections.
Saving context before ending a long session:
# Invocation (default stream)
/save-context
# Files written to .context/session/
# .context/session/CONTEXT-llm.md ← session snapshot
# .context/session/INDEX.md ← updated index entrySaving context under a named stream:
# Invocation with explicit stream name
/save-context auth-refactor "completed JWT middleware extraction"
# Files written to .context/session/
# .context/session/CONTEXT-auth-refactor-llm.md ← named snapshot
# .context/session/INDEX.md ← updated index entryArchiving a completed stream:
# When status resolves to "done" the skill auto-archives
/save-context auth-refactor "all tests green, PR merged" --status done
# Result
# .context/session/done/CONTEXT-auth-refactor-llm.md ← archived
# .context/session/INDEX.md ← updated with archived statusa1083f4
Also appears in
last in sync Aug 28, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.