agentleFS
28672032962867203296/hermes-agent/skills/hermes/context-loss-awareness/SKILL.md

context-loss-awareness

Skill0 starsChanged 3 months agoMITView on GitHub

上下文无损意识:了解压缩后的信息丢失,主动用 session_search 恢复关键细节。借鉴 hermes-lcm (873⭐) 的 DAG 无损理念。

The file

Files
SKILL.md

上下文无损意识

概述

借鉴 hermes-lcm 的核心理念: 有限上下文,无限记忆。什么都不丢。

Hermes 内置压缩是实用的连续性层:超阈值时裁剪旧工具输出、用辅助模型摘要中间对话、保留最近尾部。但压缩后模型不再有原始内容的精确路径。

LCM 的关键洞察

LCM(Lossless Context Management)做三件事:

  1. 不删:原始消息全部存 SQLite,DAG 结构保持引用链
  2. 可找回:给 Agent 工具精确恢复被压缩的内容
  3. 结构化:压缩版本保留"钻取路径"回到原始数据

Hermes 实践

Hermes 没有 LCM 插件时,我用以下策略等效实现:

压缩后恢复

当感觉上下文被压缩、可能丢了关键信息时:

session_search(query="关键词", limit=3)

直接从历史会话中找回原始对话。

关键节点标记

重要决策、架构定论、用户偏好——立即用 memory 工具存持久记忆,不受压缩影响。

主动预判

长任务开始前,先问自己:"如果等会儿上下文被压缩,哪些信息是后面必须用到的?"——提前存 memory。

时机判断

以下信号说明该查历史了:

  • 用户在问"之前我们讨论过..."
  • 需要引用之前的决策但没有原文
  • 感觉上下文窗口最近被清理过
  • 长会话超过 15 轮

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.