Install
$ agentstack add skill-digital-stoic-org-agent-skills-save-context ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Save Context
Save current session state to CONTEXT-{stream}-llm.md with LLM-optimized format.
Target: 1200-1500 tokens MAX | Speed: 3-5 seconds
⚠️ AskUserQuestion Guard
CRITICAL: After EVERY AskUserQuestion call, check if answers are empty/blank. Known Claude Code bug: outside Plan Mode, AskUserQuestion silently returns empty answers without showing UI.
If answers are empty: DO NOT proceed with assumptions. Instead:
- Output: "⚠️ Questions didn't display (known Claude Code bug outside Plan Mode)."
- Present the options as a numbered text list and ask user to reply with their choice number.
- WAIT for user reply before continuing.
Performance Rules
- Use
rtkfor ALL shell commands - Parallel tool calls — ALL independent calls in one message
- Minimize round-trips — gather all data phase 1, reason phase 2, write phase 3
Workflow
Phase 1: Gather Data (parallel)
Bash: rtk ls openspec/changes/ + rtk ls -t CONTEXT-*llm.md
Stream resolution: First word of $ARGUMENTS = stream name (^[a-zA-Z0-9_-]{1,50}$), rest = description. Empty → reuse prior /load-context stream or AskUserQuestion.
Phase 1b: Detect Thinking Artifacts (parallel with Phase 1)
If $PRAXIS_DIR is set:
Bash: ls -t "$PRAXIS_DIR/thinking"/*/{project}/ 2>/dev/null | head -10
Where {project} = current project folder name. Collect recent artifact paths written during this session (match conversation timestamps/topics).
If $PRAXIS_DIR is unset or empty: skip silently — no error, no warning.
Phase 2: Analyze & Synthesize (single pass)
From conversation (last 15-20 messages):
- Next — infer 3 tasks from OpenSpec/conversation (IMPORTANT: use heading "Next" — Claude Code compaction grep-matches
next/todo/pending/remainingkeywords for survival priority) - Session — progression, decisions, thinking, unexpected (780 tokens max)
- Hot Files — max 10 discussed/edited
- Focus & Goal — 1-2 sentence focus + goal
- Thinking Artifacts (if Phase 1b found any) — list paths only, no content
Phase 3: Write & Report
Write CONTEXT file using template.
Stream naming: "default" → CONTEXT-llm.md, "{name}" → CONTEXT-{name}-llm.md
Phase 3b: Auto-archive to done/
If status is done or parked → move file to done/ subfolder:
Bash: mkdir -p done && mv CONTEXT-{stream}-llm.md done/
Report: "📦 Archived to done/ (status: {status})"
See reference.md for CONTEXT file template, quality self-check, and done/ archival rules.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: digital-stoic-org
- Source: digital-stoic-org/agent-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.