← 返回 Skills 市场
244
总下载
1
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install chronosync
功能描述
跨会话聊天记录同步工具。自动备份 OpenClaw 各会话的聊天记录, 实现会话间记忆共享,避免切换会话后丢失上下文。
使用说明 (SKILL.md)
Session Sync - 跨会话记忆同步
一句话:让 OpenClaw 各会话共享聊天记录,换会话不丢上下文。
解决什么问题?
OpenClaw 的每个会话是独立的,切换会话后无法访问其他会话的历史记录。
这个技能帮你:
- ✅ 自动同步各会话聊天记录到共享文件
- ✅ 跨会话访问历史消息
- ✅ 增量同步,避免重复存储
- ✅ 支持 JSON + Markdown 双格式输出
怎么用?
1. 安装前检查
# 下载后先检查环境
python check_install.py
如果显示 "检查完成,可以正常使用!" 就可以继续。如果报错,按提示修复。
2. 安装
# 方式1:通过 OpenClaw 安装
openclaw skills install session-sync
# 方式2:手动复制到技能目录
cp -r session-sync ~/.openclaw/skills/
3. 配置自动备份(每30分钟)
openclaw cron add session-sync \
--interval "30m" \
--command "python -m session_sync"
3. 手动备份(现在立刻执行)
python -m session_sync
会产生什么文件?
同步完成后,聊天记录会保存到:
~/.openclaw/workspace/memory/sync/
├── shared_chat.md ← Markdown 格式,方便人工阅读
├── shared_chat.json ← JSON 格式,方便程序处理
└── .last_hash ← 变化检测缓存文件
shared_chat.md 格式示例:
# 共享聊天记录
> 最后同步:2026-03-14T12:21:28
---
## 会话:abc123...
- 消息数:200
- 最后更新:2026-03-14T04:11:29
### 消息 1
**role:** user
**content:** [内容已脱敏]
**timestamp:** 2026-03-14T04:11:29.776Z
### 消息 2
...
实际场景
场景1:跨会话查看历史
在 Telegram 会话中聊完后,切换到 Control UI 会话:
用户:查看 Telegram 会话的最后一条消息
AI:[读取 shared_chat.json 中的 Telegram 会话记录]
场景2:会话间数据共享
在 Webhook 会话中接收外部数据,在 Telegram 会话中查看:
Webhook 接收数据 → 同步到 shared_chat.json → Telegram 会话可访问
场景3:历史记录备份
定期同步所有会话记录,防止数据丢失:
# 手动备份
python -m session_sync
# 或配置定时任务自动备份
openclaw cron add session-sync --interval "30m" --command "python -m session_sync"
和其他方案的区别
| Session Sync | OpenClaw 内置 compaction | |
|---|---|---|
| 触发时机 | 定时任务(可配置) | 系统自动触发 |
| 数据位置 | workspace/memory/sync/ | 各会话独立存储 |
| 访问方式 | 跨会话共享 | 会话隔离 |
| 文件格式 | Markdown + JSON | 内部格式 |
| 脱敏处理 | ✅ 自动脱敏 | ❌ 无 |
隐私与安全
数据安全
- ✅ 纯本地运行:所有数据保存在
~/.openclaw/workspace/memory/sync/ - ✅ 无网络连接:仅读取本地会话文件,不访问任何外部服务
- ✅ 自动脱敏:邮箱、手机号、API Key 会被替换为
[EMAIL]、[PHONE]等
生成文件
~/.openclaw/workspace/memory/sync/
├── shared_chat.json # 聊天记录(JSON格式)
├── shared_chat.md # 聊天记录(Markdown格式)
├── decisions/ # 提取的决策和知识点
├── todos/ # 提取的待办事项
└── .last_hash # 变化检测缓存
安全验证
已通过以下测试:
- ✅ 插件系统测试:
knowledge和todo插件正常加载运行 - ✅ 网络监控:运行期间无外部网络连接
- ✅ 文件访问:仅访问
~/.openclaw/agents/main/sessions/目录 - ✅ 代码审查:
import os已正确包含,无语法错误
配置(可选)
# 改备份目录
export SESSION_SYNC_OUTPUT=/你的/自定义/路径
# 改 OpenClaw 目录
export OPENCLAW_STATE_DIR=/你的/openclaw/路径
插件系统
Session Sync 支持插件扩展,内置以下插件:
| 插件 | 功能 | 状态 |
|---|---|---|
| knowledge | 自动提取关键决策和知识点 | ✅ 已启用 |
| todo | 追踪待办事项 | ✅ 已启用 |
开发自定义插件
- 创建
plugins/my_plugin.py - 继承
Plugin基类 - 实现
on_sync方法 - 创建插件实例
plugin = MyPlugin()
后续计划
| 功能 | 状态 | 说明 |
|---|---|---|
| 自动提取知识点 | ✅ 已实现 | knowledge 插件基础功能 |
| 自动追踪待办 | ✅ 已实现 | todo 插件基础功能 |
| 智能知识提取 | 🔄 待优化 | 使用更好的 NLP 模型 |
| 网页版查看器 | ❌ 未实现 | 计划开发 Web UI |
| 数据可视化 | ❌ 未实现 | 聊天记录统计图表 |
版本历史
v1.0.1 (2026-03-14)
- ✅ 修复 Windows UTF-8 编码问题
- ✅ 修复 OpenClaw 2026.3.x 路径兼容(
agents/main/sessions) - ✅ 修复插件系统导入问题
v1.0.0 (2026-03-10)
- ✅ 基础同步功能
- ✅ JSON + Markdown 双格式输出
- ✅ 增量同步,智能去重
- ✅ 敏感信息自动脱敏
License
MIT - 免费使用,自由修改
安全使用建议
This skill appears coherent and local-only: it reads OpenClaw session files and writes shared JSON/Markdown and plugin outputs in ~/.openclaw/workspace/memory/sync (or an alternate path you set). Before installing: 1) Confirm you trust the skill source — the package includes executable Python code that will run on your machine. 2) Review any plugins you add or that come bundled — the plugin loader will execute plugin code from plugins/. 3) Be aware sanitization is heuristic (regex-based) and may not remove all secrets — avoid sending highly-sensitive secrets in chat if you plan to sync backups. 4) Check file permissions and backup existing session data if you need to preserve the original state. If you want more assurance, request a full line-by-line security review of the truncated/remaining portion of session_sync.py main routine (the supplied file was truncated in the bundle listing).
功能分析
Type: OpenClaw Skill
Name: chronosync
Version: 1.0.2
The 'session-sync' skill is a utility designed to aggregate and synchronize chat history across different OpenClaw sessions for local memory sharing. The code (session_sync.py) implements incremental synchronization using SHA256 hashing to detect changes and includes robust sanitization logic to mask sensitive information like emails, phone numbers, and API tokens before storage. It features a plugin system (plugins/knowledge.py, plugins/todo.py) for extracting tasks and decisions, all of which operate strictly on local files within the user's OpenClaw workspace. No network activity, obfuscation, or unauthorized data exfiltration mechanisms were found.
能力评估
Purpose & Capability
Name/description match the implementation: code reads local OpenClaw session .jsonl files, performs change-detection, sanitizes content, writes shared_chat.json/.md and plugin outputs. No unrelated credentials, binaries, or services are requested.
Instruction Scope
SKILL.md instructs local installation, running check_install.py, adding a cron job, and running python -m session_sync; the code implements exactly those behaviors and only references expected paths (OPENCLAW_STATE_DIR, SESSION_SYNC_OUTPUT). It reads sessions and writes local files; it does not call external endpoints.
Install Mechanism
There is no install spec (lowest platform-level risk). However the skill bundle includes multiple Python modules that will be executed when invoked. Dynamic plugin loading executes plugin code from the plugins/ directory — expected for a plugin architecture but worth noting: installing additional/untrusted plugin files into that directory would run arbitrary code.
Credentials
No required environment variables or credentials are declared. The code optionally respects SESSION_SYNC_OUTPUT and OPENCLAW_STATE_DIR environment variables (documented in SKILL.md). No secret or cloud credentials are requested or used.
Persistence & Privilege
always is false and the skill does not modify other skills or system-wide settings. It writes files to a user-space OpenClaw workspace directory as expected for its purpose. Autonomous invocation is allowed (platform default) but not an additional privilege here.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install chronosync - 安装完成后,直接呼叫该 Skill 的名称或使用
/chronosync触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.2
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [1.0.1] - 2026-03-14
### Fixed
- Fixed Windows UTF-8 encoding issue in console output
- Fixed OpenClaw 2026.3.x path compatibility (`agents/main/sessions`)
- Fixed plugin system circular import issue by extracting `plugin_base.py`
### Changed
- Updated SKILL.md with generic descriptions (removed personal references)
- Added proper metadata (version, author, license, tags)
- Added security verification section
### Security
- Verified no external network connections
- Verified plugin system works correctly
- Added data privacy documentation
## [1.0.0] - 2026-03-10
### Added
- Initial release
- Basic session synchronization functionality
- JSON + Markdown dual format output
- Incremental sync with hash-based change detection
- Automatic sensitive information sanitization (email, phone, API keys)
- Plugin system with knowledge and todo plugins
- Cron job support for automatic syncing
v1.0.1
修复编码、路径、插件问题
Fix encoding, path, and plugin issues
v1.0.0
Initial release of session-sync: enables AI chat memory backup and context recall across conversations.
- Automatically backs up chat history every 30 minutes or on demand.
- Restores context in new sessions, so previous conversations aren't lost.
- Organizes learned knowledge and tracks user-stated to-dos into separate files.
- Stores data locally in human-readable markdown and machine-readable JSON.
- Offers privacy by keeping all data on your device and masking sensitive information.
- Easy installation and optional custom configuration supported.
元数据
常见问题
ChronoSync 是什么?
跨会话聊天记录同步工具。自动备份 OpenClaw 各会话的聊天记录, 实现会话间记忆共享,避免切换会话后丢失上下文。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 244 次。
如何安装 ChronoSync?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install chronosync」即可一键安装,无需额外配置。
ChronoSync 是免费的吗?
是的,ChronoSync 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
ChronoSync 支持哪些平台?
ChronoSync 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 ChronoSync?
由 smallccwc(@smallccwc)开发并维护,当前版本 v1.0.2。
推荐 Skills