Token导航 LogoToken导航TokenDH.com
研究检索权限需确认github未标认证来源可访问许可证需确认审计异常

session-persistence会话持续性

Agent Skill

session-persistence 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

339

周安装

14

GitHub Stars

58

下载量

111
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:session-persistence(会话持续性)
来源仓库:https://github.com/archieindian/openclaw-superpowers
仓库路径:skills/session-persistence
安装命令:
npx skills add https://github.com/archieindian/openclaw-superpowers --skill session-persistence
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/archieindian/openclaw-superpowers --skill session-persistence

简介

session-persistence 将所有对话消息导入 SQLite 数据库,支持全文检索与跨会话历史查询。

  • 适合需要追溯过往讨论细节或分析长期行为模式的场景,提升 Agent 记忆可用性。
  • 使用时每 15 分钟自动增量导入新消息,每条记录包含序列号、token 数与结构化内容分块。
  • 安装前请确认 ~/.openclaw/messages.db 路径可写,注意数据库体积增长较快,建议定期归档清理。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Session Persistence

What it does

OpenClaw stores session data in JSONL files that are difficult to search and easy to lose track of. Session Persistence imports every message into a local SQLite database with full-text search, making the agent's entire history queryable — across all sessions, all channels, all time.

Inspired by lossless-claw's SQLite message persistence layer, which stores every message with sequence numbers, token counts, and structured message parts.

When to invoke

  • Automatically every 15 minutes (cron) — incremental import of new messages
  • When the agent needs to search past conversations — use --search
  • After a crash or session rollover — verify all messages are persisted
  • For analytics — message counts, session timelines, activity patterns

How to use

python3 persist.py --import                       # Import new messages from session files
python3 persist.py --import --source <dir>        # Import from a specific directory
python3 persist.py --search "auth migration"      # FTS5 full-text search
python3 persist.py --search "deploy" --role user  # Search only user messages
python3 persist.py --recent --hours 24            # Messages from the last 24 hours
python3 persist.py --conversation <id>            # Dump a full conversation
python3 persist.py --stats                        # Database statistics
python3 persist.py --export --format jsonl        # Export back to JSONL
python3 persist.py --status                       # Last import summary
python3 persist.py --format json                  # Machine-readable output

Database schema

Stored at ~/.openclaw/lcm-db/messages.db:

conversations   — id, channel, started_at, last_message_at, message_count
messages        — id, conversation_id, seq, role, content, token_estimate, created_at
messages_fts    — FTS5 virtual table over messages.content for fast search
import_log      — id, imported_at, conversations_added, messages_added, source

Cron wakeup behaviour

Every 15 minutes:

  1. Scan session directory for JSONL files
  2. For each file, check last_imported_seq to skip already-imported messages
  3. Parse new messages and insert into SQLite
  4. Update FTS5 index
  5. Update import log and state

Procedure

Step 1 — Initial import

python3 persist.py --import

First run imports all existing session files. Subsequent runs are incremental — only new messages since last import.

Step 2 — Search your history

python3 persist.py --search "how did we handle the database migration"

FTS5 provides ranked results across all sessions and time periods. Results include conversation ID, timestamp, role, and content snippet.

Step 3 — Analyze patterns

python3 persist.py --stats

Shows total messages, conversations, date ranges, messages per role, and activity timeline.

Integration with other skills

  • memory-dag-compactor: Can use SQLite messages as source data instead of MEMORY.md, bringing architecture closer to lossless-claw
  • dag-recall: Search results feed into DAG expansion for detailed recall
  • context-assembly-scorer: Uses message database to measure true coverage

State

Import tracking and database stats stored in ~/.openclaw/skill-state/session-persistence/state.yaml. Database stored at ~/.openclaw/lcm-db/messages.db.

Fields: last_import_at, db_path, total_messages, total_conversations, import_history.

Notes

  • Uses Python's built-in sqlite3 module — no external dependencies
  • FTS5 used when available; falls back to LIKE queries otherwise
  • Idempotent: safe to re-run; tracks per-conversation sequence numbers
  • Import lag: up to 15 minutes behind real-time (cron interval)
  • Database is local-only — never committed to the repo

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.88%
按下载量换算42

Claude

29.15%
按下载量换算32

Cursor

19.48%
按下载量换算22

Gemini CLI

8.39%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

权限需确认

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills