← 返回 Skills 市场
yozu

Session Recall

作者 Yoshikazu Terashi · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
108
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install agent-session-recall
功能描述
Recover conversation context when a message arrives with unclear meaning. Use when a user's message lacks context (e.g. "I logged in" with no prior mention o...
使用说明 (SKILL.md)

Session Recall

Recover missing conversation context autonomously. Never ask the user "what are you talking about?" until all steps are exhausted.

When This Triggers

  • An incoming message doesn't match the current session context
  • Session starts after compaction (.jsonl.reset exists)
  • User references something not in current context window
  • User references a topic from another channel or a cron-delivered notification
  • Thread reply arrives without visible parent context

Recovery Flow

Execute steps in order. Stop early if sufficient context is found.

Step 0: sessions_history (fastest check)

Use sessions_history to retrieve recent messages for the current channel. This requires no file I/O and is the quickest way to recover recent context.

Step 1: Same-channel transcript

Read the .jsonl transcript for the current session:

  1. Look up the session associated with this channel via sessions_list or sessions.json
  2. Read ~/.openclaw/agents/{agent}/sessions/{sessionId}.jsonl (default agent: main)
  3. For large files, read the tail first (tail -n 200) rather than loading the entire file
  4. Check for .reset files with the same sessionId prefix (pre-compaction data)
  5. If the message is a thread reply, read the parent message first

Step 2: Channel context summary

Read memory/channel_context/{channel-name}.md if it exists. These are user-maintained summaries of ongoing topics per channel — not a built-in OpenClaw feature, but a recommended convention.

Step 3: Cross-channel and cron search

Messages often originate from cron jobs or other channels.

  1. Extract key terms from the unclear message
  2. Use the bundled search script or grep across all .jsonl files:
    ./scripts/search_sessions.sh "keyword"
    
  3. Also search for the current channel ID in other sessions — cron jobs send messages to channels but these don't appear in the channel's own .jsonl:
    ./scripts/search_sessions.sh "{current_channel_id}"
    
  4. When a match is found, read surrounding context to understand the full conversation
  5. Sort results by timestamp, prioritize most recent

Step 4: Memory files

  1. memory/active_context.md — current shared context across channels
  2. memory/YYYY-MM-DD.md — today and yesterday's daily notes
  3. Semantic memory search if available in your setup (e.g., memory_search tool)

Step 5: Ask the user (last resort)

Only after steps 0–4 yield nothing. Be specific about what was searched:

"Searched this channel's transcript, cross-channel sessions (including cron), and memory files for '{keyword}' but couldn't find context. What are you referring to?"

Key Insight: Cron-to-Channel Messages

Cron jobs can send messages to channels via sessions_send or direct API calls. These messages:

  • Appear in the chat platform for the user to see
  • Are logged in the cron session's .jsonl, NOT the target channel's .jsonl
  • Require Step 3's channel-ID search to discover

This is the most common cause of unrecognized messages — the user is responding to something a cron job sent.

Security Note

Session transcripts may contain sensitive data (API keys, passwords, personal information). Do not pipe search output to public channels or logs. This skill assumes single-user/single-agent deployment.

Notes

  • Path ~/.openclaw/agents/main/sessions/ assumes default agent name main. Adjust if using a custom agent name.
  • Channel context files (memory/channel_context/) are a recommended convention, not built-in. Users create and maintain these themselves.
  • The search script requires python3, grep, and bash.
安全使用建议
This skill is coherent with its purpose but it reads local session transcripts which often contain sensitive data (API keys, passwords, private messages). Before installing: (1) Confirm you run this in a single-user environment or accept that the skill can read all files under the agent sessions directory. (2) Review the included scripts (scripts/search_sessions.sh) yourself — they contain no network calls but will print matching snippets. (3) Ensure python3/grep/bash are present or update the registry metadata to list them. (4) Consider setting file-system permissions so the agent can only read intended sessions, or set OPENCLAW_SESSIONS_DIR to a restricted path. (5) If you run agents on a hosted/shared system, avoid enabling autonomous invocation or restrict what the agent may output to external channels to reduce exfiltration risk.
功能分析
Type: OpenClaw Skill Name: agent-session-recall Version: 1.0.0 The 'session-recall' skill is designed to help an OpenClaw agent recover conversation context by searching local session transcripts and memory files. The implementation in SKILL.md and scripts/search_sessions.sh follows security-conscious patterns, such as passing search terms via environment variables to prevent injection and explicitly warning about the sensitivity of session data. The behavior is entirely consistent with the stated purpose of context recovery.
能力评估
Purpose & Capability
The skill's name/description match its behavior: it searches session transcripts, memory files, and summaries to reconstruct context. Minor mismatch: the registry lists no required binaries/env, but SKILL.md and the included script require python3, grep, and bash (and optionally respect OPENCLAW_SESSIONS_DIR). This is an implementation detail worth fixing but doesn't change the core purpose.
Instruction Scope
Instructions explicitly direct the agent to read session .jsonl, archived .reset files, and local memory files under ~/.openclaw/agents/... and to run the bundled search script. All of this is within the declared scope (recovering context). Because these files can contain sensitive data, the skill sensibly warns about not piping results to public channels. The SKILL.md assumes a single-user/single-agent setup; on multi-user/shared hosts this could expose other users' transcripts.
Install Mechanism
No install spec (instruction-only) and the included shell script is local and readable. There are no downloads, no extracted archives, and no network endpoints in the code. Risk from the install mechanism is low.
Credentials
The registry declares no required environment variables or credentials, which is consistent with not needing remote APIs. The script optionally honors OPENCLAW_SESSIONS_DIR and defaults to ~/.openclaw/agents/main/sessions; the skill's need to access those local files is appropriate for its purpose but grants access to all session transcripts in that directory (sensitive data).
Persistence & Privilege
The skill is not always-enabled, does not request elevated privileges, and does not modify other skills or system-wide settings. It only reads local files and runs local commands; it does not persist credentials or install background services.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install agent-session-recall
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /agent-session-recall 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: autonomous context recovery for AI agents. 6-step recovery flow (sessions_history → transcript → channel summary → cross-channel search → memory → ask user). Includes search script for cross-session keyword search. Handles compaction recovery, channel switches, cron-to-channel messages, and thread replies.
元数据
Slug agent-session-recall
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Session Recall 是什么?

Recover conversation context when a message arrives with unclear meaning. Use when a user's message lacks context (e.g. "I logged in" with no prior mention o... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 108 次。

如何安装 Session Recall?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install agent-session-recall」即可一键安装,无需额外配置。

Session Recall 是免费的吗?

是的,Session Recall 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Session Recall 支持哪些平台?

Session Recall 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Session Recall?

由 Yoshikazu Terashi(@yozu)开发并维护,当前版本 v1.0.0。

💬 留言讨论