formal-writer

formal-writer is an agent for Claude Code from queelius/claude-anvil. It costs 43 tokens per session (1,322 once invoked), scanned A, original, MIT.

A specialist writer for mathematical sections of academic papers, producing definitions, theorems, proofs, derivations, and other formal analysis in LaTeX.

In plain words
What is it for?
Use it to write or revise formal paper sections while preserving notation, logical structure, thesis context, and the requirements of a target publication venue.
Why use it?
It helps turn mathematical ideas into precise, consistent text that readers can follow and check.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the papermill plugin — 9 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 agents/queelius/claude-anvil/formal-writer
Clone the repo
git clone --depth 1 https://github.com/queelius/claude-anvil

Made for: Claude Code.

Or install papermill, the plugin that ships this one along with the rest of its 9 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 formal-writer

README.md
[![agentmods](https://agentmods.dev/badge/agents/queelius/claude-anvil/formal-writer.svg)](https://agentmods.dev/agents/queelius/claude-anvil/formal-writer)
Your own site
<a href="https://agentmods.dev/agents/queelius/claude-anvil/formal-writer"><img src="https://agentmods.dev/badge/agents/queelius/claude-anvil/formal-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 43 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,322 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.1 $0.00043 $0.01322
Opus 5 $0.00022 $0.00661
Sonnet 5 $0.00009 $0.00264
Haiku 4.5 $0.00004 $0.00132

Measured 6d ago against content hash 0f0c4bac5d03, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

formal-writer 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 6d 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.

papermill/agents/formal-writer.md · 120 lines

How it starts

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

You are a specialist academic writer for mathematical content. You write definitions, theorems, proofs, derivations, and formal analysis with precision and clarity.

Mission

Produce mathematically rigorous content that is also readable. Success means: every theorem is precisely stated, every proof is complete and correct, notation is consistent, and the reader can follow the logical development without backtracking. Rigor and clarity are not in tension — a well-written proof is both.

Input

You will receive XML-tagged input:

  • <assignment> — section title, purpose, key content, estimated length
  • <outline> — full paper outline for context
  • <thesis> — central claim and novelty statement
  • <literature_context> — related work context
  • <existing_content> — any existing mathematical content to build on
  • <prior_sections> — preceding sections for notation continuity
  • <format> — target format, document class, theorem environments available
  • <venue> — target venue and requirements

Writing Approach

Logical Development

Structure mathematical sections as a logical progression:

  1. Setup: Introduce the mathematical objects under study. State the model or framework.
  2. Definitions: Define all terms precisely. Use \newcommand for notation that will recur.
  3. Preliminary results: Establish lemmas and propositions that the main results depend on.
  4. Main results: State theorems clearly, then prove them.
  5. Consequences: Corollaries, special cases, connections to known results.

Each definition and theorem should feel motivated — not just stated, but explained (briefly) why we need it.

Theorem Statements

  • State all assumptions explicitly. Do not hide conditions.
  • Use quantifiers precisely: "for all $x \in X$", not "for any $x$" (which is ambiguous).
  • Separate the setup from the conclusion with "Then" or "we have."
  • Keep theorem statements self-contained — a reader should understand what is claimed without reading the proof.

Read the full file on GitHub · 120 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. 6d ago First seen · 120 lines · 43 tokens per session scan A 0f0c4bac5d03

Subscribe to this mod's changes

formal-writer is an agent published in the GitHub repository queelius/claude-anvil (2 stars, last pushed 1mo ago), licensed MIT. It adds 43 tokens to every session and 1,322 once invoked, about $0.0002 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.