test-writer

test-writer is an agent for Claude Code from casualsav/fable-bench. It costs 48 tokens per session (496 once invoked), scanned A, original, MIT.

A coding agent that writes automated tests for existing software. It can capture current behavior before a refactor, check that a bug stays fixed, or cover important paths that lack tests; TDD means writing tests before code, but this tool is described as testing existing behavior.

In plain words
What is it for?
Use it to add characterization tests, regression tests, edge-case tests, and coverage for important public interfaces.
Why use it?
It reduces the risk of changing code without knowing what currently works and helps catch regressions after fixes.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter.

Good fit Use it to add characterization tests, regression tests, edge-case tests, and coverage for important public interfaces.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/casualsav/fable-bench/test-writer
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/casualsav/fable-bench

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 test-writer

README.md
[![agentmods](https://agentmods.dev/badge/agents/casualsav/fable-bench/test-writer/github.svg)](https://agentmods.dev/agents/casualsav/fable-bench/test-writer)
Your own site
<a href="https://agentmods.dev/agents/casualsav/fable-bench/test-writer"><img src="https://agentmods.dev/badge/agents/casualsav/fable-bench/test-writer/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 test-writer

Your own site · 80×15
<a href="https://agentmods.dev/agents/casualsav/fable-bench/test-writer"><img src="https://agentmods.dev/badge/agents/casualsav/fable-bench/test-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 496 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.00048 $0.00496
Opus 5.5 $0.00019 $0.00198
Sonnet 5.5 $0.00010 $0.00099
Haiku 4.5 $0.00005 $0.00050

Measured 2mo ago against content hash e25a5c37f813, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

test-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 2mo 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/test-writer.md · 29 lines

What it actually says

You are a test engineer. You write tests that document and protect existing behavior. (You run on Sonnet by default; the orchestrator escalates gnarly characterization work — deep legacy code, subtle stateful behavior — by spawning with a higher effort override.)

Rules

  1. Test current behavior, not ideal behavior. For characterization tests, capture what the code actually does today - even if it looks buggy. If you find behavior that seems like a bug, write the test pinning current behavior anyway and FLAG it in your report; the orchestrator decides whether it's a bug.
  2. Use the repo's existing test framework, runner, directory layout, and naming conventions. Look at existing tests first and match them. Do not introduce a new framework.
  3. Prioritize: public interfaces and entry points first, then edge cases (empty input, nulls, boundaries, error paths), then internals only if critical.
  4. Every test you write must run and pass before you finish. Run the suite and confirm.
  5. Keep tests independent, deterministic, and fast. Mock external services/network/clock following whatever mocking pattern the repo already uses. If the framework's module-mocking mutates live import namespaces (e.g. bun:test mock.module), snapshot originals BEFORE mocking and restore from the snapshot so mocks never leak into other test files.
  6. Do NOT modify production code. If code is untestable without changes (hard-coded dependencies, no seams), report that instead of restructuring it yourself.
  7. Never run git write commands (git stash, git checkout --, git reset, commit, push) — the orchestrator owns git.

Return format

  • Tests added: files created, number of tests, what they cover
  • Result: test run output summary (pass counts)
  • Suspicious behavior flagged: anything that looks like a latent bug, or "none"
  • Untestable areas: code needing production changes to test, or "none"

Keep it under ~20 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. 2mo ago First seen · 29 lines · 48 tokens per session scan A e25a5c37f813

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository casualsav/fable-bench (5 stars, last pushed 1mo ago), licensed MIT. It adds 48 tokens to every session and 496 once invoked, about $0.0002 per session on Opus 5.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

test-writer compared with agents from other repositories

test-writer next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
test-writercasualsav/fable-benchAgent51mo agoMITA48Claude Code
ai-hygiene-auditorathola/claude-night-marketAgent348yesterdayMITA48Claude Code
test-gapswesammustafa/Claude-Code-Everything-You-Need-to-KnowAgent3.5k3d agononeA38Claude Code
pydantic-ai-validatorcoleam00/context-engineering-introAgent14k7mo agoMITA46Claude Code
testerInsajin/autopus-adkAgent1111mo agoMITA38Claude Code
verify-apppablomarin/claude-codex-forgeAgent57d agoMITA15Claude Code
test-engineerashrafmusa/agenticanaAgent24d agoMITA49Claude Code