Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add Songhonglei/better-agent-skills --skill session-recoverygit clone --depth 1 https://github.com/Songhonglei/better-agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/songhonglei/better-agent-skills/session-recovery)<a href="https://agentmods.dev/skills/songhonglei/better-agent-skills/session-recovery"><img src="https://agentmods.dev/badge/skills/songhonglei/better-agent-skills/session-recovery/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/songhonglei/better-agent-skills/session-recovery"><img src="https://agentmods.dev/badge/skills/songhonglei/better-agent-skills/session-recovery.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00216 | $0.01298 |
| Opus 5 | $0.00108 | $0.00649 |
| Sonnet 5 | $0.00043 | $0.00260 |
| Haiku 4.5 | $0.00022 | $0.00130 |
Grade A, and why
session-recovery scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 131 lines — stays where its author put it; the contents beside it link to each section on GitHub.
session-recovery
- Version: 1.0.1
- License: MIT
- Author: Evan Song · github.com/Songhonglei
- Repository: https://github.com/Songhonglei/better-agent-skills
Recover lost agent session content and file changes from on-disk conversation logs.
从本地会话日志中找回丢失的 agent 对话和文件改动。
Built for OpenClaw's on-disk session format (~/.openclaw/agents/<agent>/sessions/*.jsonl).
Streaming and OOM-safe for production-scale environments (5000+ sessions, 700MB+ daily JSONL).
Compatibility
| Platform | Status |
|---|---|
| OpenClaw | ✅ Full (primary target) |
| Other agent frameworks (CC / Codex / Hermes) | 🛣️ Roadmap |
| Linux | ✅ Full |
| macOS | ✅ Full |
| Windows (WSL) | ✅ Full |
| Python | ≥ 3.8 (uses pathlib, datetime.fromisoformat) |
Quick start
# Search recent sessions for a keyword
python3 scripts/search.py "index.html" --days 2
# Search by specific date, also list write/edit ops
python3 scripts/search.py "skill logo" --date 2026-06-13 --extract-files
# Search all agents
python3 scripts/search.py "anything" --agent all
# Filter by real msg timestamp (slower, more accurate when mtime lies)
python3 scripts/search.py "stuff" --days 7 --by-content-time
# JSON output for agent consumption
python3 scripts/search.py "stuff" --json
# Once you know the session ID, extract file ops
python3 scripts/extract.py 21f68359 --file-filter index.html
# Show full content (warning: can be large)
python3 scripts/extract.py 21f68359 --file-filter index.html --show-content
# Restore to original path (non-interactive needs --yes)
python3 scripts/extract.py 21f68359 --file-filter index.html --restore --yes
# Restore to a specific path
python3 scripts/extract.py 21f68359 --restore-to ~/out/index.html --yes
# Pure-edit session (no write baseline): replay edits to rebuild
python3 scripts/extract.py 21f68359 --file-filter app.py --rebuild \
--restore-to ~/out/app.py --yes
Custom data root
If your OpenClaw install puts agents elsewhere, override:
What ships with it
5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 131 lines · 216 tokens per session scan A a0e31ab17c8e
session-recovery is a skill published in the GitHub repository Songhonglei/better-agent-skills (3 stars, last pushed 4d ago), licensed MIT. It adds 216 tokens to every session and 1,298 once invoked, about $0.0011 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
Context Doctor
Identify and repair degradation in system prompt, external memory, and skills preventing you from following instructions or remembering information as well as you should.
memanto-companion
Inspect and manage the cross-session engineering memory that Memanto maintains for your Claude Code skills. Use when the user asks what Memanto remembers, wants to see their engineering profile, manually recall context for a skill, or store a decision. The automatic lifecycle hooks handle capture/injection on their…
system-monitor
Monitor system health: CPU, memory, disk, processes, and network. Alert on thresholds via any channel.
mnemon
Persistent memory CLI for LLM agents. Store facts, recall past knowledge, link related memories, manage lifecycle.
mnemon
Persistent memory for MiniMax Code. Recall durable context, store important facts and decisions, and link related memories with the mnemon CLI.
init
Install or update OwnMem in the current repository. Use when the user asks to set up OwnMem, add local project memory for coding agents, or refresh an existing OwnMem installation after a version bump.