Install
openclaw skills install context-recoveryAutomatically 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.
openclaw skills install context-recoveryAutomatically 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.
<summary> tag (compaction detected)Extract from runtime context:
channel — discord | slack | telegram | signal | etc.channelId — the specific channel/conversation IDthreadId — for threaded conversations (Slack, Discord threads)Initial fetch:
message:read
channel: <detected-channel>
channelId: <detected-channel-id>
limit: 50
Adaptive expansion logic:
newest_timestamp - oldest_timestampbefore parameter if supported)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:
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.
Only inspect memory if the agent runtime already provides a scoped memory tool/path. Do not run shell glob scans across home directories.
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>"
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?"
Present the recovered context, then prompt:
"Context recovered. Your last request was [X]. This action [completed/did not complete]. Shall I [continue/retry/clarify]?"
channelId from the incoming message metadatathreadId in message metadatachannel parameter with Slack channel IDthreadId — always check for thread context firstmessage:read interfaceAt 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.
Scenario: Session starts with compaction summary
User message: "<summary>Summary unavailable due to context limits...</summary>"
User message: "did this happen?"
Agent executes:
<summary> tagmessage:read channel=discord channelId=1460342116516364533 limit=50"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?"