knowledge-session-state-and-context-project-auto-memory

knowledge-session-state-and-context-project-auto-memory is a skill for Claude Code, Codex from echoVic/blade-code. It costs 137 tokens per session (1,886 once invoked), scanned A, a copy of knowledge-session-state-and-context, MIT.

A project-memory component that stores project notes in an index and topic files for later sessions.

In plain words
What is it for?
It is for reading, writing, listing, and managing project memory, including adding selected learnings after a conversation is compressed.
Why use it?
It gives an agent a persistent place to remember project-specific decisions and facts instead of starting from scratch each time.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for reading, writing, listing, and managing project memory, including adding selected learnings after a conversation is compressed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/echovic/blade-code/project-auto-memory
Install

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.

Any agent
npx skills add echoVic/blade-code --skill project-auto-memory
Clone the repo
git clone --depth 1 https://github.com/echoVic/blade-code

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for knowledge-session-state-and-context-project-auto-memory

README.md
[![agentmods](https://agentmods.dev/badge/skills/echovic/blade-code/project-auto-memory.svg)](https://agentmods.dev/skills/echovic/blade-code/project-auto-memory)
Your own site
<a href="https://agentmods.dev/skills/echovic/blade-code/project-auto-memory"><img src="https://agentmods.dev/badge/skills/echovic/blade-code/project-auto-memory.svg" alt="Measured on agentmods" height="20"></a>
Per session 137 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,886 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 80% copy Near-identical to another mod in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00137 $0.01886
Opus 5 $0.00068 $0.00943
Sonnet 5 $0.00027 $0.00377
Haiku 4.5 $0.00014 $0.00189

Measured 3d ago against content hash fb7befe4163a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

knowledge-session-state-and-context-project-auto-memory 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 3d 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.

Origin

This is a copy

80% identical to knowledge-session-state-and-context — 75 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.trae/knowledges/session-state-and-context/context-compaction-token-budget-and-memory/project-auto-memory/SKILL.md · 56 lines

How it starts

The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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)

Read the full file on GitHub · 56 lines

Changes

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.

  1. 3d ago First seen · 56 lines · 137 tokens per session scan A fb7befe4163a

Subscribe to this mod's changes

knowledge-session-state-and-context-project-auto-memory is a skill published in the GitHub repository echoVic/blade-code (178 stars, last pushed yesterday), licensed MIT. It adds 137 tokens to every session and 1,886 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. It is 80% identical to knowledge-session-state-and-context, differing in 75 lines, and is treated as a copy.

Related

Other skills, from other repositories

algorithmic-art

Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright…

alleneee/skill-agent · 62 tokens

mcp-builder

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external agents through well-designed tools. Use when building MCP servers to integrate external APIs or agents, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

alleneee/skill-agent · 61 tokens

slack-gif-creator

Toolkit for creating animated GIFs optimized for Slack, with validators for size constraints and composable animation primitives. This skill applies when users request animated GIFs or emoji animations for Slack from descriptions like "make me a GIF for Slack of X doing Y".

alleneee/skill-agent · 57 tokens

canvas-design

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

alleneee/skill-agent · 59 tokens

self-improvement

A process for recording useful lessons from unexpected failures, user corrections, missing abilities, and reusable project patterns.

alleneee/skill-agent · 60 tokens

travel-planner

Creates comprehensive travel itineraries with destination analysis, budget planning, transportation, accommodation, and local insights. Use when planning trips, organizing travel schedules, or seeking destination recommendations.

alleneee/skill-agent · 38 tokens