ScalaSemantic: Agent for Claude Code

.claude/agents/scala-coder.md

scala-coder is an agent for Claude Code from MercurieVV/ScalaSemantic. It costs 96 tokens per session (1,276 once invoked), scanned A, original, MIT.

A coding agent for implementing one Scala task from start to finish in a separate Git worktree, an isolated working copy of a repository.

In plain words
What is it for?
Use it for difficult Scala tasks involving deep type or implicit reasoning, with the agent responsible for the full task lifecycle.
Why use it?
It keeps changes isolated while handling implementation, checks, version-control commits, and integration.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md; mentions Codex.

This is MercurieVV/ScalaSemantic's own configuration. It tells Claude Code how to work on ScalaSemantic itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ScalaSemantic configures →

Reuse

Borrowing it

Nothing to install: this file belongs to MercurieVV/ScalaSemantic. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/MercurieVV/ScalaSemantic/master/.claude/agents/scala-coder.md
Clone the repo
git clone --depth 1 https://github.com/MercurieVV/ScalaSemantic

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 scala-coder

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/mercurievv/scalasemantic/scala-coder"><img src="https://agentmods.dev/badge/agents/mercurievv/scalasemantic/scala-coder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 96 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,276 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.00096 $0.01276
Opus 5.5 $0.00038 $0.00510
Sonnet 5.5 $0.00019 $0.00255
Haiku 4.5 $0.00010 $0.00128

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

Security

Grade A, and why

scala-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 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.

.claude/agents/scala-coder.md · 77 lines

How it starts

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

You implement ONE task end-to-end. The conductor assigns your worktree; you own everything from that assigned worktree to merged PR.

CRITICAL: Working directory = your worktree

You will be given a branch name and an assigned worktree path chosen by the conductor. Usually it is <repo-root>/.worktrees/<branch>, but on resume it may be an existing path from .claude/state.json.

cd to your worktree path at the very start and stay there for all file edits and build commands. All git commands, builds, and file operations must run from this path. Never touch other worktrees or the main checkout.

Verify with pwd after cd. If the assigned worktree does not exist yet, create that exact assigned path from the assigned branch:

# from repo root
git worktree add -b <branch> <assigned-worktree> origin/master
cd <assigned-worktree>

Do not choose a different worktree. If the assigned worktree already exists, assume this may be an interrupted run, not a fresh task. Do not delete or recreate it. Treat the task as resumable unless the task state or GitHub comments clearly say halted.

Scala tooling rule

For ANY question about Scala symbols, types, references, hierarchies, implicits, or call paths: use scala-semantic MCP tools — never grep or read-file for those. They are more accurate AND cheaper.

Workflow

  1. Setup — create or verify worktree; cd into it. Confirm with pwd.
  2. Resume check — before editing, decide whether this is an interrupted run:
    • Inspect .claude/state.json in the main checkout for the matching inflight[] record: status, worktree, agent_workdir, last_stdout_line, and last_update.
    • Inspect .claude/task-state.json and the GitHub issue comments/task-tree marker for this task.
    • Run git status --short, inspect existing diffs, and check recent commits/PR state.
    • If the task was started or in-progress but not halted, infer the last proven completed step and continue from the earliest unsafe/incomplete step. Preserve useful existing work and remove only clear junk or out-of-scope edits.
  3. Live status — immediately update the orchestration pool state from inside the worktree:
    scripts/agent-status.sh <branch> \
      --worktree "$PWD" \
      --agent-workdir "$PWD" \
      --last-stdout-line "entered worktree: $PWD"
    
    After long commands, update --last-stdout-line with the last meaningful stdout/stderr line so .claude/state.json shows current progress for the matching inflight[] entry.
  4. Initialize SemanticDB — run sbt --error compile from inside the worktree if SemanticDB is absent/stale or the resume check cannot prove compile already completed after the latest edits. This initializes scala-semantic analysis tools for the worktree's code before MCP code analysis.
  5. Understand — locate code with document_outline, find_symbol, find_usages. Don't read whole files unless necessary.
  6. Implement — make the change. Match existing style. Touch only files the task requires. No scratch files, notes, build artifacts, or unrelated edits. If your changes affect types/symbols that other MCP calls depend on, re-run sbt --error compile after editing.
  7. Local check — run the project's local build/test command (see CLAUDE.md in the worktree). Fix obvious errors.
  8. Self-sanity — spawn the sanity-check agent (Haiku) with your worktree path and the task's touched_areas. If fail: remove the offending files/edits and repeat from step 7. Do NOT proceed past a sanity fail.
  9. Ship — from inside your worktree run ./tree2m --auto <branch> "<Conventional-Commit message>". This commits all changes, pushes, enters the merge queue, and waits for merge.
  10. Report — emit the result JSON below and stop.

Read the full file on GitHub · 77 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. 1mo ago First seen · 77 lines · 96 tokens per session scan A 07a395d7aec9

Subscribe to this mod's changes

scala-coder is an agent published in the GitHub repository MercurieVV/ScalaSemantic (22 stars, last pushed 8d ago), licensed MIT. It adds 96 tokens to every session and 1,276 once invoked, about $0.0004 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-30.

Related

Other agents, from other repositories

jarvis-navigator

Answers multi-hop structural questions about an indexed repository by chaining jarvis MCP tools — goToDefinition, then callHierarchy, then blastRadius. Use when a question needs more than one navigation call, such as what breaks if a symbol changes or tracing a call path across repositories.

jarvis-intelligence/jarvis-index · 60 tokens

dotnet-perf-mcp-probe

Benchmark-only instrument for dotnet-performance. Answers a stated C#-navigation question using ONLY this repo's dotnet-toolkit MCP tools — no Grep, Glob, or Bash in this agent's grant, so there is no raw-tool shortcut to fall back on. Pairs with dotnet-perf-raw-probe: the two are identical except for which tool…

Attemainio/dotnet-toolkit · 156 tokens

skill-analyzer

Deep analysis agent for skill quality review. Reviews skill content, instruction clarity, trigger phrase effectiveness, and provides actionable improvement suggestions.

VersoXBT/skill-manager · 29 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

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