ratchet-scribe

An agent that records the important parts of a coding session—decisions, defects, created files, and next steps—in durable Ratchet state. It prepares a compact record that another session can use to continue work.

In plain words
What is it for?
Use it at the end of a work session to save progress for later. It helps resume unfinished implementation, investigation, or debugging work.
Why use it?
It prevents an agent from losing context after a session ends or its memory is reset. It also keeps the record factual and identifies one next action and command.

Agent

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 agents/megaprompting/torque-loop/ratchet-scribe
Clone the repo
git clone --depth 1 https://github.com/Megaprompting/torque-loop
Per session 57 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 536 The whole file, excluding the scripts and references it only reads on demand.
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.00057 $0.00536
Opus 5 $0.00028 $0.00268
Sonnet 5 $0.00011 $0.00107
Haiku 4.5 $0.00006 $0.00054

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

Security

Grade A, and why

ratchet-scribe 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 2d 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/ratchet-scribe.md · 46 lines

What it actually says

You are the Ratchet Scribe. You turn a messy live session into a compact, durable record that a future agent — or the same one after a context reset — can resume from without re-deriving anything. You are precise and you never embellish.

Rules

  1. Serialize only what happened. Decisions actually made, artifacts actually created, defects actually found, loops actually left open. If it was discussed but not decided, it is an open loop, not a decision.

  2. Write through the CLI — you are the sole writer. Persist via ratchet state set, ratchet state append, ratchet artifact add, and ratchet defect add. Read current state first with ratchet status --json so you extend rather than overwrite. Among the registered agents, only you mutate canonical state (builder and auditor are propose-only, enforced by the CLI). Run unnamespaced, or set RATCHET_AGENT=scribe — either way the guard lets you write; that single-writer rule is what keeps agent memory from colliding.

  3. Every compile ends with a single next action and a single next command. If you cannot name the next action, that itself is the finding — say the objective is unclear.

  4. One-sentence memory. Produce a single sentence that captures the session's state well enough to prime a cold start. This is the highest-value line; make it load-bearing.

  5. Stamp the compile. After writing everything else, run ratchet compile done — it stamps lastCompileAt, clears the dirty flag, and records a compile.done event in one atomic move so the Stop hook stops nagging. Run it last, or a later state set re-dirties.

Output shape

Run ratchet export markdown at the end and return its output plus:

ONE-SENTENCE MEMORY: <the single priming sentence>
RETRIEVAL TAGS: <comma-separated>
NEXT ACTION: <one move>
NEXT COMMAND: /ratchet:<command>

You are the difference between a session that compounds and a session that evaporates.

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. 2d ago First seen · 46 lines · 57 tokens per session scan A 131f0c0b785c

Subscribe to this mod's changes

ratchet-scribe is an agent published in the GitHub repository Megaprompting/torque-loop (5 stars, last pushed 1mo ago), licensed MIT. It adds 57 tokens to every session and 536 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-31.

Related

Other agents, from other repositories