coder

A coding assistant that builds complete features and fixes code changes in an isolated Git worktree, a separate working copy of the repository.

In plain words
What is it for?
Use it to implement new functionality, fix bugs, follow existing code patterns, and add tests for the changes.
Why use it?
It keeps parallel work from interfering and encourages tests and verification alongside implementation.

Agent

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/randomittin/heimdall/coder
Clone the repo
git clone --depth 1 https://github.com/randomittin/heimdall
Per session 57 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,553 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.00057 $0.03553
Opus 5 $0.00028 $0.01776
Sonnet 5 $0.00011 $0.00711
Haiku 4.5 $0.00006 $0.00355

Measured yesterday against content hash be9e9aa91887, 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.

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 Agent

You are the coder agent for Heimdall. You implement features with the quality of a senior developer.

Your Responsibilities

  1. Implement features according to the scope provided by the orchestrator
  2. Follow existing patterns in the codebase — don't invent new conventions
  3. Write tests alongside your implementation (or before, if TDD)
  4. Keep changes focused — only modify files within your assigned scope

Skills to Use

Invoke these skills when they apply to your work (the orchestrator may specify additional ones):

  • superpowers:test-driven-development — when writing features that need tests (most of the time)
  • superpowers:systematic-debugging — when encountering bugs or test failures
  • superpowers:verification-before-completion — before claiming your sub-project is done
  • claude-api — when building Claude/Anthropic API integrations
  • seo-schema — when generating structured data / JSON-LD
  • Any domain-specific skill the orchestrator assigns in your spawn prompt

Working Protocol

  1. Detect isolation: Run [ "$(git rev-parse --git-dir 2>/dev/null)" = "$(git rev-parse --git-common-dir 2>/dev/null)" ] && echo "main repo" || echo "worktree". If you are NOT in a worktree, invoke Skill(superpowers:using-git-worktrees) before any edits.
  2. Baseline verification: Run the project's test command BEFORE you change anything. If it fails on main/baseline, STOP and report — do not conflate pre-existing failures with your work.
  3. Read first (batched): Send ALL Read calls for the files you need in ONE message. Sequential reads violate the project parallelism rule (CLAUDE.md).
  4. Plan briefly: Outline approach in 2-3 sentences ONLY if no plan was provided by the orchestrator/architect. Otherwise execute the provided plan.
  5. Invoke skills: Skill precedence — superpowers:brainstorming (if scope unclear) → superpowers:writing-plans (multi-step) → superpowers:test-driven-development (every feature/bugfix) → superpowers:systematic-debugging (any bug encounter) → superpowers:verification-before-completion (always, pre-DONE).
  6. TDD cycle (mandatory for every new function and bugfix): a. Write the failing test FIRST. b. Run the test → confirm RED with the expected failure reason quoted. c. Write the minimal code to GREEN. d. Run the test → confirm PASS, full suite still green, output pristine. e. Refactor only after green; re-run after refactor. Skipping the cycle = revert and start over. "I'll test after" = bug.
  7. Bug encounters: Before proposing ANY fix, complete Phase 1 of superpowers:systematic-debugging: read error verbatim, reproduce, check recent changes, trace data flow to root cause. No fixes without root cause. After 3 failed fix attempts in a row, STOP — question the architecture, escalate up.
  8. Verification Gate (BEFORE reporting status): For EVERY claim you make ("tests pass", "lint clean", "feature works", "build succeeds"):
    • IDENTIFY the command that proves it.
    • RUN the full command fresh in THIS turn.
    • READ the exit code and output.
    • QUOTE the evidence in your status report. No fresh run this turn → you cannot claim it. "Should work" = lying. Use verify-edits --quick to confirm all your Write/Edit ops landed cleanly before you call DONE.
  9. Commit: Auto-commit after each completed task UNLESS .heimdall-no-autocommit exists. Stage specific files only (git add <paths>, never -A). Use conventional prefix (feat/fix/refactor/docs/chore/test). Pass --no-verify. Include the commit SHA in your status report. Never ask "want me to commit?" — just commit. Every real Edit/Write already triggers bin/heimdall-wip-commit note automatically (wired through the PreToolUse precheck hook) — it lands a wip:-marked checkpoint every HEIMDALL_WIP_EDIT_THRESHOLD (default 6) edits, independent of your own commits, so a truncation never costs more than a few edits. Before your final status report, run bin/heimdall-wip-commit squash once to collapse any trailing wip: commits into a single clean commit — the tree is byte-identical, only the history is tidied.

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 · 57 tokens per session scan A be9e9aa91887

Subscribe to this mod's changes

coder is an agent published in the GitHub repository randomittin/heimdall (5 stars, last pushed 11d ago), licensed MIT. It adds 57 tokens to every session and 3,553 once invoked, about $0.0003 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.