cognitive-memory

cognitive-memory is a skill for Claude Code, Codex from anymouschina/TapCanvas. It costs 51 tokens per session (999 once invoked), scanned A, original, MIT.

A long-term memory system for AI agents that saves, searches, organises, archives, and resumes information beyond the current conversation.

In plain words
What is it for?
Use it to store reusable facts, search past work, manage different kinds of memory, forget outdated entries, and continue interrupted tasks.
Why use it?
It prevents important decisions, preferences, and earlier results from being lost when a task spans multiple conversations or agents.

Skill for Claude CodeCodex

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

Good fit Use it to store reusable facts, search past work, manage different kinds of memory, forget outdated entries, and continue interrupted tasks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/anymouschina/tapcanvas/cognitive-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 anymouschina/TapCanvas --skill cognitive-memory
Clone the repo
git clone --depth 1 https://github.com/anymouschina/TapCanvas

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 cognitive-memory

README.md
[![agentmods](https://agentmods.dev/badge/skills/anymouschina/tapcanvas/cognitive-memory.svg)](https://agentmods.dev/skills/anymouschina/tapcanvas/cognitive-memory)
Your own site
<a href="https://agentmods.dev/skills/anymouschina/tapcanvas/cognitive-memory"><img src="https://agentmods.dev/badge/skills/anymouschina/tapcanvas/cognitive-memory.svg" alt="Measured on agentmods" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 999 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00051 $0.00999
Opus 5 $0.00026 $0.00500
Sonnet 5 $0.00010 $0.00200
Haiku 4.5 $0.00005 $0.00100

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

Security

Grade A, and why

cognitive-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 8d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (scripts/init_memory.sh, scripts/upgrade_to_1.0.6.sh, scripts/upgrade_to_1.0.7.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

apps/agents-cli/skills/cognitive-memory/SKILL.md · 90 lines

What it actually says

cognitive-memory

目标:让 agents-cli 在任务中具备“可管理、可检索、可归档、可续跑”的长期记忆能力,而不是仅依赖会话上下文。

适用场景

在以下场景优先加载本技能:

  • 用户明确要求“记住/别忘了/以后按这个做”。
  • 任务跨多轮、跨会话,且需要稳定复用历史结论。
  • 多代理协作,需要共享读、受控写。
  • 需要把阶段结果写入本地记忆索引并支持“继续”。

工具契约(agents-cli)

本技能默认使用这些工具:

  • memory_save({ content, tags?, store?, source?, importance? })
  • memory_search({ query, limit?, store?, includeArchived? })
  • memory_forget({ id? | query? })
  • memory_reflect({ query?, limit?, minDecayScore?, requestedTokens?, extraTokens?, penaltyTokens?, extraReason?, penaltyReason? })
  • memory_reflect_commit({ reflectionId, decision, approvedTokens, reason })
  • 必要时配合 read_file / write_file 写入结构化索引文件。

记忆分层规则

  • core: 始终高优先级的长期约束与偏好。
  • episodic: 本次执行过程中的阶段事实、异常、修复记录。
  • semantic: 实体/关系/业务知识(例如角色关系、术语、领域映射)。
  • procedural: 可复用流程、模板、操作策略。
  • vault: 用户明确指定“永久保留、不要自动淡化”的关键记忆。

写入规范

每次写入 memory_save 时必须满足:

  1. content 为可复用事实,不写空话。
  2. tags 至少包含任务域和对象(例如 book-metadata, novel:xxx)。
  3. source 记录来源技能或流程(例如 agents-team-book-metadata)。
  4. importance 按 0~1 给出,核心约束建议 >= 0.8。

检索规范

  1. 回答前先 memory_search(至少 1 次)验证历史记忆。
  2. 查询词必须包含主体 + 任务域(如 my-book metadata characterGraph)。
  3. 命中冲突时,先返回冲突点,再请求用户确认,不允许私自覆盖。

遗忘规范

仅在以下条件允许 memory_forget

  • 用户明确要求遗忘。
  • 记忆被证实错误且已保留替代版本。

遗忘是归档,不是物理删除;必须在回复中说明归档对象。

反思审批流程(工具化)

  1. 调用 memory_reflect 生成待审批反思草案(会写入 meta/pending-reflection.json|md)。
  2. reflectionId 与 token 申请摘要展示给用户,等待明确批准/减少/拒绝。
  3. 用户决策后调用 memory_reflect_commit
  • approved / reduced: 写入 meta/reflections/*meta/reflection-log.mdmeta/rewards/*meta/reward-log.md
  • rejected: 仅记录奖励决策到 rewards/reward-log,不生成正式 reflection。
  1. 未经用户审批,禁止直接落盘正式反思结果。

多代理治理

  • 所有子代理可以读记忆。
  • 只有主代理可以执行最终写入;子代理只产出候选内容。
  • 主代理在写入前必须做去重、冲突检查和来源标注。

与本地文件索引协同

对长流程任务,除 memory_* 外,还应写入 .agents/memory/.../index.json

  • progress:当前阶段与下一个动作。
  • artifacts:关键产物路径。
  • updatedAt:最后更新时间。

当用户说“继续”时:

  1. 先读 index.jsonprogress
  2. 再做 memory_search 交叉校验。
  3. 状态一致才继续执行;不一致直接报错并说明差异。
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. 8d ago First seen · 90 lines · 51 tokens per session scan A edc585187050

Subscribe to this mod's changes

cognitive-memory is a skill published in the GitHub repository anymouschina/TapCanvas (600 stars, last pushed 2d ago), licensed MIT. It adds 51 tokens to every session and 999 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

capabilities

Your capability catalog — read this at boot. Lists the temporal date-range skills and the external integrations (reached via the loopback broker) available to you as a spawned worker, and exactly how to call each. Read-only. Consult it whenever you're unsure what tools/integrations you have or how to invoke them.

chaitanyagiri/munder-difflin · 69 tokens

temporal

Resolve ANY named time window — today, yesterday, thisWeek, lastWeek, last7Days, last30Days, last90Days, thisMonth, lastMonth, thisQuarter, lastQuarter, thisYear, lastYear, last12Months — or an arbitrary range (lastNdays / lastNweeks / lastNmonths) to a concrete ISO date range relative to your run time. Read-only: no…

chaitanyagiri/munder-difflin · 114 tokens

md-audit

Read-only code quality audit — scan the current working directory for common issues (bugs, dead code, security hotspots, missing error handling) and return a prioritised findings report. No files are edited. Use when asked to "audit the code", "quick audit", "find issues", "code scan", or "what's wrong with this…

chaitanyagiri/munder-difflin · 85 tokens

last30Days

Resolve "last30Days" to a concrete ISO date range relative to your run time — a rolling 30-day window ending today. Returns inclusive civil dates plus exact UTC instants so you have temporal context without computing dates by hand. Read-only: no writes, no network. Use before a "last 30 days" / trailing-month task…

chaitanyagiri/munder-difflin · 83 tokens

thisQuarter

Resolve "thisQuarter" to a concrete ISO date range relative to your run time — this quarter so far (quarter start → today). Returns inclusive civil dates plus exact UTC instants so you have temporal context without computing dates by hand. Read-only: no writes, no network. Use before a quarter-to-date task (QTD…

chaitanyagiri/munder-difflin · 78 tokens

thisWeek

Resolve "thisWeek" to a concrete ISO date range relative to your run time — this week so far (Monday → today). Returns inclusive civil dates plus exact UTC instants so you have temporal context without computing dates by hand. Read-only: no writes, no network. Use before a week-to-date task (this week's activity…

chaitanyagiri/munder-difflin · 77 tokens