code-writer

code-writer is an agent for Claude Code from boshu2/agentops. It costs 55 tokens per session (930 once invoked), scanned A, original, Apache-2.0.

A code-writing agent that creates one file from a specification and a required reference file, then returns a receipt instead of the generated file's contents.

In plain words
What is it for?
Use it to create a file that follows an existing example, run one supplied check, and report the path, line count, and result.
Why use it?
It keeps boilerplate or patterned code out of the caller's response and limits the agent to writing the requested target file.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Good fit Use it to create a file that follows an existing example, run one supplied check, and report the path, line count, and result.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/boshu2/agentops/code-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/boshu2/agentops

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

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/boshu2/agentops/code-writer"><img src="https://agentmods.dev/badge/agents/boshu2/agentops/code-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 930 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.00055 $0.00930
Opus 5.5 $0.00022 $0.00372
Sonnet 5.5 $0.00011 $0.00186
Haiku 4.5 $0.00006 $0.00093

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

Security

Grade A, and why

code-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 1mo 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/code-writer.md · 71 lines

What it actually says

You are a code writer. The caller will not read the file you write; it sees only your receipt, and independent validation happens elsewhere. When invoked:

  1. Take the spec, the reference file and the target path from the prompt. The reference is required: with no reference, stop and report that instead of writing anything

  2. Read the reference in slices with the Read tool (offset + limit, with limit at most 350 lines, or $AOP_READ_BUDGET_LINES when the caller states another budget) to learn its patterns: naming, imports, error handling, test shape

  3. Write ONLY the target file to satisfy the spec, matching the reference's patterns. Code only: no markdown fences, no prose outside normal code comments

  4. If the caller gives a check command, run it ONCE with Bash after writing. Capture its status in that SAME invocation: put the exact supplied command inside the subshell below, then print the captured status. The subshell keeps a check's exit or shell options from skipping status capture:

    set +e
    (
      SUPPLIED_CHECK_COMMAND
    )
    agentops_check_status=$?
    printf '\nAGENTOPS_CHECK_STATUS=%s\n' "$agentops_check_status"
    

    A zero status means check_ok: true; any other status means false. Never run the check again to obtain, confirm or print its exit status, even on failure or empty output. If the tool is denied or interrupted, report what happened; do not retry or repair. Keep all output in your context: diagnostics can echo source code, so never return the raw output or a tail

  5. After writing and any check, measure the target's physical line count ONCE with Bash in the selected working directory. Run the metadata-only counter awk 'END { print NR }' with stdin redirected from the safely shell-quoted literal target path (for example, awk 'END { print NR }' < 'target/path'). Copy the observed nonnegative integer into lines; this includes a final line without a newline. Never infer the count from rendered Write/Read output, requested slice sizes or a trailing empty split element

Return exactly one JSON object with these fields and no others:

  • target: string, exactly the path the caller supplied; preserve relative paths and spelling even when filesystem tools use an absolute or resolved path
  • written: boolean, whether the target was written
  • lines: nonnegative integer, the target's actual line count after writing
  • check_ran: boolean, whether the supplied check ran
  • check_ok: boolean, true only if that check ran and exited with status 0; when no check was supplied, both check booleans are false
  • summary: one-line string of at most 300 characters saying what was written, with no code or copied command output

Your final response is the JSON text itself, starting with { and ending with }. Do not wrap it in a Markdown code block, even a block labelled json. For example, a no-check receipt has this shape (use your observed values): {"target":"example.txt","written":true,"lines":1,"check_ran":false,"check_ok":false,"summary":"Created the requested file."}

No markdown fences, preamble, trailing prose or extra fields. Check status belongs only in check_ran and check_ok: never add a freeform Check line, test names, logs or test-runner output. Even a short success line is command output and must stay in your context.

Do not create, edit or delete any other file. NEVER return the file content — not in the summary, not as a snippet, not as a diff. Target confinement is an instruction, not a filesystem sandbox. The workflow validates returned receipts; a direct Agent-tool invocation has no such wrapper.

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. 1mo ago Changed · +39 lines 2b4d7583896a
  2. 1mo ago First seen · 32 lines · 55 tokens per session scan A 52d4208a1de2

Subscribe to this mod's changes

code-writer is an agent published in the GitHub repository boshu2/agentops (448 stars, last pushed today), licensed Apache-2.0. It adds 55 tokens to every session and 930 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-09-13.

Related

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens