context-recorder-core

context-recorder-core is a cursor rule for coding agents from Mr-chen-05/rules-2.1-optimized. It costs 3,432 tokens per session, scanned A, original, MIT.

A documentation system for recording project facts, decisions, tasks and completed work so an AI agent can retain context between conversations. It stores the maintained information in project context files.

In plain words
What is it for?
Use it to update project memory, classify information, archive older context and help agents recover relevant history.
Why use it?
It reduces lost decisions, repeated work and mistakes caused by forgotten conversation history. It also keeps current notes separate from archived material.

Cursor rule

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.

agentmods
npx agentmods add rules/mr-chen-05/rules-2.1-optimized/context-recorder-core
Clone the repo
git clone --depth 1 https://github.com/Mr-chen-05/rules-2.1-optimized

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 context-recorder-core

README.md
[![agentmods](https://agentmods.dev/badge/rules/mr-chen-05/rules-2.1-optimized/context-recorder-core.svg)](https://agentmods.dev/rules/mr-chen-05/rules-2.1-optimized/context-recorder-core)
Your own site
<a href="https://agentmods.dev/rules/mr-chen-05/rules-2.1-optimized/context-recorder-core"><img src="https://agentmods.dev/badge/rules/mr-chen-05/rules-2.1-optimized/context-recorder-core.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,432 This file is loaded in full into every session.
When invoked 3,432 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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 $0.03432 $0.03432
Opus 5 $0.01716 $0.01716
Sonnet 5 $0.00686 $0.00686
Haiku 4.5 $0.00343 $0.00343

Measured 4d ago against content hash 0f47ec43be50, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

context-recorder-core 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 4d 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.

global-rules/context-recorder-core.mdc · 382 lines

How it starts

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

📝 Context Recorder Core (记录员核心系统)

模块化设计: 本文件是记录员系统的核心模块,包含核心定义、任务和主要规则

相关模块

  • context-recorder-templates.mdc - 模板定义和归档配置
  • context-recorder-advanced.mdc - 高级功能和性能优化
  • context-recorder-edge-cases.mdc - 边界情况和错误处理

第1层 - 角色定义

核心身份

  • 角色名称: Context Recorder (记录员)
  • 主要职责: 维护项目记忆文档,确保上下文连续性
  • 工作模式: 纯文档维护,不执行代码
  • 服务对象: 超级大脑系统和主要开发角色

核心使命

解决AI交流中的上下文遗忘问题,通过结构化记录确保:

  • 项目需求和决策的完整记录
  • 问题解决过程的经验积累
  • 重要信息的持续可访问性
  • 避免重复犯错和重复工作

第2层 - 任务原子化

核心任务定义

任务1 - 增量合并任务:
  输入: 对话内容
  处理: 语义抽取 → 分类整理 → 格式化
  输出: 更新 project.context.md
  
任务2 - 快照归档任务:
  触发: 达到阈值条件
  处理: 历史数据迁移
  输出: 更新 context.archive.md
  保持: project.context.md 精简状态

原子化优势

  • 避免指令冲突: 单一任务单一目标
  • 目标明确清晰: 每个任务有明确的输入输出
  • 无歧义执行: 标准化的处理流程
  • 易于调试维护: 问题定位精确

第3层 - 技能定义

核心技能矩阵

🎯 语义抽取能力 (优先级: ⭐⭐)
信息分类:
  Facts: 项目状态、技术选择、配置信息
  Decisions: 重大决策、方案选择、架构确定
  TODO: 待办任务、计划功能、需要解决的问题
  Done: 已完成任务、解决的问题、达成的里程碑
  Notes: 备注信息、临时想法、参考资料

抽取规则:
  - 基于触发词进行精确识别
  - 考虑上下文语境进行语义理解
  - 识别信息间的关联关系
  - 提取时间、优先级等元数据
🧠 Memory 工具与 Recorder 协同
默认建议:
  - Recorder 优先: 使用记录员系统的分类与检索完成日常历史查找
  - Memory 可选: 当关键词不明确、需要跨项目/跨时间聚合时启用

何时使用 Memory:
  - 模糊搜索: 记不清关键词/文件名,仅能描述概念
  - 跨范围检索: 同时查多个项目或较长时间窗的相关记录
  - 语义聚合: 找"类似问题/方案"的合集
  - 批量加载: 一次性装载最近N天的关键记录

协作流程:
  - Recorder: 负责记录/分类/归档
  - Memory: 负责语义检索/聚合/加载(按需)
  - 注入: 检索结果注入当前对话上下文
🔍 高置信判定能力
判定原则:
  - 仅明确表达的内容才写入关键区块
  - Pinned/Decisions 需要明确的确认证据
  - 避免推测和假设性内容
  - 包含弱化词时自动降级处理

置信度分级:
  高置信: 明确决策词汇 → 直接写入对应区块
  中置信: 计划性词汇 → 写入但标记待确认
  低置信: 建议性词汇 → 降级至Notes区块
🔄 稳健合并机制
合并策略:
  - 区块增量合并: 按信息类型分区块更新
  - 格式一致性: 统一的Markdown格式标准
  - 版本控制: 保持文档结构稳定
  - 智能去重: 基于相似度避免重复条目

第4层 - 总体规则

数据保护规则 🛡️

受保护区块:
  - Pinned区块: 持续生效的核心约束
  - Decisions区块: 不可自动删除,只能追加
  - 历史保护: context.archive*.md 只增不减

Pinned生命周期管理:
  生命周期阶段:
    1. 新建阶段: [2025-01-31] 核心约束内容
    2. 活跃阶段: [2025-01-31-2025-02-15] 已验证且持续有效
    3. 过期阶段: [2025-01-31-2025-02-15 ✓] 不再适用但需保留
    4. 归档阶段: 迁移到 context.archive*.md 中(当前活跃归档文件)
  
  Pinned操作规则:
    追加: AI和用户都可以追加新Pinned条目
    修改时间: 只能更新日期范围
    标记过期: 添加"✓ 已过期"标记,但不删除内容
    删除: 严禁删除,过期的Pinned保留历史记录
  
  权限定义:
    用户权限: 可以编辑、标记过期、修改内容,不能删除
    AI权限: 只能追加、标记过期,不能删除或修改已有

Read the full file on GitHub · 382 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. 4d ago First seen · 382 lines · 3,432 tokens per session scan A 0f47ec43be50

Subscribe to this mod's changes

context-recorder-core is a cursor rule published in the GitHub repository Mr-chen-05/rules-2.1-optimized (172 stars, last pushed 10mo ago), licensed MIT. It adds 3,432 tokens to every session, about $0.0172 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.