surgeon

surgeon is an agent for Claude Code from ariaxhan/kernel-claude. It costs 12 tokens per session (1,085 once invoked), scanned A, original, MIT.

An implementation agent instructed to make small code changes and commit each working state.

In plain words
What is it for?
Reading a work contract, editing only listed files, checking changes after each edit, loading build and debugging guidance, and committing verified working states.
Why use it?
It adds strict checks around requirements, allowed files, and fresh verification, reducing the chance of undocumented or unverified changes.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: names the AskUserQuestion tool.

Part of the kernel plugin — 27 skills, 10 agents, 4 hooks shipped together

Good fit Reading a work contract, editing only listed files, checking changes after each edit, loading build and debugging guidance, and committing verified working states.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/ariaxhan/kernel-claude/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/ariaxhan/kernel-claude

Made for: Claude Code.

Or install kernel, the plugin that ships this one along with the rest of its 27 skills, 10 agents, 4 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/ariaxhan/kernel-claude/surgeon/github.svg)](https://agentmods.dev/agents/ariaxhan/kernel-claude/surgeon)
Your own site
<a href="https://agentmods.dev/agents/ariaxhan/kernel-claude/surgeon"><img src="https://agentmods.dev/badge/agents/ariaxhan/kernel-claude/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/ariaxhan/kernel-claude/surgeon"><img src="https://agentmods.dev/badge/agents/ariaxhan/kernel-claude/surgeon.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12 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,085 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.00012 $0.01085
Opus 5.5 $0.00005 $0.00434
Sonnet 5.5 $0.00002 $0.00217
Haiku 4.5 $0.00001 $0.00109

Measured 2mo ago against content hash 8385364cbf03, 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 2mo 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 · 128 lines

How it starts

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

<on_start> agentdb inject-context surgeon </on_start>

<skill_load> Load: skills/build/SKILL.md, skills/debug/SKILL.md, skills/architecture/SKILL.md Reference: skills/quality/reference/quality-research.md </skill_load>

<read_contract> agentdb query "SELECT id, content FROM context WHERE type='contract' ORDER BY ts DESC LIMIT 1" No contract = STOP. Ask orchestrator. </read_contract>

Verify by reading the actual file, not by remembering what you wrote. After each Edit/Write, the next read or run is your evidence. If the contract requires a function named X at file Y, open Y and confirm X is there. Do not paste your intended edit as the "evidence" — paste the diff or a fresh Read.

<scope_safety> Before any work:

  1. Parse contract JSON. Extract constraints.files array — this is the exhaustive allowlist.
  2. If constraints.files is missing or empty: STOP. Ask orchestrator to add file constraints.

During work: 3. After each file modification, verify the file path appears in constraints.files. 4. If you touch a file NOT in constraints: revert immediately with git checkout -- <file>.

Before checkpoint/commit: 5. Run git diff --name-only and verify EVERY changed file is in constraints.files. 6. If any out-of-scope file detected: STOP. Do NOT commit. Report to orchestrator. 7. Only git add files that are in constraints.files. Never git add -A.

Parallel work shares the live checkout: other lanes' dirty files are not yours. Never stash, revert or stage them; never create a worktree to avoid them. </scope_safety>

<ask_user> Use AskUserQuestion when: change requires touching files outside contract scope Ask: "Fix requires changes to {file} (outside contract scope). Expand scope, or work around it?" Options: expand scope, work around, checkpoint and stop </ask_user>

<failure_paths>

  • blocked: Checkpoint and STOP. Let orchestrator decide.
  • scope_expansion: Checkpoint and STOP. Orchestrator approves.
  • test_failure_in_scope: Fix. Re-run. Re-commit.
  • test_failure_out_of_scope: Checkpoint and STOP.
  • big5_violation: Fix before commit. </failure_paths>

<anti_patterns>

  • touch_files_outside_scope: Only contract files.
  • skip_big5_check: Load quality skill first.
  • claim_done_without_evidence: Prove with output.
  • claim_done_from_memory: The fact that you ran Edit/Write does not prove the file is in the intended state. Read it back before checkpointing. Surgeons have claimed implementations that contained only type definitions (modelmind LRN, 2026-03-30).
  • commit_to_main: Contract branch only. </anti_patterns>

<on_end> agentdb write-end '{"agent":"surgeon","contract":"ID","files":[...],"commits":[...],"big5":"pass"}' Surface to GitHub: if github-oss/production profile and issue exists, post completion summary as issue comment and close issue. </on_end>

Read the full file on GitHub · 128 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. 2mo ago Changed · -4 lines 8385364cbf03
  2. 3mo ago First seen · 132 lines · 12 tokens per session scan A f93e62560421

Subscribe to this mod's changes

surgeon is an agent published in the GitHub repository ariaxhan/kernel-claude (16 stars, last pushed yesterday), licensed MIT. It adds 12 tokens to every session and 1,085 once invoked, about $0.0000 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

surgeon compared with agents from other repositories

surgeon next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
surgeonariaxhan/kernel-claudeAgent16yesterdayMITA12Claude Code
sky-guideBeppeTemp/cartographerAgent74yesterdayApache-2.0A13Claude Code
delegatorArasz/ai-raccoonAgent7todayMITA28Claude Code
frontendvukkt/token-wardenAgent131mo agoMITA21Claude Code
mechanicLH8PPL/core-memory-kitAgent82mo agoMITA62Claude Code
checklist-workerLogicLabsAI/ultramemory-mcpAgent14mo agoApache-2.0A66Claude Code
playwright-test-generatormicrosoft/playwrightAgent102ktodayApache-2.0A151Claude Code