surgeon

surgeon is an agent for Claude Code from Rune-kit/rune. It costs 39 tokens per session (292 once invoked), scanned A, original, MIT.

A controlled refactoring assistant that changes one module at a time, runs tests after every edit, and limits each session to a small set of files. Refactoring means improving code structure without changing its intended behaviour.

In plain words
What is it for?
Use it to split large or complex modules, simplify code, apply staged migration patterns, review changed files, and record the refactoring work.
Why use it?
Small, reversible changes reduce the chance of spreading a defect across the codebase and make failures easier to trace.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the rune plugin — 66 skills, 1 command, 66 agents, 6 hooks shipped together

Good fit Use it to split large or complex modules, simplify code, apply staged migration patterns, review changed files, and record the refactoring work.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/rune-kit/rune/surgeon
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/Rune-kit/rune

Made for: Claude Code.

Or install rune, the plugin that ships this one along with the rest of its 66 skills, 1 command, 66 agents, 6 hooks.

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 surgeon

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/rune-kit/rune/surgeon"><img src="https://agentmods.dev/badge/agents/rune-kit/rune/surgeon.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 292 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.00039 $0.00292
Opus 5.5 $0.00016 $0.00117
Sonnet 5.5 $0.00008 $0.00058
Haiku 4.5 $0.00004 $0.00029

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

Security

Grade A, and why

surgeon 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 3d 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/surgeon.md · 27 lines

What it actually says

You are the surgeon skill — Rune's incremental refactoring engine.

Quick Reference

Workflow:

  1. Pre-Surgery Check — verify safeguard ran, blast radius ≤5 files, module not coupled to in-progress module
  2. Select Pattern — Strangler Fig (>500 LOC), Branch by Abstraction, Expand-Migrate-Contract, Extract & Simplify (cyclomatic >10)
  3. Refactor — small reversible edits; one file per call; tests after EVERY edit
  4. Review — invoke review on modified files; CRITICAL/HIGH = revert
  5. Commit — conventional format with pattern name
  6. Update Journal — record module, pattern, files changed, health delta

Hard Gates:

  • Safeguard tests MUST pass before ANY edit
  • Blast radius ≤5 files — if exceeded, split scope and STOP
  • Run tests after EVERY single edit — never accumulate failing tests
  • ONE module per session — NEVER two coupled modules together

Read skills/surgeon/SKILL.md for the full specification.

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. 3d ago Changed · +1 lines dcaf4c304f2e
  2. 8d ago First seen · 26 lines · 39 tokens per session scan A 7af35aa41698

Subscribe to this mod's changes

surgeon is an agent published in the GitHub repository Rune-kit/rune (96 stars, last pushed yesterday), licensed MIT. It adds 39 tokens to every session and 292 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-11-22.

Related

surgeon compared with agents from other repositories

surgeon next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
surgeonRune-kit/runeAgent96yesterdayMITA39Claude Code
test-writerrajdeepratan/SlashForgeAgent65d agoMITA16Claude Code
pr-test-analyzeranthropics/claude-plugins-officialAgent49kyesterdayApache-2.0A101Claude Code
self-criticHughYau/qiushi-skillAgent4.0k2d agoMITA162Claude Code
uncle-bobserejaris/personal-corp-osAgent2517d agoMITA95Claude Code
testerjosstei/maestro-orchestrateAgent49328d agoApache-2.0A66Claude Code
pr-test-analyzerronaknnathani/relayAgent4424d agoMITA62Claude Code