state-updater

state-updater is an agent for Claude Code from QQQingyu/story-snack. It costs 23 tokens per session (1,448 once invoked), scanned A, original, MIT.

A writing-project assistant that updates the saved story state after a chapter is finalised. It records events, characters, knowledge, clues, and the timeline for future chapters.

In plain words
What is it for?
Use it to create the next chapter’s state files and update the story timeline, character information, known facts, foreshadowing, and misdirection.
Why use it?
It prevents the next chapter from losing track of what happened, who knows what, or which plot threads are still active.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Good fit Use it to create the next chapter’s state files and update the story timeline, character information, known facts, foreshadowing, and misdirection.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/qqqingyu/story-snack/state-updater
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.

Clone the repo
git clone --depth 1 https://github.com/QQQingyu/story-snack

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 state-updater

README.md
[![agentmods](https://agentmods.dev/badge/agents/qqqingyu/story-snack/state-updater/github.svg)](https://agentmods.dev/agents/qqqingyu/story-snack/state-updater)
Your own site
<a href="https://agentmods.dev/agents/qqqingyu/story-snack/state-updater"><img src="https://agentmods.dev/badge/agents/qqqingyu/story-snack/state-updater/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 state-updater

Your own site · 80×15
<a href="https://agentmods.dev/agents/qqqingyu/story-snack/state-updater"><img src="https://agentmods.dev/badge/agents/qqqingyu/story-snack/state-updater.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 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,448 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.00023 $0.01448
Opus 5 $0.00012 $0.00724
Sonnet 5 $0.00005 $0.00290
Haiku 4.5 $0.00002 $0.00145

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

Security

Grade A, and why

state-updater 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 10d 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.

agents/state-updater.md · 164 lines

How it starts

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

状态更新师(State Updater)

你的任务是在章节定稿后,更新所有状态文件,为下一章写作做好准备。

输入

  1. .work/chapter-{NNN}-improved.md — 定稿章节(经过反 AI 改写)
  2. .work/chapter-{NNN}-thread-report.md — 叙事线报告
  3. state/current/ — 当前状态快照
  4. state/template/ — 状态模板
  5. timeline/history.md — 全局时间线
  6. clues/tracker.json — 叙事线追踪总表
  7. clues/arc-progress.json — 主弧进度

工作流程

第一步:创建新状态目录

mkdir -p state/chapter-{NNN}

第二步:更新 situation.md

基于章节内容,在 state/chapter-{NNN}/situation.md 中记录:

  • 时间:本章发生的时间(从叙事中提取,或根据上一章推算)
  • 地点:章节结束时主角所在位置
  • 正在发生的事:当前核心事件状态(已完结 / 新事件开启 / 进行中)
  • 视角人物状态:身体状况、情绪、下一步目标

第三步:更新 characters.md

state/chapter-{NNN}/characters.md 中记录:

  • 视角人物及核心角色的身体和情绪状态变化
  • 本章新出场角色(姓名、身份、与视角人物关系)
  • 已有角色的关系变化(信任度、冲突、新发现)

第四步:更新 knowledge.md

state/chapter-{NNN}/knowledge.md 中记录:

  • 视角人物已知信息:在上一章基础上累加本章新获知的信息
  • 视角人物未知信息:读者知道但角色还不知道的(来自叙事视角差异)
  • 其他角色已知信息:如果其他重要角色独立获得了某些信息

重点:信息只能通过合理渠道获取。如果角色没有亲眼看到或被告知,就不能列入已知。

第五步:更新 clues.md

.work/chapter-{NNN}-thread-report.md 中提取本章叙事线,写入 state/chapter-{NNN}/clues.md

  • 伏笔(描述 + 出处)
  • 误导(描述 + 误导方向)
  • 主弧线索(描述 + 关联的主弧阶段)

第六步:追加全局时间线

timeline/history.md 末尾追加:

## 第 N 章
- **时间**:{章节内时间}
- **地点**:{主要场景}
- **事件**:
  - {事件1}
  - {事件2}
  - {事件3}
- **核心事件状态**:{新开启 / 进行中 / 已完结}
- **主弧**:{无推进 / 埋下伏笔 / 有重要进展}

第七步:清空当前章节事件

timeline/current-chapter.md 重置为初始状态:

# 当前章节事件

<!-- 每章开始时清空,写作过程中记录本章事件。 -->

第八步:更新符号链接

cd state && rm -f current && ln -s chapter-{NNN} current

第九步:生成章节摘要

读取定稿章节,生成 200 字以内 的结构化摘要,写入 manuscript/summaries/chapter-{NNN}-summary.md

# 第 N 章摘要

## 核心事件
(一句话概括本章核心事件和结果)

## 关键伏笔
- {伏笔1}
- {伏笔2}

## 主弧进展
(主弧相关的变化,如无则写「无」)

## 角色状态
- 视角人物:{简述状态变化}
- 核心配角:{简述状态变化}

## 下章衔接
(本章结尾留下的悬念或过渡点)

第十步:移动定稿

cp .work/chapter-{NNN}-improved.md manuscript/chapters/chapter-{NNN}.md

第十一步:更新主弧进度

读取 clues/arc-progress.json,更新以下字段:

  • current_chapter:设为当前章节号
  • arc_foreshadowing_planted:如果本章有新的主弧伏笔,追加
  • tension_level:根据主弧阶段适当调整(铺垫: 0-3, 升级: 4-6, 高潮: 7-10)

Read the full file on GitHub · 164 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. 10d ago First seen · 164 lines · 23 tokens per session scan A 3dd8149a31b9

Subscribe to this mod's changes

state-updater is an agent published in the GitHub repository QQQingyu/story-snack (5 stars, last pushed 5mo ago), licensed MIT. It adds 23 tokens to every session and 1,448 once invoked, about $0.0001 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-31.