跨会话检索聊天原文(记忆不足时再用)。在回答任何关于历史事件、日期、人物、过去对话的问题时,如果记忆中没有相关信息或不足以回答,则需要使用跨会话检索聊天原文。用 mcp_exec_command 执行 scripts/search_history.py,读 ~/.jiuwenclaw/agent/sessions/*/history.json。支持 channel、session_id、关键词、时间窗。如果搜索结果不足,尝试用不同的关键词再次搜索。
79
100%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
High
Do not use without reviewing
用于从 ~/.jiuwenclaw/agent/sessions/<session_id>/history.json 中检索历史消息,并把命中结果整理为可直接粘贴进当前上下文的文本块。
必须使用 mcp_exec_command 执行脚本,不要只口头总结。
python ~/.jiuwenclaw/agent/skills/cross-channel-history-retrieval/scripts/search_history.py --channel feishu --query "报销 审批" --start "2026-03-26 09:00" --end "2026-03-26 18:00" --limit 30(Windows:--channel / --query / 时间参数等与 Unix 相同;默认 mcp_exec_command 走 cmd,cmd 不会展开 ~,不要用 ~/.jiuwenclaw,应写 python %USERPROFILE%\.jiuwenclaw\agent\skills\cross-channel-history-retrieval\scripts\search_history.py 再接同样参数。若整条命令在 PowerShell 里执行,~ 一般会展开,也可用 $env:USERPROFILE\...。)
--channel:按频道过滤(如 feishu / dingtalk / web)。如果用户在语言里没有指明 channel,则不要传 --channel,脚本会扫描所有会话。--session-id:只检索指定会话(优先级高于 --channel)--query:空格分词关键词(例如 "合同 审批")--keyword:可重复传入多个精确关键词--start、--end:显式时间范围,格式支持
YYYY-MM-DDYYYY-MM-DD HH:MMYYYY-MM-DD HH:MM:SS2026-03-26T10:30:00+08:00)--at:某个时间点,配合 --window-minutes 形成检索窗--window-minutes:窗口大小(默认 120 分钟)--timezone:默认 Asia/Shanghai--limit:返回命中上限(默认 20)--max-sessions:最多扫描会话数量(默认 200)--auto-expand:无命中时自动扩大时间窗重试(默认开启)--at + --window-minutes。--auto-expand 开启,自动扩展为最近 72 小时再试一次。脚本第一行固定输出 SKILL=cross-channel-history-retrieval,便于在 mcp_exec_command 回显或日志里 grep 确认本 skill 的脚本已执行。
脚本会输出两个区块:
HISTORY_SEARCH_SUMMARY:统计信息与最终时间窗HISTORY_CONTEXT_BLOCK:可直接放入当前对话上下文的命中消息片段拿到脚本输出后,你应当:
HISTORY_CONTEXT_BLOCK 中的内容原样(或轻度裁剪)贴到当前回复里,作为上下文依据。4fd5cfc
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.