Agent skill · operations · sundial-org

context-recovery

context-recovery — an agent skill for coding agents.

Why this skill is useful

Adds a comprehensive automation script for context recovery across multiple messaging platforms, enhancing the AI's ability to maintain continuity in conversations.

What it needs

Requires jq installed locally. About 4k tokens when loaded. Last updated 2026-03-07. 639 stars on the source repository.

What this skill does

Context Recovery Skill Automatically recover working context after session compaction or when continuation is implied but context is missing. Works across Discord, Slack, Telegram, Signal, and other supported channels. Triggers Automatic Triggers Session begins with a <summary> tag (compaction detected) User message contains compaction indicators: "Summary unavailable", "context limits", "truncated" Manual Triggers User says "continue", "did this happen?", "where were we?", "what was I working on?" User references "the project", "the PR", "the branch", "the issue" without specifying which User implies prior work exists but context is unclear User asks "do you remember...?" or "we were working on..." Execution Protocol Step 1: Detect Active Channel Extract from runtime context: channel — discord slack telegram signal etc. channelId — the specific channel/conversation ID threadId — for threaded conversations (Slack, Discord threads) Step 2: Fetch Channel History (Adaptive Depth) Initial fetch: Adaptive expansion logic: 1. Parse timestamps from returned messages 2. Calculate time span: newesttimestamp - oldesttimestamp 3. If time span < 2 hours AND message count == limit: Fetch additional 50 messages (using before parameter if supported) Repeat until time span ≥ 2 hours OR total messages ≥ 100 4. Hard cap: 100 messages maximum (token budget constraint) Thread-aware recovery (Slack/Discord): Parse for: Recent user requests (what was asked) Recent assistant responses (what was done) URLs, file paths, branch names, PR numbers Incomplete actions (promises made but not fulfilled) Project identifiers and working directories Step 3: Fetch Session Logs (if available) Step 4: Check Shared Memory Step 5: Synthesize Context Compile a structured summary: Step 6: Cache Recovered Context Persist to memory for future reference: This ensures context survives future compactions. Step 7: Respond with Context Present the recovered context, then prompt: "Context recovered. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills sundial-org/context-recovery

View the source on GitHub

Browse the @skills marketplace