# Send Context Recovery to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- 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.
## Suggested prompts
### New install

```text
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.
```
### Upgrade existing

```text
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.
```
## Machine-readable fields
```json
{
  "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": {
    "downloadUrl": "/downloads/context-recovery",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=context-recovery",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "_meta.json"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "context-recovery",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-29T15:44:36.304Z",
      "expiresAt": "2026-05-06T15:44:36.304Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=context-recovery",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=context-recovery",
        "contentDisposition": "attachment; filename=\"context-recovery-1.2.2.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "context-recovery"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "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."
      ]
    }
  },
  "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"
  }
}
```
## Documentation

### Context Recovery

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.

Use when: Session starts with truncated context, user references prior work without specifying details, or compaction indicators appear.

### Safety Boundaries

This skill prioritizes channel/session API history to recover context.
It does NOT perform broad filesystem scans or shell glob searches by default.
It does NOT send recovered context to external services.
It does NOT write to disk unless the user explicitly asks to persist recovered state.

### 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..."

### 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:

message:read
  channel: <detected-channel>
  channelId: <detected-channel-id>
  limit: 50

Adaptive expansion logic:

Parse timestamps from returned messages
Calculate time span: newest_timestamp - oldest_timestamp
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


Hard cap: 100 messages maximum (token budget constraint)

Thread-aware recovery (Slack/Discord):

# If threadId is present, fetch thread messages first
message:read
  channel: <detected-channel>
  threadId: <thread-id>
  limit: 50

# Then fetch parent channel for broader context
message:read
  channel: <detected-channel>
  channelId: <parent-channel-id>
  limit: 30

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 Context (safe mode)

Use platform/session APIs only (no shell filesystem scans):

# List recent sessions (if tool exists)
sessions_list:
  limit: 5

# Pull last messages from likely matching session
sessions_history:
  sessionKey: <candidate-session-key>
  limit: 80
  includeTools: true

If session APIs are unavailable, skip this step and proceed with channel-only evidence.

### Step 4: Optional Memory Check (explicitly scoped)

Only inspect memory if the agent runtime already provides a scoped memory tool/path.
Do not run shell glob scans across home directories.

### Step 5: Synthesize Context

Compile a structured summary:

## Recovered Context

**Channel:** #<channel-name> (<platform>)
**Time Range:** <oldest-message> to <newest-message>
**Messages Analyzed:** <count>

### Active Project/Task
- **Repository:** <repo-name>
- **Branch:** <branch-name>
- **PR:** #<number> — <title>

### Recent Work Timeline
1. [<timestamp>] <action/request>
2. [<timestamp>] <action/request>
3. [<timestamp>] <action/request>

### Pending/Incomplete Actions
- ⏳ "<quoted incomplete action>"
- ⏳ "<another incomplete item>"

### Last User Request
> "<quoted request that may not have been completed>"

### Step 6: Optional Persistence (consent-first)

Do not write to disk by default. If persistence is useful, ask first:

"I can cache this recovered context to memory for later continuity. Should I save it?"

### Step 7: Respond with Context

Present the recovered context, then prompt:

"Context recovered. Your last request was [X]. This action [completed/did not complete]. Shall I [continue/retry/clarify]?"

### Discord

Use channelId from the incoming message metadata
Guild channels have full history access
Thread recovery: check for threadId in message metadata
DMs may have limited history

### Slack

Use channel parameter with Slack channel ID
Thread context requires threadId — always check for thread context first
Parent channel fetch provides surrounding conversation context
May need workspace-level permissions for full history

### Telegram / Signal / Others

Same message:read interface
History depth may vary by platform
Group vs. DM context may differ

### Constraints

Prefer this protocol before declaring "insufficient data" when context appears missing
Adaptive depth: start with 50, expand to 100 max
Time-based goal: capture at least 2 hours of context when possible
If recovery fails, state what was attempted and what data sources were unavailable
Avoid broad filesystem scans or writes without explicit user consent

### Auto-Trigger Detection

At session start, scan for compaction indicators:

# Pseudocode for trigger detection
if message contains "<summary>":
    trigger_context_recovery()
elif message contains any of ["Summary unavailable", "context limits", "truncated", "compacted"]:
    trigger_context_recovery()
elif message matches continuation_patterns:
    # "continue", "where were we", "did this happen", etc.
    trigger_context_recovery()

Do not wait for user to ask — if compaction is detected, proactively recover and present context.

### Example

Scenario: Session starts with compaction summary

User message: "<summary>Summary unavailable due to context limits...</summary>"
User message: "did this happen?"

Agent executes:

Detects compaction via <summary> tag
message:read channel=discord channelId=1460342116516364533 limit=50
Calculates time span: 2.5 hours — sufficient, no expansion needed
Parses messages, finds last action: "Now let me extract the key orchestration decisions..."
Checks session context APIs — extracts recent user requests
Responds:

"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.
Recovered state:

PR #137: 15,053 additions, 91 files, CONFLICTING merge state
Spec location: content/spec-skills-agents-system.md (2,067 lines)

Shall I proceed with the extraction?"
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: jdrhyne
- Version: 1.2.2
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-04-29T15:44:36.304Z
- Expires at: 2026-05-06T15:44:36.304Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/context-recovery)
- [Send to Agent page](https://openagent3.xyz/skills/context-recovery/agent)
- [JSON manifest](https://openagent3.xyz/skills/context-recovery/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/context-recovery/agent.md)
- [Download page](https://openagent3.xyz/downloads/context-recovery)