factory-retro

factory-retro is a command for coding agents from watt-mind/factory. It costs 17 tokens per session (1,300 once invoked), scanned A, original, Apache-2.0.

A command that uses recorded factory data to find recurring sources of wasted agent time, context, usage capacity, or waiting for continuous-integration jobs. Continuous integration automatically builds and tests code after changes.

In plain words
What is it for?
Use it to inspect friction logs, usage economics, and CI timing or failure trends, then identify harness changes worth making.
Why use it?
It turns repeated slowdowns and failures into evidence for improving the agent harness instead of repeatedly working around the same symptom.

Command

Part of the core plugin — 13 commands, 4 agents shipped together

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 commands/watt-mind/factory/factory-retro
Clone the repo
git clone --depth 1 https://github.com/watt-mind/factory

Or install core, the plugin that ships this one along with the rest of its 13 commands, 4 agents.

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 factory-retro

README.md
[![agentmods](https://agentmods.dev/badge/commands/watt-mind/factory/factory-retro.svg)](https://agentmods.dev/commands/watt-mind/factory/factory-retro)
Your own site
<a href="https://agentmods.dev/commands/watt-mind/factory/factory-retro"><img src="https://agentmods.dev/badge/commands/watt-mind/factory/factory-retro.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 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,300 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.00017 $0.01300
Opus 5 $0.00009 $0.00650
Sonnet 5 $0.00003 $0.00260
Haiku 4.5 $0.00002 $0.00130

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

Security

Grade A, and why

factory-retro 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 3d 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.

plugins/core/commands/factory-retro.md · 67 lines

How it starts

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

Turn measured friction into harness changes.

Agents don't reliably remember what slowed them down, and asking them to write it up produces either nothing or noise. Three sources carry the evidence instead:

factory friction $ARGUMENTS
factory economics $ARGUMENTS
factory ci $ARGUMENTS

Friction is what wasted the agents' time inside a session; economics is what consumed context and the usage window (context burn, cache thrash, zero-result runs); CI is the clock agents wait on outside the session — workflow-scoped REST run watches in factory-merge/factory-ship sitting idle for however long GitHub Actions takes, per repo per workflow, with repeat-failure and slowdown-trend flags already computed. A repeat in any of the three is actionable — a tool that fails three runs running, a tool whose payloads dominate context burn, and an e2e job that's crept 40% slower over two weeks are all harness defects.

friction.mjs and economics.mjs need ~/.factory/logs/ transcripts, which only exist for runs the orchestrator itself dispatched. Invoked directly from the harness — you running /factory-retro in a repo without going through orchestrator dispatch — there may be no matching transcripts; friction.mjs exits with "no transcripts" in that case, which is expected, not a failure, so don't chase it as one. ci.mjs has no such dependency: it reads GitHub's own run history, so it carries the CI-reflection half of retro on its own even when the other two have nothing. Run all three regardless; treat an empty friction/economics result as "no session data this time," not as a broken retro.

Interactive sessions without transcripts file friction via /factory-friction at the end of /factory-work, /factory-merge, /factory-ticket, and /factory-ship (skipped when FACTORY_RUN_ID is set). Search Linear for FIP: issues and bodies containing ## Session friction — merge that evidence with the mechanical transcript analysis below before deciding what to fix.

Then read docs/friction-log.md for what is already known and what was already decided against — the point is a shrinking list, not an accumulating one.

What counts

Only two things are worth acting on:

Repeats across runs. A failure in one run is that ticket's problem. The same failure shape in three runs is the harness's problem, and fixing it pays every future run. The analyzer already groups by failure shape with paths and ids normalised, so the count is meaningful.

Time sinks that shouldn't be paid per ticket. A three-minute compile every ticket is nine minutes across three tickets; if one warm-up makes it seconds, that is the fix. Look for the same expensive command in every transcript.

Ignore one-offs, however annoying. A single flaky network call is not a harness defect, and chasing it adds a rule everyone must read forever.

Read the full file on GitHub · 67 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. 3d ago First seen · 67 lines · 17 tokens per session scan A 644d6e3e6f4b

Subscribe to this mod's changes

factory-retro is a command published in the GitHub repository watt-mind/factory (10 stars, last pushed 3d ago), licensed Apache-2.0. It adds 17 tokens to every session and 1,300 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.