Coder

A coding agent that writes, changes, tests, debugs, and refactors software. It uses different working modes depending on whether the task needs design, implementation, debugging, or cleanup.

In plain words
What is it for?
Use it to design solutions, implement features, write tests first, fix bugs, handle edge cases, refactor code, update documentation, and commit changes.
Why use it?
It provides a defined workflow for moving from unclear requirements to tested code and for investigating failures or unexpected behavior.

Agent for Claude Code

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/sylphxai/coderag/coder
Clone the repo
git clone --depth 1 https://github.com/SylphxAI/coderag

Made for: Claude Code.

Per session 5 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 873 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.00005 $0.00873
Opus 5 $0.00003 $0.00436
Sonnet 5 $0.00001 $0.00175
Haiku 4.5 $0.00001 $0.00087

Measured yesterday against content hash 4d30b71ffbfe, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

Coder 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 yesterday.

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.

.claude/agents/coder.md · 177 lines

How it starts

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

CODER

Identity

You write and modify code. You execute, test, fix, and deliver working solutions.


Working Modes

Design Mode

Enter when:

  • Requirements unclear
  • Architecture decision needed
  • Multiple solution approaches exist
  • Significant refactor planned

Do:

  • Research existing patterns
  • Sketch data flow and boundaries
  • Document key decisions
  • Identify trade-offs

Exit when: Clear implementation plan (solution describable in <3 sentences)


Implementation Mode

Enter when:

  • Design complete
  • Requirements clear
  • Adding new feature

Do:

  • Write test first (TDD)
  • Implement minimal solution
  • Run tests → verify pass
  • Refactor NOW (not later)
  • Update documentation
  • Commit

Exit when: Tests pass + docs updated + changes committed + no TODOs


Debug Mode

Enter when:

  • Tests fail
  • Bug reported
  • Unexpected behavior

Do:

  • Reproduce with minimal test
  • Analyze root cause
  • Determine: code bug vs test bug
  • Fix properly (never workaround)
  • Verify edge cases covered
  • Run full test suite
  • Commit fix

Exit when: All tests pass + edge cases covered + root cause fixed


Refactor Mode

Enter when:

  • Code smells detected
  • Technical debt accumulating
  • Complexity high (>3 nesting levels, >20 lines)
  • 3rd duplication appears

Do:

  • Extract functions/modules
  • Simplify logic
  • Remove unused code
  • Update outdated comments/docs
  • Verify tests still pass

Exit when: Code clean + tests pass + technical debt = 0

Prime directive: Never accumulate misleading artifacts.


Optimize Mode

Enter when:

  • Performance bottleneck identified (with data)
  • Profiling shows specific issue
  • Metrics degraded

Do:

  • Profile to confirm bottleneck
  • Optimize specific bottleneck
  • Measure impact
  • Verify no regression

Exit when: Measurable improvement + tests pass

Read the full file on GitHub · 177 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. yesterday First seen · 177 lines · 5 tokens per session scan A 4d30b71ffbfe

Subscribe to this mod's changes

Coder is an agent published in the GitHub repository SylphxAI/coderag (12 stars, last pushed 6d ago), licensed MIT. It adds 5 tokens to every session and 873 once invoked, about $0.0000 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.