writing:compound

A writing-improvement command that studies a finished piece and records the patterns that made it work.

In plain words
What is it for?
Use it to extract effective hooks, structures, voice choices, transitions, templates, and patterns to avoid.
Why use it?
It turns lessons from past drafts and reviews into reusable guidance, so successful approaches are easier to repeat.

Command

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/robertguss/claude-code-toolkit/writing-compound
Clone the repo
git clone --depth 1 https://github.com/robertguss/claude-code-toolkit
Per session 14 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,676 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.00014 $0.01676
Opus 5 $0.00007 $0.00838
Sonnet 5 $0.00003 $0.00335
Haiku 4.5 $0.00001 $0.00168

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

Security

Grade A, and why

writing:compound 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.

plugins/compound-writing/commands/writing-compound.md · 323 lines

How it starts

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

Writing Compound Command

Turn this piece's successes into permanent improvements for future writing.

Input

<piece_path> #$ARGUMENTS </piece_path>

If "latest" is provided, find the most recent published/approved piece.

The Compound Philosophy

Each piece of writing should make the next piece easier to write.

This command extracts what worked and encodes it for reuse:

  • Hook formulas that grabbed attention
  • Structure patterns that flowed well
  • Voice elements that landed
  • Transitions that felt invisible

Workflow Overview

  1. Analyze what made this piece work
  2. Extract reusable patterns
  3. Update style documentation
  4. Create templates for similar pieces
  5. Log anti-patterns that were edited out

Phase 1: Success Analysis

Load the Piece and History

Read the final published version
Read all draft versions (v1, v2, etc.)
Read review reports
Identify:
- What changed between drafts
- What reviewers praised
- What the writer kept unchanged

Identify What Worked

Use AskUserQuestion:

What made this piece successful?
1. The hook grabbed attention
2. The structure was clear
3. The voice was consistent
4. The examples were concrete
5. Something else: [describe]

Allow multiple selections to understand success factors.

Phase 2: Extract Patterns

Hook Analysis

## Hook Extraction

**Opening text**:
> [First 50-100 words]

**Hook type**: [Story/Stat/Tension/Question/Surprise]

**Why it worked**:
- [Specific reason 1]
- [Specific reason 2]

**Formula abstracted**:
[General pattern that could be reused]

**Similar topics it could work for**:
- [Topic 1]
- [Topic 2]

Structure Analysis

## Structure Extraction

**Pattern used**: [Problem-Solution/Journey/Listicle/Story]

**Section breakdown**:
1. [Section type] - [purpose] - [word count]
2. [Section type] - [purpose] - [word count]
...

**What made this structure work**:
- [Insight 1]
- [Insight 2]

**Topics this structure fits**:
- [Topic type 1]
- [Topic type 2]

Read the full file on GitHub · 323 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. 2d ago First seen · 323 lines · 14 tokens per session scan A 8623d175a4c8

Subscribe to this mod's changes

writing:compound is a command published in the GitHub repository robertguss/claude-code-toolkit (108 stars, last pushed 24d ago), licensed MIT. It adds 14 tokens to every session and 1,676 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-30.