Agent skill

Knowledge Session State And Context Project Auto Memory

by echoVic in echoVic/blade-code

覆盖项目级 MEMORY.md 索引、主题文件、MemoryRead/MemoryWrite 工具和压缩后启发式巩固. An agent skill from echoVic/blade-code.

MITAuto-check passedAgent Workflows

Install Knowledge Session State And Context Project Auto Memory

skills CLI
$ npx skills add echoVic/blade-code --skill knowledge-session-state-and-context-project-auto-memory -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install echoVic/blade-code knowledge-session-state-and-context-project-auto-memory --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/echoVic/blade-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.trae/knowledges/session-state-and-context/context-compaction-token-budget-and-memory/project-auto-memory .claude/skills/knowledge-session-state-and-context-project-auto-memory && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
knowledge-session-state-and-context-project-auto-memory
GitHub stars
180
Token cost
~1.3k tokens
SKILL.md length
241 words
Files
1
Skills in repo
38
Repo updated
First seen
Licence
MIT

At a glance

覆盖项目级 MEMORY.md 索引、主题文件、MemoryRead/MemoryWrite 工具和压缩后启发式巩固. An agent skill from echoVic/blade-code.

  • Tasks that involve Session handoff
  • SKILL.md covers Module Structure, Gotchas, Architecture and Decisions, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Tasks that involve LLM cost and token optimization

What it does

Knowledge Session State And Context Project Auto Memory is an agent skill from echoVic/blade-code. 覆盖项目级 MEMORY.md 索引、主题文件、MemoryRead/MemoryWrite 工具和压缩后启发式巩固。 适用于修改跨 Session 记忆加载、topic 命名、手工读写、安全过滤、项目身份或 consolidation 规则。 不含单 Session Token 压缩与 replacement checkpoint(见 ../compaction-pipeline-and-checkpoints/)和 durable transcript(见 ../../durable-transcript-and-event-projection/)。 关键词:AutoMemoryManager, MemoryConsolidation, MemoryRead, MemoryWrite, MEMORY.md, topic, BLADEAUTOMEMORY。

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering Session handoff, LLM cost and token optimization and Context engineering. The repository describes itself as: AI-powered CLI coding agent with 20+ built-in tools, MCP support, and multi-model providers. The licence is MIT.

When your agent uses it

  • Tasks that involve Session handoff
  • Tasks that involve LLM cost and token optimization
  • Tasks that involve Context engineering

Example prompts

  • “/knowledge-session-state-and-context-project-auto-memory”

What it can do on your machine

Read from SKILL.md and the folder at commit 30f8684. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Knowledge Session State And Context Project Auto Memory loads about 1.3k tokens when it runs. Until then it costs about 111 tokens; SKILL.md has 241 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~111
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from echoVic/blade-code at commit 30f8684, republished under its MIT licence (© echoVic). 241 words, ~1,285 tokens.

Download SKILL.mdSave it as .claude/skills/knowledge-session-state-and-context-project-auto-memory/SKILL.md (or your agent's skills folder).
name
knowledge-session-state-and-context-project-auto-memory
description
覆盖项目级 MEMORY.md 索引、主题文件、MemoryRead/MemoryWrite 工具和压缩后启发式巩固。 适用于修改跨 Session 记忆加载、topic 命名、手工读写、安全过滤、项目身份或 consolidation 规则。 不含单 Session Token 压缩与 replacement checkpoint(见 ../compaction-pipeline-and-checkpoints/)和 durable transcript(见 ../../durable-transcript-and-event-projection/)。 关键词:AutoMemoryManager, MemoryConsolidation, MemoryRead, MemoryWrite, MEMORY.md, topic, BLADE_AUTO_MEMORY。

Module Structure

Auto Memory 位于 Session transcript 之外,以项目路径派生独立存储目录。系统提示只自动加载有界索引,详细 topic 由工具按需读取;成功压缩后还会用无 LLM 的规则从被丢弃消息中追加少量候选知识。

Directory Layout
  • packages/cli/src/memory/AutoMemoryManager.ts:索引、topic、列举和清理
  • packages/cli/src/memory/MemoryConsolidation.ts:压缩后启发式提取
  • packages/cli/src/memory/types.ts:启用开关与索引行数预算
  • packages/cli/src/tools/builtin/memory/MemoryReadTool.ts:按 topic 读取或列举
  • packages/cli/src/tools/builtin/memory/MemoryWriteTool.ts:手工写入与敏感模式拒绝
  • packages/cli/src/prompts/builder.ts:新模型上下文中的索引注入
  • packages/cli/src/slash-commands/memory.ts:用户侧项目记忆管理
Key Entry Points
  • AutoMemoryManager.loadIndex():加载有界 MEMORY.md
  • AutoMemoryManager.readTopic() / writeTopic():读取或更新详细主题
  • extractLearnings():从用户、assistant 和 tool 消息提取有限规则命中
  • consolidateAfterCompaction():按日期追加提取结果
  • memoryReadTool / memoryWriteTool:模型侧手工访问入口

Gotchas

  • MEMORY.md 自动注入只取前 200 行并附加剩余行提示;MemoryRead(topic="MEMORY") 仍可读取完整索引,因此索引过长不会丢失,但会增加一次显式工具调用 (packages/cli/src/memory/AutoMemoryManager.ts, packages/cli/src/tools/builtin/memory/MemoryReadTool.ts)
  • BLADE_AUTO_MEMORY=0 只阻止 Prompt builder 自动注入索引,不会注销 MemoryRead/MemoryWrite,也不会阻止手工访问项目记忆 (packages/cli/src/prompts/builder.ts, packages/cli/src/tools/builtin/index.ts)
  • topic 中的路径分隔符和特殊字符统一替换为 -;不同原始 topic 可能映射到同一个 .md 文件,调用方不能把原始名称当成无碰撞身份 (packages/cli/src/memory/AutoMemoryManager.ts)
  • append 是“读取旧正文再整体 writeFile”,AutoMemoryManager 没有 keyed mutex 或原子替换;MemoryWrite 的非并发标记只约束单个 executor,跨 Session 同 topic 写入仍可能 last-writer-wins (packages/cli/src/memory/AutoMemoryManager.ts, packages/cli/src/tools/builtin/memory/MemoryWriteTool.ts)
  • Memory 工具优先用 ExecutionContext.workspaceRoot 派生项目,Prompt builder 使用传入的 projectPath,自动巩固使用 getCwd();worktree 和多 workspace 路径必须显式对齐,不能假设三条入口天然写到同一目录 (packages/cli/src/tools/builtin/memory/MemoryReadTool.ts, packages/cli/src/tools/builtin/memory/MemoryWriteTool.ts, packages/cli/src/prompts/builder.ts, packages/cli/src/memory/MemoryConsolidation.ts)
  • MemoryWrite 的敏感信息拒绝只覆盖少量 password/token/secret/api key/private key 正则,既可能漏掉其他凭据,也允许不带赋值形态的普通 password 语句;通过校验不等于内容可安全持久化 (packages/cli/src/tools/builtin/memory/MemoryWriteTool.ts)
  • MemoryRead 对 topic 不存在和空列表都返回 success: true,调用方必须检查返回正文,不能把工具成功当作记忆已命中 (packages/cli/src/tools/builtin/memory/MemoryReadTool.ts)
  • listTopics() 只把 ENOENT 解释为空列表,其他文件系统错误会抛出并可由 retry-safe 的 MemoryRead 做瞬态重试;deleteTopic() 仍把任意 unlink 异常折叠为 false,两个入口的失败语义不同 (packages/cli/src/memory/AutoMemoryManager.ts, packages/cli/src/tools/builtin/memory/MemoryReadTool.ts)
  • 自动巩固只识别用户显式 remember/convention/lesson 标记、assistant 的 fix 文本和有限 tool error 模式;tool error 每次最多保留 5 条,它不是对被丢弃上下文的完整语义总结 (packages/cli/src/memory/MemoryConsolidation.ts)
  • 压缩成功后 consolidation 以 fire-and-forget 启动并吞掉全部异常;记忆写入失败既不回滚 checkpoint,也不会令 compaction 失败 (packages/cli/src/context/CompactionService.ts, packages/cli/src/memory/MemoryConsolidation.ts)

Architecture

  • AutoMemoryManager 通过项目存储路径把 MEMORY.md 与 topic 文件放在 Session transcript 之外,使同一项目的后续 Session 可以复用,但不会继承 rewind、fork 或 committed seq 语义 (packages/cli/src/memory/AutoMemoryManager.ts, packages/cli/src/context/storage/pathUtils.ts)
  • Prompt builder 只把索引放入 <auto-memory>,详细 topic 不自动进入系统提示;MemoryRead 是渐进披露入口 (packages/cli/src/prompts/builder.ts, packages/cli/src/tools/builtin/memory/MemoryReadTool.ts)
  • MemoryRead 是并发安全且可重试的 ReadOnly 工具,MemoryWrite 是不可并发、不可自动重放的 Write 工具;两者仍通过统一 ToolExecutor 权限与结果契约 (packages/cli/src/tools/builtin/memory/MemoryReadTool.ts, packages/cli/src/tools/builtin/memory/MemoryWriteTool.ts)
  • consolidation 不调用额外模型,只把规则命中按日期追加到 preferences、conventions、lessons 或 debugging topic,避免压缩额外产生 Provider 请求 (packages/cli/src/memory/MemoryConsolidation.ts)

Decisions

  • Auto Memory 以索引加 topic 的两层结构实现渐进披露:启动成本固定在索引前 200 行,详细经验留给按需工具读取 (packages/cli/src/memory/AutoMemoryManager.ts, packages/cli/src/prompts/default.ts, git:40128981)
  • 自动巩固采用保守启发式并在失败时不影响压缩主路径,优先保证 Session checkpoint 可提交,而不是保证每次压缩都产生记忆 (packages/cli/src/context/CompactionService.ts, packages/cli/src/memory/MemoryConsolidation.ts)

Patterns

  • topic="MEMORY" 是索引写入的保留入口,topic="_list" 只在 MemoryRead 中表示列举;普通 topic 最终统一补 .md 后缀 (packages/cli/src/tools/builtin/memory/MemoryReadTool.ts, packages/cli/src/tools/builtin/memory/MemoryWriteTool.ts, packages/cli/src/memory/AutoMemoryManager.ts)
  • append 会在旧正文缺少尾换行时补一个分隔换行,consolidation 自身则把每条结果格式化为带 ISO 日期的 Markdown 列表项 (packages/cli/src/memory/AutoMemoryManager.ts, packages/cli/src/memory/MemoryConsolidation.ts)
  • topic 列表按最后修改时间降序返回并包含 MEMORY 本身;UI 或 Agent 若要把索引固定在首位,需要在消费端另行排序 (packages/cli/src/memory/AutoMemoryManager.ts)

© echoVic, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .trae/knowledges/session-state-and-context/context-compaction-token-budget-and-memory/project-auto-memory of echoVic/blade-code.

Open the folder on GitHubat commit 30f8684

Compare with similar skills

Knowledge Session State And Context Project Auto Memory next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Knowledge Session State And Context Project Auto Memory compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Knowledge Session State And Context Project Auto Memory this skillechoVic/blade-code180—~1.3kAutomated safety check: PassMIT
Quarter Clone Conversationykdojo/claude-code-tips10k—~401Automated safety check: PassCustom licence
Memory Systemsguanyang/open-agent-hub9732 repos~4.1kAutomated safety check: PassMIT
Context Mode Output Sandboxmksglu/context-mode26k—~4.1kAutomated safety check: PassCustom licence
Memori Long-Term MemoryMemoriLabs/Memori17k—~2kAutomated safety check: NotesCustom licence
Context Mode for Antigravity CLImksglu/context-mode26k—~850Automated safety check: PassCustom licence

Similar skills

  • Quarter Clone Conversation

    ykdojo/claude-code-tips

    Starts a new Claude Code session from only the last quarter of the current conversation, dropping earlier context to save tokens while keeping recent work.

    10k GitHub stars~401 tokensUpdated 12 days ago
    Agent WorkflowsAuto-check passed
  • Memory Systems

    guanyang/open-agent-hub

    This skill should be used for persistent semantic memory in agent systems: cross-session knowledge retention, entity tracking, temporal validity, graph or vector retrieval, memory consolidation, and…

    973 GitHub starsUsed in 2 repos~4.1k tokens
    Agent WorkflowsAuto-check passed
  • Context Mode Output Sandbox

    mksglu/context-mode

    Routes large command, file, API and browser output through context-mode tools so only the needed result enters the agent's context, instead of dumping it via Bash.

    26k GitHub stars~4.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Memori Long-Term Memory

    MemoriLabs/Memori

    Connects Claude Code to Memori Cloud for long-term memory, recalling stored context before substantive replies and saving new context afterward.

    17k GitHub stars~2k tokensUpdated 4 days ago
    Agent WorkflowsAuto-check: notes
  • Routing rules for using context-mode MCP tools in Antigravity CLI: sandboxed code runs, file analysis, indexed search and web fetches that keep large output out of the conversation.

    26k GitHub stars~850 tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Context Fundamentals

    guanyang/open-agent-hub

    This skill should be used to explain or reason about the foundational concepts of context engineering: what context is, the anatomy of a context window, how attention mechanics work, the U-shaped…

    973 GitHub starsUsed in 2 repos~4.2k tokens
    Agent WorkflowsAuto-check passed

More from echoVic/blade-code

All 38 skills in this repo
  • Base64 Parser

    echoVic/blade-code

    Base64 编解码工具,支持编码/解码文本、JSON、二进制文件,自动检测格式,支持批量处理. An agent skill from echoVic/blade-code.

    180 GitHub stars~545 tokensUpdated 10 days ago
    Auto-check: notes
  • Code Review

    echoVic/blade-code

    Review frontend code for best practices, bugs, and improvements.

    180 GitHub stars~377 tokensUpdated 10 days ago
    Auto-check: notes
  • GitHub Explorer

    echoVic/blade-code

    Explore and summarize popular GitHub projects. An agent skill from echoVic/blade-code.

    180 GitHub stars~434 tokensUpdated 10 days ago
    Auto-check passed
  • 覆盖 Session 级 LSP 配置快照、stdio 进程、文档同步、语义查询、诊断回注、崩溃恢复 和子 Session 继承。进入条件:新增语言服务器、修改 LSP 工具、排查诊断缺失/重复、 处理 worktree 或 ACP 差异、修复进程泄漏或 transport 代际问题。不包含:VS Code 扩展桥接(见…

    180 GitHub stars~1.9k tokensUpdated 10 days ago
    Auto-check passed
  • 覆盖 SkillRegistry、SKILL.md 延迟加载、自定义命令 Markdown 解析、来源覆盖、插件 命名空间、Session 快照和模型/用户调用入口。进入条件:新增 Skill 或命令字段、调整 发现优先级、调试 /command 或 Skill 工具、修改 Prompt 元数据或消费者集成。不包含: 插件安装生命周期(见…

    180 GitHub stars~2.1k tokensUpdated 10 days ago
    Auto-check passed
  • Covers 领域能力如何包装成内置工具、getBuiltinTools 的 Session 依赖注入、ToolSearch 延迟激活,以及 Goal/Task/Team/Plan/Skill/LSP/MCP/Web/Config/Worktree 适配边界。

    180 GitHub stars~2.1k tokensUpdated 10 days ago
    Auto-check passed

Categories

Questions about Knowledge Session State And Context Project Auto Memory

What does Knowledge Session State And Context Project Auto Memory do?

覆盖项目级 MEMORY.md 索引、主题文件、MemoryRead/MemoryWrite 工具和压缩后启发式巩固. An agent skill from echoVic/blade-code. Knowledge Session State And Context Project Auto Memory is an agent skill from echoVic/blade-code.

When should I use Knowledge Session State And Context Project Auto Memory?

Knowledge Session State And Context Project Auto Memory fits situations like: tasks that involve Session handoff; tasks that involve LLM cost and token optimization; tasks that involve Context engineering.

How do I install Knowledge Session State And Context Project Auto Memory in Claude Code?

Run `npx skills add echoVic/blade-code --skill knowledge-session-state-and-context-project-auto-memory -a claude-code`. Or copy the skill folder (.trae/knowledges/session-state-and-context/context-compaction-token-budget-and-memory/project-auto-memory in echoVic/blade-code) into .claude/skills/knowledge-session-state-and-context-project-auto-memory in your project. Claude Code loads it when a task matches its description.

How do I install Knowledge Session State And Context Project Auto Memory in Codex?

Run `npx skills add echoVic/blade-code --skill knowledge-session-state-and-context-project-auto-memory -a codex`. Or copy the skill folder (.trae/knowledges/session-state-and-context/context-compaction-token-budget-and-memory/project-auto-memory in echoVic/blade-code) into .agents/skills/knowledge-session-state-and-context-project-auto-memory in your project. Codex loads it when a task matches its description.

Can I use Knowledge Session State And Context Project Auto Memory in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add echoVic/blade-code --skill knowledge-session-state-and-context-project-auto-memory -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/knowledge-session-state-and-context-project-auto-memory, .gemini/skills/knowledge-session-state-and-context-project-auto-memory, .github/skills/knowledge-session-state-and-context-project-auto-memory and .opencode/skills/knowledge-session-state-and-context-project-auto-memory in your project.

What does Knowledge Session State And Context Project Auto Memory need to run?

SKILL.md names no scripts, command-line tools or credentials: Knowledge Session State And Context Project Auto Memory is instructions for the agent only.

Does Knowledge Session State And Context Project Auto Memory access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Knowledge Session State And Context Project Auto Memory safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Knowledge Session State And Context Project Auto Memory use?

Knowledge Session State And Context Project Auto Memory is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Knowledge Session State And Context Project Auto Memory use?

About 1.3k tokens (SKILL.md is roughly 5.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Knowledge Session State And Context Project Auto Memory?

Skills that share tags, products or a category with Knowledge Session State And Context Project Auto Memory: Quarter Clone Conversation (ykdojo/claude-code-tips, 10k stars), Memory Systems (guanyang/open-agent-hub, 973 stars), Context Mode Output Sandbox (mksglu/context-mode, 26k stars) and Memori Long-Term Memory (MemoriLabs/Memori, 17k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Knowledge Session State And Context Project Auto Memory?

echoVic (a GitHub user) maintains it in echoVic/blade-code, which has 180 GitHub stars. The repository holds 38 skills in this directory. The repository was last updated on September 27, 2026.

Source: echoVic/blade-code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.