Token导航 LogoToken导航

Agent Skill · 研究检索

agent-session-state(Agent 会话状态)

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

agent-session-state 是研究检索类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为接触敏感数据;许可证为 MIT-0,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 18,868。

总安装 5,875周安装 240GitHub Stars 公开资料未说明下载 1,882核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT-0
版本
2.1.4

安装方式

通过对话安装

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

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

命令行安装

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

ClawHubOpenClaw
openclaw skills install agent-session-state

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

实现每通道会话隔离与预写日志管理,防止跨会话干扰。适用于多用户并发或复杂工作流中的状态安全控制。捕获关键决策并缓冲操作,保障代理行为的可追溯性。安装命令:openclaw skills install agent-session-state;需配置独立存储路径。注意日志写入可能影响性能,建议根据负载调整缓冲策略。

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 OpenClaw;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install agent-session-state;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

agent-session-state 怎么安装?

在终端执行 openclaw skills install agent-session-state。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

agent-session-state 支持哪些 AI 工具?

公开资料标注支持 OpenClaw。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

agent-session-state 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

agent-session-state 是免费的吗?

来源标注的许可证是 MIT-0。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

agent-session-state 用的人多吗?

公开数据是累计安装 5,875 次,近一周安装 240 次,下载 1,882 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

agent-session-state 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 OpenClaw,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
agent-session-state

Agent 会话状态 · 本页

5,875—接触敏感数据MIT-0通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

name
agent-session-state
description
>-
license
MIT
compatibility
OpenClaw 2026.4.x or later.
metadata
openclaw
requires
bins
["openclaw"]
paths
write
["memory/sessions/", "memory/working-buffer.md"]
read
["memory/sessions/", "memory/working-buffer.md", "memory/topics/", "memory/daily/", "MEMORY.md"]
version
2.1.4
clawhub
{"category": "memory", "tags": ["session", "isolation", "wal", "buffer"]}

Agent Session State v2.1.4

Agents that serve multiple channels need structured per-channel state beyond what gateway transcripts capture. This skill provides curated agent-authored session files, a Write-Ahead Log (WAL) protocol for reliable decision capture, a working buffer for post-compaction context recovery, and a distillation workflow that promotes session-level state into topic files over time.

At a glance

OpenClaw already provides per-channel transcript isolation via session.dmScope, gateway-owned session history, automatic session maintenance and pruning, a silent memory flush before compaction, and sessions_history for reading prior transcripts. If that covers your needs — "keep different users' conversations separate" and "save durable facts before compaction summarizes the chat" — you do not need this skill.

This skill operates at a different layer. It adds curated agent-authored state files per channel at memory/sessions/{channel}.md, a Write-Ahead Log discipline that commits decisions and corrections to disk before the agent responds, a working buffer for post-compaction context recovery, and a distillation workflow that promotes session-level state into topic files over time. The files are notebooks the agent actively maintains, not transcripts of what was said. Transcripts tell you what was said; session state files tell you what was decided.

Install this skill if your agent needs structured, human-readable, long-lived notes about each channel's ongoing work; if you find yourself losing decisions mid-session because they are never committed anywhere durable; if you want continuity after compaction that goes beyond the memory flush's single-turn save; or if you need topic-aware recovery when working on projects that span multiple sessions. For multi-user agents, run it alongside session.dmScope = "per-channel-peer" — they are complementary, not redundant.

Relationship to OpenClaw native sessions

OpenClaw core handles transcript routing and raw history. The gateway owns session transcripts at ~/.openclaw/agents/<agentId>/sessions/ as JSONL per session, isolates them via session.dmScope, prunes them via session.maintenance, and exposes sessions_list, sessions_history, and session_status as agent tools. This skill does not replace any of that. If you run multiple users or channels, enable session.dmScope = "per-channel-peer" regardless of whether this skill is installed — that is what stops Alice's DMs from leaking into Bob's session at the routing level.

This skill handles curated agent-authored state in the workspace. memory/sessions/{channel}.md lives alongside topic files and daily notes in the agent workspace, is human-readable markdown, and is actively maintained by the agent with WAL entries and distillation rules. The paths do not collide with OpenClaw's transcript store. The two layers compose cleanly: transcripts are raw append-only history; session state files are curated decision logs the agent keeps on purpose.

OpenClaw's silent memory flush and this skill's WAL protocol also compose cleanly. Memory flush is reactive — a single turn that runs at the compaction boundary to save durable facts to MEMORY.md and daily notes. WAL is proactive — per-decision entries written throughout the session, before the agent responds. Different cadences, different granularities, no conflict. Run both.

Filesystem Access

This skill writes to two locations within the workspace:

  • memory/sessions/ — one markdown file per channel, named with a filesystem-safe slug derived from the channel name or id (lowercase, non-alphanumerics replaced with hyphens)
  • memory/working-buffer.md — a single file for context recovery during long sessions

This skill reads from those same paths, plus memory/topics/, memory/daily/, and MEMORY.md during compaction recovery. All paths are declared in the metadata above.

Set appropriate permissions on the sessions directory: chmod 700 memory/sessions. Each channel's session state file is only written by that channel's session, so there are no cross-session file conflicts.

Architecture

Per-Channel Session Files

Each conversation context (Discord channel, Slack channel, group chat, etc.) gets its own session state file under memory/sessions/. These files store recent context from that channel, WAL entries specific to that conversation, working buffer status, channel-specific preferences, and active topic references (pointers to topic files when using hierarchical-agent-memory).

Write-Ahead Log (WAL) Protocol

The WAL protocol ensures that important information is captured reliably, even in the face of concurrent writes or session restarts.

When to log: Use your judgment. If the user states a decision, correction, preference, constraint, or important fact — log it before responding. Don't rely on keyword matching as a mechanical trigger. Instead, ask yourself: if this session ended right now, would losing this information hurt? If yes, log it.

The protocol: Write to the session state file FIRST, then respond. The urge to respond is the enemy. Context vanishes. Write it down.

What to log:

  • Decisions — "We're going with approach B", agreements, commitments
  • Corrections — "It's actually X, not Y", factual corrections
  • Constraints — "Never do X", hard stops, gated items
  • Preferences — style choices, tool preferences, workflow preferences
  • Specific values — version numbers, dates, IDs, URLs, config settings
  • New proper nouns — people, companies, projects the agent hasn't seen before

What NOT to log:

  • Secrets, passwords, API keys, tokens, or credentials — never write these to session files. If the user shares a secret in conversation, log the fact that a credential exists and where it is stored (e.g., "API key for service X is in .env"), not the value itself.
  • Personally identifiable information (PII) beyond what is needed for the agent's work — phone numbers, SSNs, financial account numbers, and similar sensitive data should not appear in session files.
  • Casual conversation, greetings, small talk
  • Information already in topic files or MEMORY.md
  • Transient task context that won't matter next session

Working Buffer

During long or complex sessions where compaction is likely, activate the working buffer. Update memory/working-buffer.md status to ACTIVE. Log every exchange as the user's message plus a 1-2 sentence summary of the AI's response. After compaction, read working-buffer.md FIRST to recover context — don't ask "where were we?" After compaction, clear and restart the buffer at the start of the next long session.

There's no precise context meter. This is a judgment call based on session length, conversation density, and complexity.

Session Startup

Before doing anything else in a new session:

  1. Read memory/sessions/{channel}.md for recent context from this channel
  2. Read memory/working-buffer.md if active (context recovery)
  3. Clear and reset the working buffer if the session is starting fresh

This ensures continuity without loading irrelevant history from other channels.

WAL Protocol in Practice

When you receive a message that contains a decision, correction, preference, or important fact:

  1. Write to session state file FIRST (before thinking about your response)
  2. Include: timestamp, channel, decision/fact, reasoning if relevant
  3. Then respond to the user

Example WAL entry:

- [Time] — [Channel] — Decision: [Project] will be deployed with [feature]. Reasoning: [justification].

Compaction Recovery

If a session starts mid-task or you should know something but don't:

  1. Read memory/working-buffer.md first (raw danger-zone exchanges)
  2. Read your session state file
  3. Check active topic references in the session state — if the session was working on a specific project, read the relevant topic file for authoritative project state
  4. Read today's and yesterday's daily notes
  5. If still missing context, use memory_search
  6. As a last resort, use sessions_history to read a raw transcript excerpt from the current or prior session — this is heavier than the other recovery paths but will surface literal exchanges when structured notes are incomplete
  7. Let the user know context was recovered and what you picked up — use natural phrasing, but make it clear you're working from reconstructed context, not continuous memory

Never ask "what were we discussing?" — the buffer has it.

Distillation Targets

During maintenance, important information from session state should be distilled to the appropriate long-term location:

  • Project decisions and status changes go to the relevant topic file if using hierarchical-agent-memory v3+. Topic files are the authoritative source for project state.
  • New contact information goes to the relevant contact file.
  • General observations and events go to today's daily note.
  • Durable constraints or pointers go to MEMORY.md as one-line entries only — MEMORY.md is a routing table, not a notebook.

Do NOT dump session state into MEMORY.md as paragraphs. If the information is project-specific, it belongs in a topic file.

Maintenance and Retention

During heartbeat and cron routines:

  • Check WAL for completeness — flag entries that haven't been distilled
  • Distill important entries to topic files and daily notes, then remove them from the session file
  • Clear expired working buffer entries
  • Prune session state entries older than 7 days that have already been distilled — session files are active working memory, not archives
  • Verify session state file integrity

Session files should stay small. If a session file exceeds 5KB, it likely contains entries that should have been distilled to topic files or daily notes. Review and distill before the file grows further.

Integration with Other Skills

hierarchical-agent-memory provides the memory structure this skill writes into. With v3+, topic files are the primary working memory layer — distill important session decisions into topic files, not just daily notes. Per-channel session files prevent concurrent writes to the same memory files. Session state files can reference active topics by path for faster context recovery.

agent-provenance tracks file authorship. Session state files are agent-authored; provenance headers track creation and review dates. Commit tags apply to session state changes as they do to any other agent-authored file.

OpenClaw's silent memory flush (see docs/concepts/compaction.md) complements the WAL protocol. Memory flush is reactive and runs a single turn at the compaction boundary to save durable facts to MEMORY.md and daily notes. WAL is proactive and writes per-decision entries throughout the session. Run both — they cover different cadences and do not conflict. Memory flush is OpenClaw's default behavior and does not require this skill to be installed.

Best Practices

For session state: Treat this as active working memory, not long-term storage. Move important decisions to topic files or daily notes during distillation. Prune old entries during maintenance routines. Include pointers to active topic files for faster recovery.

For topic files: Keep channel-specific runtime context in the session state file. Distill project decisions and status changes into the relevant topic file during maintenance. Cross-reference between session state and topic files as needed.

For daily notes: General observations and events go to daily notes. Project-specific decisions go to topic files, not daily notes. Use the WAL protocol for important facts regardless of destination.

For working buffer: Don't activate for short, simple sessions. Do activate for complex problem-solving, coding, or multi-step tasks. Review and clear periodically to avoid bloat.

Related Skills

  • hierarchical-agent-memory — Hybrid topic-based working memory with optional time-based archival layers
  • agent-provenance — File authorship, review tracking, and governance

平台分布

OpenClaw

77.69%
按下载量换算1,462

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills