StepGleam logoStepGleam
Coding guide

Teach Claude Code a security-response skill with live-write guards

Write a Claude Code skill that inventories your estate from GitHub, fans out exposure/mitigation/patch/rollout agents, labels every claim verified/read/assumed, proves fixes in capped containers, and blocks live writes behind a PreToolUse ask hook.

~75 minAdvanced 88/100 6 steps Updated Oct 31, 2026
Claude CodeGitHub CLI (gh)Docker
Teach Claude Code a security-response skill with live-write guards — illustration for this Coding guide

Tools used

  • Claude CodeOrchestrator session, skills, subagents, PreToolUse hooks
  • GitHub CLI (gh)Sweeps non-archived repos via gh search code for lockfiles and Dockerfiles
  • DockerThrowaway containers where Babker proves mitigations before trusting them
Step navigator0/6 done
0 of 6 steps done
What you'll get

A security-response skill directory (inventory, four briefs, report template, live-guard hook) that produces a go/no-go SECURITY_RESPONSE.md per target without unsupervised production writes.

Who this is for

Teams that already use Claude Code and face multi-app security advisories across mixed hosting.

Read this first

Before you start

Michael Babker (Happy Dog lead engineer, 28 Oct 2026) turned agency security-release day into a Claude Code skill after a session once changed a live edge policy without asking. He has run it twice: a PHP RCE replay and a same-day Symfony security release across four maintained branches. This guide follows his post. Exact full SKILL.md and brief files are unpublished, so those stay gaps — the shape, dispatch prompt, hook JSON, and lessons he names are what we keep.

Step-by-step instructions

Step 1 of 6 · Coding

Capture the incident that made the skill necessary

Babker's spark: on the PHP multipart RCE response (CVE-2026-109618 / 109619), Claude Code helped — except "at one point a session changed a live edge security policy without asking first." Nothing broke; he still treated an unsupervised production write as a second incident. The skill's center is that rule: agents may read everything; they may not change live systems without a per-step human approval.

Teach Claude Code a security-response skill with live-write guards — guide thumbnail
Why this step

Without a named failure mode, the skill becomes generic advice.

Step 2 of 6 · Coding

Scaffold the skill: inventory, four briefs, report template, guard hook

His skill directory holds SKILL.md, an estate inventory, four briefs (exposure mapper, mitigation engineer, patch builder, rollout planner), a report template, and a guard hook. The main session orchestrates only: it does not investigate itself; it hands work out, merges results, holds approvals, and owns commits. Exact file contents are unpublished — recreate the shape from his description.

Why this step

Four parallel questions keep one agent from inventing the whole response.

Step 3 of 6 · Coding

Start every response outside the repos: ID, workspace, single advisory.md

Every run: orchestrator gets an ID and a workspace in his home directory, deliberately outside every repository, because a map of exposures does not belong in VCS. It reads the advisory once and writes one advisory.md (affected/fixed versions, vector, upstream commits, vendor mitigations, confidence). Four agents must not work from four slightly different readings.

Why this step

One shared advisory file is what makes the four reports mergeable.

Step 4 of 6 · Coding

Dispatch the three parallel agents with a short prompt that points at files

His dispatch prompt is intentionally short — it points at files instead of retyping them:

Copy-ready promptClaude Code
Response <id>, workspace <dir>. Read ~/.claude/skills/security-response/briefs/_common.md, then ~/.claude/skills/security-response/briefs/<brief>.md, and follow both. Scope: <the targets and components in play, plus anything already known or ruled out>.
Why this step

Long pasted prompts drift; file-backed briefs stay versioned with the skill.

Step 5 of 6 · Coding

Treat GitHub as the estate source of truth and label every claim

Inventory is a baseline, not truth. The skill sweeps the GitHub org's non-archived repos with gh search code over lockfiles, Dockerfiles, and CMS version files. Unplaced hits get hosting inferred from deploy workflows / vercel.json / Railway config — or marked "hosting unknown", never dropped. Every claim is labeled Verified (command + output saved), Read (cited file/page), or Assumed (with why). A target whose exposure is all assumed is reported unknown, not safe.

Why this step

His PHP run found two containers the inventory had missed plus ~a dozen unmapped hosts.

Step 6 of 6 · Coding

Prove mitigations in capped containers; block live writes with PreToolUse ask

Mitigation engineer derives candidates from the upstream fix, proves each in a throwaway container (vulnerable reproduces → mitigation blocks → business traffic still works), and keeps a "Doesn't help" section. After two agents froze his ARM Mac under unbounded x86 builds (~960% CPU), shared briefs now cap CPU/memory, fix -j3, one build at a time, prefer ARM images. Live rule: nothing changes staging/production/policy/registry/remote branch until he approves that exact step. Backstop: global PreToolUse hook running live-guard.py that returns ask on kubectl apply, gcloud … update, ssh, git push, registry push, Railway deploy, non-localhost HTTP writes — never deny, biased to ask. Skill frontmatter registration failed inside subagents; he moved it to global settings and confirmed with a harmless matching command.

Why this step

Container proof plus an ask-hook is how he keeps tireless reading without a second incident.

End of guide · Reviewed Oct 31, 2026

Pro tips2
  • Label every claim verified, read, or assumed; never merge an assumed exposure as safe.
  • Register the live-guard PreToolUse hook in global settings — Babker found skill frontmatter hooks never fired inside subagents.
Common mistakes2
  • Letting the agent change staging or production after a vague "go ahead with the plan" — approvals do not carry across steps or targets.
  • Running unbounded x86 containers under ARM emulation; two of his agents hit ~960% CPU and froze the laptop until briefs capped CPU/memory and compile -j3.
FAQ2
Is this the same as a generic checklist skill?
No. The checklist skill turns a repeated procedure into SKILL.md. This one is a multi-agent security response with evidence labels, container proof, and a live-write ask hook.
Do subagents get approval power?
Babker: subagents hold no approvals. They read freely and write exact commands into the rollout plan, then stop.