{
  "schemaVersion": "1.0",
  "item": {
    "slug": "context-recovery",
    "name": "Context Recovery",
    "source": "tencent",
    "type": "skill",
    "category": "通讯协作",
    "sourceUrl": "https://clawhub.ai/jdrhyne/context-recovery",
    "canonicalUrl": "https://clawhub.ai/jdrhyne/context-recovery",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/context-recovery",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=context-recovery",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "_meta.json"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/context-recovery"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/context-recovery",
    "agentPageUrl": "https://openagent3.xyz/skills/context-recovery/agent",
    "manifestUrl": "https://openagent3.xyz/skills/context-recovery/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/context-recovery/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Context Recovery",
        "body": "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.\n\nUse when: Session starts with truncated context, user references prior work without specifying details, or compaction indicators appear."
      },
      {
        "title": "Safety Boundaries",
        "body": "This skill prioritizes channel/session API history to recover context.\nIt does NOT perform broad filesystem scans or shell glob searches by default.\nIt does NOT send recovered context to external services.\nIt does NOT write to disk unless the user explicitly asks to persist recovered state."
      },
      {
        "title": "Automatic Triggers",
        "body": "Session begins with a <summary> tag (compaction detected)\nUser message contains compaction indicators: \"Summary unavailable\", \"context limits\", \"truncated\""
      },
      {
        "title": "Manual Triggers",
        "body": "User says \"continue\", \"did this happen?\", \"where were we?\", \"what was I working on?\"\nUser references \"the project\", \"the PR\", \"the branch\", \"the issue\" without specifying which\nUser implies prior work exists but context is unclear\nUser asks \"do you remember...?\" or \"we were working on...\""
      },
      {
        "title": "Step 1: Detect Active Channel",
        "body": "Extract from runtime context:\n\nchannel — discord | slack | telegram | signal | etc.\nchannelId — the specific channel/conversation ID\nthreadId — for threaded conversations (Slack, Discord threads)"
      },
      {
        "title": "Step 2: Fetch Channel History (Adaptive Depth)",
        "body": "Initial fetch:\n\nmessage:read\n  channel: <detected-channel>\n  channelId: <detected-channel-id>\n  limit: 50\n\nAdaptive expansion logic:\n\nParse timestamps from returned messages\nCalculate time span: newest_timestamp - oldest_timestamp\nIf time span < 2 hours AND message count == limit:\n\nFetch additional 50 messages (using before parameter if supported)\nRepeat until time span ≥ 2 hours OR total messages ≥ 100\n\n\nHard cap: 100 messages maximum (token budget constraint)\n\nThread-aware recovery (Slack/Discord):\n\n# If threadId is present, fetch thread messages first\nmessage:read\n  channel: <detected-channel>\n  threadId: <thread-id>\n  limit: 50\n\n# Then fetch parent channel for broader context\nmessage:read\n  channel: <detected-channel>\n  channelId: <parent-channel-id>\n  limit: 30\n\nParse for:\n\nRecent user requests (what was asked)\nRecent assistant responses (what was done)\nURLs, file paths, branch names, PR numbers\nIncomplete actions (promises made but not fulfilled)\nProject identifiers and working directories"
      },
      {
        "title": "Step 3: Fetch Session Context (safe mode)",
        "body": "Use platform/session APIs only (no shell filesystem scans):\n\n# List recent sessions (if tool exists)\nsessions_list:\n  limit: 5\n\n# Pull last messages from likely matching session\nsessions_history:\n  sessionKey: <candidate-session-key>\n  limit: 80\n  includeTools: true\n\nIf session APIs are unavailable, skip this step and proceed with channel-only evidence."
      },
      {
        "title": "Step 4: Optional Memory Check (explicitly scoped)",
        "body": "Only inspect memory if the agent runtime already provides a scoped memory tool/path.\nDo not run shell glob scans across home directories."
      },
      {
        "title": "Step 5: Synthesize Context",
        "body": "Compile a structured summary:\n\n## Recovered Context\n\n**Channel:** #<channel-name> (<platform>)\n**Time Range:** <oldest-message> to <newest-message>\n**Messages Analyzed:** <count>\n\n### Active Project/Task\n- **Repository:** <repo-name>\n- **Branch:** <branch-name>\n- **PR:** #<number> — <title>\n\n### Recent Work Timeline\n1. [<timestamp>] <action/request>\n2. [<timestamp>] <action/request>\n3. [<timestamp>] <action/request>\n\n### Pending/Incomplete Actions\n- ⏳ \"<quoted incomplete action>\"\n- ⏳ \"<another incomplete item>\"\n\n### Last User Request\n> \"<quoted request that may not have been completed>\""
      },
      {
        "title": "Step 6: Optional Persistence (consent-first)",
        "body": "Do not write to disk by default. If persistence is useful, ask first:\n\n\"I can cache this recovered context to memory for later continuity. Should I save it?\""
      },
      {
        "title": "Step 7: Respond with Context",
        "body": "Present the recovered context, then prompt:\n\n\"Context recovered. Your last request was [X]. This action [completed/did not complete]. Shall I [continue/retry/clarify]?\""
      },
      {
        "title": "Discord",
        "body": "Use channelId from the incoming message metadata\nGuild channels have full history access\nThread recovery: check for threadId in message metadata\nDMs may have limited history"
      },
      {
        "title": "Slack",
        "body": "Use channel parameter with Slack channel ID\nThread context requires threadId — always check for thread context first\nParent channel fetch provides surrounding conversation context\nMay need workspace-level permissions for full history"
      },
      {
        "title": "Telegram / Signal / Others",
        "body": "Same message:read interface\nHistory depth may vary by platform\nGroup vs. DM context may differ"
      },
      {
        "title": "Constraints",
        "body": "Prefer this protocol before declaring \"insufficient data\" when context appears missing\nAdaptive depth: start with 50, expand to 100 max\nTime-based goal: capture at least 2 hours of context when possible\nIf recovery fails, state what was attempted and what data sources were unavailable\nAvoid broad filesystem scans or writes without explicit user consent"
      },
      {
        "title": "Auto-Trigger Detection",
        "body": "At session start, scan for compaction indicators:\n\n# Pseudocode for trigger detection\nif message contains \"<summary>\":\n    trigger_context_recovery()\nelif message contains any of [\"Summary unavailable\", \"context limits\", \"truncated\", \"compacted\"]:\n    trigger_context_recovery()\nelif message matches continuation_patterns:\n    # \"continue\", \"where were we\", \"did this happen\", etc.\n    trigger_context_recovery()\n\nDo not wait for user to ask — if compaction is detected, proactively recover and present context."
      },
      {
        "title": "Example",
        "body": "Scenario: Session starts with compaction summary\n\nUser message: \"<summary>Summary unavailable due to context limits...</summary>\"\nUser message: \"did this happen?\"\n\nAgent executes:\n\nDetects compaction via <summary> tag\nmessage:read channel=discord channelId=1460342116516364533 limit=50\nCalculates time span: 2.5 hours — sufficient, no expansion needed\nParses messages, finds last action: \"Now let me extract the key orchestration decisions...\"\nChecks session context APIs — extracts recent user requests\nResponds:\n\n\"Context recovered. Your last request was to extract orchestration decisions from Nexus archived sessions for PR #137 (Skills & Agents System). This action did not complete before context was truncated.\nRecovered state:\n\nPR #137: 15,053 additions, 91 files, CONFLICTING merge state\nSpec location: content/spec-skills-agents-system.md (2,067 lines)\n\nShall I proceed with the extraction?\""
      }
    ],
    "body": "Context Recovery\n\nAutomatically 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.\n\nUse when: Session starts with truncated context, user references prior work without specifying details, or compaction indicators appear.\n\nSafety Boundaries\nThis skill prioritizes channel/session API history to recover context.\nIt does NOT perform broad filesystem scans or shell glob searches by default.\nIt does NOT send recovered context to external services.\nIt does NOT write to disk unless the user explicitly asks to persist recovered state.\nTriggers\nAutomatic Triggers\nSession begins with a <summary> tag (compaction detected)\nUser message contains compaction indicators: \"Summary unavailable\", \"context limits\", \"truncated\"\nManual Triggers\nUser says \"continue\", \"did this happen?\", \"where were we?\", \"what was I working on?\"\nUser references \"the project\", \"the PR\", \"the branch\", \"the issue\" without specifying which\nUser implies prior work exists but context is unclear\nUser asks \"do you remember...?\" or \"we were working on...\"\nExecution Protocol\nStep 1: Detect Active Channel\n\nExtract from runtime context:\n\nchannel — discord | slack | telegram | signal | etc.\nchannelId — the specific channel/conversation ID\nthreadId — for threaded conversations (Slack, Discord threads)\nStep 2: Fetch Channel History (Adaptive Depth)\n\nInitial fetch:\n\nmessage:read\n  channel: <detected-channel>\n  channelId: <detected-channel-id>\n  limit: 50\n\n\nAdaptive expansion logic:\n\nParse timestamps from returned messages\nCalculate time span: newest_timestamp - oldest_timestamp\nIf time span < 2 hours AND message count == limit:\nFetch additional 50 messages (using before parameter if supported)\nRepeat until time span ≥ 2 hours OR total messages ≥ 100\nHard cap: 100 messages maximum (token budget constraint)\n\nThread-aware recovery (Slack/Discord):\n\n# If threadId is present, fetch thread messages first\nmessage:read\n  channel: <detected-channel>\n  threadId: <thread-id>\n  limit: 50\n\n# Then fetch parent channel for broader context\nmessage:read\n  channel: <detected-channel>\n  channelId: <parent-channel-id>\n  limit: 30\n\n\nParse for:\n\nRecent user requests (what was asked)\nRecent assistant responses (what was done)\nURLs, file paths, branch names, PR numbers\nIncomplete actions (promises made but not fulfilled)\nProject identifiers and working directories\nStep 3: Fetch Session Context (safe mode)\n\nUse platform/session APIs only (no shell filesystem scans):\n\n# List recent sessions (if tool exists)\nsessions_list:\n  limit: 5\n\n# Pull last messages from likely matching session\nsessions_history:\n  sessionKey: <candidate-session-key>\n  limit: 80\n  includeTools: true\n\n\nIf session APIs are unavailable, skip this step and proceed with channel-only evidence.\n\nStep 4: Optional Memory Check (explicitly scoped)\n\nOnly inspect memory if the agent runtime already provides a scoped memory tool/path. Do not run shell glob scans across home directories.\n\nStep 5: Synthesize Context\n\nCompile a structured summary:\n\n## Recovered Context\n\n**Channel:** #<channel-name> (<platform>)\n**Time Range:** <oldest-message> to <newest-message>\n**Messages Analyzed:** <count>\n\n### Active Project/Task\n- **Repository:** <repo-name>\n- **Branch:** <branch-name>\n- **PR:** #<number> — <title>\n\n### Recent Work Timeline\n1. [<timestamp>] <action/request>\n2. [<timestamp>] <action/request>\n3. [<timestamp>] <action/request>\n\n### Pending/Incomplete Actions\n- ⏳ \"<quoted incomplete action>\"\n- ⏳ \"<another incomplete item>\"\n\n### Last User Request\n> \"<quoted request that may not have been completed>\"\n\nStep 6: Optional Persistence (consent-first)\n\nDo not write to disk by default. If persistence is useful, ask first:\n\n\"I can cache this recovered context to memory for later continuity. Should I save it?\"\n\nStep 7: Respond with Context\n\nPresent the recovered context, then prompt:\n\n\"Context recovered. Your last request was [X]. This action [completed/did not complete]. Shall I [continue/retry/clarify]?\"\n\nChannel-Specific Notes\nDiscord\nUse channelId from the incoming message metadata\nGuild channels have full history access\nThread recovery: check for threadId in message metadata\nDMs may have limited history\nSlack\nUse channel parameter with Slack channel ID\nThread context requires threadId — always check for thread context first\nParent channel fetch provides surrounding conversation context\nMay need workspace-level permissions for full history\nTelegram / Signal / Others\nSame message:read interface\nHistory depth may vary by platform\nGroup vs. DM context may differ\nConstraints\nPrefer this protocol before declaring \"insufficient data\" when context appears missing\nAdaptive depth: start with 50, expand to 100 max\nTime-based goal: capture at least 2 hours of context when possible\nIf recovery fails, state what was attempted and what data sources were unavailable\nAvoid broad filesystem scans or writes without explicit user consent\nAuto-Trigger Detection\n\nAt session start, scan for compaction indicators:\n\n# Pseudocode for trigger detection\nif message contains \"<summary>\":\n    trigger_context_recovery()\nelif message contains any of [\"Summary unavailable\", \"context limits\", \"truncated\", \"compacted\"]:\n    trigger_context_recovery()\nelif message matches continuation_patterns:\n    # \"continue\", \"where were we\", \"did this happen\", etc.\n    trigger_context_recovery()\n\n\nDo not wait for user to ask — if compaction is detected, proactively recover and present context.\n\nExample\n\nScenario: Session starts with compaction summary\n\nUser message: \"<summary>Summary unavailable due to context limits...</summary>\"\nUser message: \"did this happen?\"\n\n\nAgent executes:\n\nDetects compaction via <summary> tag\nmessage:read channel=discord channelId=1460342116516364533 limit=50\nCalculates time span: 2.5 hours — sufficient, no expansion needed\nParses messages, finds last action: \"Now let me extract the key orchestration decisions...\"\nChecks session context APIs — extracts recent user requests\nResponds:\n\n\"Context recovered. Your last request was to extract orchestration decisions from Nexus archived sessions for PR #137 (Skills & Agents System). This action did not complete before context was truncated.\n\nRecovered state:\n\nPR #137: 15,053 additions, 91 files, CONFLICTING merge state\nSpec location: content/spec-skills-agents-system.md (2,067 lines)\n\nShall I proceed with the extraction?\""
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/jdrhyne/context-recovery",
    "publisherUrl": "https://clawhub.ai/jdrhyne/context-recovery",
    "owner": "jdrhyne",
    "version": "1.2.2",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/context-recovery",
    "downloadUrl": "https://openagent3.xyz/downloads/context-recovery",
    "agentUrl": "https://openagent3.xyz/skills/context-recovery/agent",
    "manifestUrl": "https://openagent3.xyz/skills/context-recovery/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/context-recovery/agent.md"
  }
}