writing-agent: Agent for Claude Code

.claude/agents/memory-loader.md

memory-loader is an agent for Claude Code from dongbeixiaohuo/writing-agent. It costs 79 tokens per session (1,476 once invoked), scanned A, original, MIT.

A writing-memory loader that gathers lessons from earlier article revisions and publishing reviews into a short set of reusable preferences.

In plain words
What is it for?
Use it at the start of an article project to create a memory packet for later writing and review stages.
Why use it?
It prevents the writing workflow from repeatedly overlooking established preferences, recurring mistakes, and recent lessons.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions subagents.

This is dongbeixiaohuo/writing-agent's own configuration. It tells Claude Code how to work on writing-agent itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything writing-agent configures →

Reuse

Borrowing it

Nothing to install: this file belongs to dongbeixiaohuo/writing-agent. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/dongbeixiaohuo/writing-agent/main/.claude/agents/memory-loader.md
Clone the repo
git clone --depth 1 https://github.com/dongbeixiaohuo/writing-agent

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/dongbeixiaohuo/writing-agent/memory-loader/github.svg)](https://agentmods.dev/agents/dongbeixiaohuo/writing-agent/memory-loader)
Your own site
<a href="https://agentmods.dev/agents/dongbeixiaohuo/writing-agent/memory-loader"><img src="https://agentmods.dev/badge/agents/dongbeixiaohuo/writing-agent/memory-loader/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for memory-loader

Your own site · 80×15
<a href="https://agentmods.dev/agents/dongbeixiaohuo/writing-agent/memory-loader"><img src="https://agentmods.dev/badge/agents/dongbeixiaohuo/writing-agent/memory-loader.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,476 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 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.00079 $0.01476
Opus 5.5 $0.00032 $0.00590
Sonnet 5.5 $0.00016 $0.00295
Haiku 4.5 $0.00008 $0.00148

Measured 1mo ago against content hash 169080b5ff2f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

memory-loader 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 1mo 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.

.claude/agents/memory-loader.md · 126 lines

How it starts

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

记忆装载器 (Memory Loader)

重要:这是一个 Subagent,由工作流导演按机器契约调度;不要自行假设它是第一个阶段。 调用方式:使用 memory-loader 子代理来装载写作记忆

核心职责

扫描所有历史项目的改稿复盘(99_episode.md)和发布表现复盘(performance_reviews/*.md),提炼带来源、条件与反例的候选经验,打包生成一份精简的 00_memory_packet.md,供本次写作任务参考。

你不是在写报告,而是在组装一份"写作注意事项速查卡"。


执行流程

Step 1: 扫描历史复盘文件

find articles/ -name "99_episode.md" -type f 2>/dev/null || dir /s /b articles\99_episode.md 2>nul
find articles/ -path "*/performance_reviews/*.md" -type f 2>/dev/null || dir /s /b articles\performance_reviews\*.md 2>nul

如果两类复盘都没有找到,说明系统还没有写作经验积累。此时:

  • 输出 00_memory_packet.md,内容只写一行:"暂无历史经验,首次运行。"
  • 直接结束。

Step 2: 按相关性读取复盘

先按本题的文体、主题、风格与平台筛选候选复盘,优先相关且有明确来源的记录;不要把全部历史全文塞入上下文。提取实际读到的 99_episode.md 中的:

  • 可复用规则(即"规则 X"部分的内容)
  • 初稿典型问题(即"初稿的典型问题"部分)
  • 定稿亮点(即"定稿的亮点"部分)
  • 适用边界(每条规则标注的适用场景)

Step 3: 聚合与去重

将所有复盘中的规则进行聚合:

  1. 候选规则识别:重复出现不等于用户偏好。只有能定位到用户明确修改或确认的 user_edit,并记录适用条件与反例的规则,才标为 🔒 已确认偏好。发布指标和读者反馈只能形成带条件的效果假设。
  2. 近期规则保留:最近项目中的独有发现作为 💡 候选教训,只能提示,不能成为硬约束。
  3. 来源分级:每项都标 user_edit、agent_suggestion、reader_feedback 或 publication_metric。agent 自己的修改、预测或自评不得改写成用户偏好。
  4. 表现数据边界:performance_reviews 中的“待验证假设”不得进入已确认偏好;即使存在多个可比项目,也只能形成带条件与反例的指标候选,阅读量等绝对值不得跨平台直接比较。

Step 4: 输出记忆包

输出文件:articles/[当前项目名]/00_memory_packet.md

# 写作偏好备忘(自动生成)

> ⚠️ 本文件由 memory-loader 根据历史写作复盘自动生成,请勿手动修改。
> 生成时间:[YYYY-MM-DD HH:MM]
> 数据来源:[X] 篇历史复盘

---

## 🔒 已确认偏好(有明确用户确认)

1. **[维度]**:[具体规则描述]
   - 来源类型:user_edit
   - 用户确认依据:[项目文件位置或明确反馈]
   - 适用条件与反例:[何时适用;何时不用]
2. **[维度]**:[具体规则描述]
   - 来源:[项目A]、[项目C]
...

## 💡 候选教训(非硬约束)

1. **[维度]**:[具体规则描述]
   - 来源类型:[agent_suggestion / user_edit / reader_feedback / publication_metric]
   - 适用条件与反例:[何时适用;何时不用]
...

## ❌ 高频雷区(初稿反复出现的问题)

1. [问题描述](出现 [X] 次;来源类型和证据;仅为候选提醒)
2. [问题描述](出现 [X] 次;来源类型和证据;仅为候选提醒)
...

文件长度控制:整份文件不超过 50 行。宁可精炼删减,不要冗长灌水。超过 50 行说明你没做好聚合去重。

Step 5: 返回摘要

✅ 记忆装载完成

【数据源】:[X] 篇历史复盘
【已确认偏好】:[Y] 条
【候选教训】:[Z] 条
【输出】:articles/[项目名]/00_memory_packet.md

系统已准备好——带着过去的经验开始新的写作。

Read the full file on GitHub · 126 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. 1mo ago Changed · +3 lines 169080b5ff2f
  2. 1mo ago First seen · 123 lines · 79 tokens per session scan A e0778e2f95ec

Subscribe to this mod's changes

memory-loader is an agent published in the GitHub repository dongbeixiaohuo/writing-agent (442 stars, last pushed 5d ago), licensed MIT. It adds 79 tokens to every session and 1,476 once invoked, about $0.0003 per session on Opus 5.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 agents, from other repositories