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

rem-sleep雷姆睡眠

Agent Skill

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

总安装

533

周安装

22

GitHub Stars

3

下载量

174
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/stewnight/rem-sleep-skill --skill rem-sleep

简介

rem-sleep 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。

  • 适用于雷姆睡眠相关的信息查询与筛选任务,支持多宿主环境集成。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用该技能。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。
  • rem-sleep 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

REM Sleep - Memory Consolidation for AI Agents

Like biological REM sleep, this skill processes raw experience (session logs) into consolidated long-term memory.

Works with: OpenClaw, Claude Code, or any agent with session logs and memory files.

The Problem

  • Session logs accumulate but are expensive to re-read
  • Important insights get buried in noise
  • "Mental notes" don't survive context compaction
  • After a restart, you're starting from scratch unless you wrote it down

The Solution

Periodic "sleep cycles" that:

  1. Search session logs for significant patterns
  2. Extract what's worth remembering
  3. Consolidate into durable memory files

Modes

1. Consolidate

Process recent session logs → extract significant events → update MEMORY.md

2. Defrag

Review MEMORY.md → remove stale/outdated entries → merge duplicates → compress

3. Full

Run both consolidate then defrag.


Consolidation Workflow

Step 1: Gather Recent Sessions

Option A: Using grep/jq (no extra software)

# OpenClaw session logs location
SESSIONS_DIR="$HOME/.openclaw/agents/main/sessions"

# Search for patterns in recent sessions
grep -r "decision\|learned\|important\|remember\|TODO" "$SESSIONS_DIR" --include="*.jsonl" | head -100

# Parse JSONL and search content
find "$SESSIONS_DIR" -name "*.jsonl" -mtime -3 -exec cat {} \; | \
  jq -r 'select(.content) | .content' 2>/dev/null | \
  grep -i "decision\|learned\|important"

Option B: Using Repo Prompt (if installed)

# More powerful semantic search
rp -e 'search "decision" --context-lines 2'
rp -e 'search "learned" --context-lines 2'
rp -e 'search "important" --context-lines 2'

Option C: Using memory_search (OpenClaw built-in)

If your agent has the memory_search tool, use it to semantically search memory files:

memory_search("decisions made this week")
memory_search("lessons learned")

Step 2: Identify Consolidation Candidates

From search results, look for:

  • Decisions made — choices, preferences, conclusions
  • Facts learned — new info about people, projects, systems
  • Lessons — things that worked/didn't, mistakes to avoid
  • TODOs/commitments — things promised or planned
  • Relationship context — interactions with people, their preferences

Step 3: Update Memory Files

Two-tier system:

  1. Daily file (memory/YYYY-MM-DD.md): Raw events, specific details
  2. MEMORY.md: Distilled, durable knowledge worth keeping long-term

Consolidation prompt:

Review these session excerpts. Extract significant information that should be remembered long-term. Focus on: decisions, facts about people/projects, lessons learned, and preferences. Format as bullet points suitable for MEMORY.md.

Defrag Workflow

Step 1: Analyze Current Memory

Read MEMORY.md and identify:

  • Stale entries — outdated info, completed TODOs, old dates
  • Duplicates — same info repeated in different sections
  • Inconsistencies — conflicting information
  • Bloat — overly verbose entries that could be compressed

Step 2: Categorize Issues

STALE: [entry] — reason it's outdated
DUPLICATE: [entry A] ≈ [entry B]
INCONSISTENT: [entry A] vs [entry B]
BLOAT: [verbose entry] → [compressed version]

Step 3: Apply Fixes

  • Remove stale entries (or move to an archive section if uncertain)
  • Merge duplicates into single authoritative entry
  • Resolve inconsistencies (check session logs if needed)
  • Compress verbose entries

Step 4: Reorganize

Ensure MEMORY.md has logical sections:

  • About [User]
  • My Setup
  • Projects
  • People
  • Preferences
  • Lessons Learned

Scheduling

Recommended cadence:

  • Consolidate: Every few days, or after busy periods
  • Defrag: Weekly or bi-weekly
  • Full: Monthly deep clean

Trigger options:

  • Manually: "Run REM sleep" / "Consolidate my memories"
  • Heartbeat: Add to HEARTBEAT.md for periodic runs
  • Cron: Schedule isolated job for off-hours

Quick Reference

# Native search (no dependencies)
grep -r "pattern" ~/.openclaw/agents/main/sessions --include="*.jsonl"

# With Repo Prompt
rp -e 'search "PATTERN" --context-lines 2'

# Helper script (if using Repo Prompt)
./scripts/gather-sessions.sh [days_back]

File Structure

rem-sleep/
├── SKILL.md          # This file
├── README.md         # GitHub readme
└── scripts/
    └── gather-sessions.sh   # Helper script (requires Repo Prompt)

Notes

  • Session logs are JSONL format — content is wrapped in JSON
  • When uncertain if something is stale, keep it (conservative approach)
  • MEMORY.md is loaded in main sessions — keep it focused and relevant
  • The skill is a workflow, not a binary — adapt to your setup

Contributing

PRs welcome! Ideas for improvement:

  • Better heuristics for "what's worth remembering"
  • Alternative search methods
  • Automation scripts for different platforms
  • Integration with vector DBs for semantic search

GitHub: https://github.com/stewnight/rem-sleep-skill

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.19%
按下载量换算63

Claude

29.78%
按下载量换算52

Cursor

17.27%
按下载量换算30

Gemini CLI

9.58%
按下载量换算17

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

未通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

来源信息

继续浏览同类 Skills