infrastructure-drift-detection

infrastructure-drift-detection is a skill for Claude Code from skillmds/skillmd. It costs 19 tokens per session (2,583 once invoked), scanned A, original, MIT.

A guide to infrastructure drift: the difference between infrastructure declared in code and the infrastructure actually running. It explains common causes such as manual cloud-console changes, provider defaults, and autoscalers.

In plain words
What is it for?
Use it to investigate changed security groups, instance sizes, tags, keys, node counts, and other live infrastructure differences, then decide whether to encode or explicitly ignore them.
Why use it?
It helps teams find why infrastructure keeps differing from its approved configuration. This reduces surprises during reviews, updates, and deployments.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is run: ./scripts/report-drift.sh infra/${{ matrix.stack }}/prod/drift.tfplan.

Part of the cloud-devops plugin — 23 skills shipped together

Good fit Use it to investigate changed security groups, instance sizes, tags, keys, node counts, and other live infrastructure differences, then decide whether to encode or explicitly ignore them.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/skillmds/skillmd
agentmods
npx agentmods add skills/skillmds/skillmd/infrastructure-drift-detection

Made for: Claude Code.

Or install cloud-devops, the plugin that ships this one along with the rest of its 23 skills.

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 infrastructure-drift-detection

README.md
[![agentmods](https://agentmods.dev/badge/skills/skillmds/skillmd/infrastructure-drift-detection/github.svg)](https://agentmods.dev/skills/skillmds/skillmd/infrastructure-drift-detection)
Your own site
<a href="https://agentmods.dev/skills/skillmds/skillmd/infrastructure-drift-detection"><img src="https://agentmods.dev/badge/skills/skillmds/skillmd/infrastructure-drift-detection/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 infrastructure-drift-detection

Your own site · 80×15
<a href="https://agentmods.dev/skills/skillmds/skillmd/infrastructure-drift-detection"><img src="https://agentmods.dev/badge/skills/skillmds/skillmd/infrastructure-drift-detection.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,583 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.00019 $0.02583
Opus 5.5 $0.00008 $0.01033
Sonnet 5 $0.00004 $0.00517
Haiku 4.5 $0.00002 $0.00258

Measured 4d ago against content hash d81bf51e78cf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-23, from the pricing page.

Security

Grade A, and why

infrastructure-drift-detection 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 4d 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.

plugins/cloud-devops/skills/infrastructure-drift-detection/SKILL.md · 272 lines

How it starts

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

Infrastructure Drift Detection (Verbose)

Core Patterns

Where Drift Actually Comes From

Drift is the divergence between declared infrastructure and live infrastructure. Naming its sources matters because they call for different remedies.

Source Example Remedy
Emergency console change Security group widened during an incident Remove standing write access; codify after
Convenience console change "Just bumping the instance size" Same — plus a faster pipeline
Provider defaults Tags, ARNs, or KMS keys injected at create Codify the default, or ignore narrowly
Controllers and autoscalers desired_count, node group size Narrow ignore_changes
Out-of-band automation A Lambda that rotates a rule Bring it into code or exclude explicitly
Manual state surgery state rm after a botched apply Review process; import rather than remove

The dominant source, by a wide margin, is the first two. Someone with production console access fixes a real problem in ninety seconds and does not come back to write it down — because the incident is over and the fix is working.

What makes this expensive is the delay. The infrastructure is now correct and the code is now wrong, and nothing reports the discrepancy. Weeks later an unrelated pull request adds a tag; the plan includes a quiet ~ line narrowing that security group back to its declared value; the apply reproduces the original outage with no apparent cause. The eventual timeline reconstruction (see incident-timeline-creation) will show a deploy that "changed nothing relevant".

The Detection Mechanism

terraform plan refreshes state against the provider APIs and diffs. The flag that makes it automatable is -detailed-exitcode:

terraform init -input=false
terraform plan -detailed-exitcode -lock-timeout=5m -out=drift.tfplan
Exit code Meaning Job behaviour
0 No changes Success, no notification
1 Error — credentials, lock contention, API failure Page the platform team
2 Changes present Drift finding: report and route

Read the full file on GitHub · 272 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. 4d ago First seen · 272 lines · 19 tokens per session scan A d81bf51e78cf

Subscribe to this mod's changes

infrastructure-drift-detection is a skill published in the GitHub repository skillmds/skillmd (1 stars, last pushed yesterday), licensed MIT. It adds 19 tokens to every session and 2,583 once invoked, about $0.0001 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-09-19.

Related

Other skills, from other repositories

claw-admin

Claw system administration: service management, IM connections, logs, cron, and workspace diagnostics. Use when the user asks to manage claw services, connect/disconnect IM platforms, view logs, or perform system-wide operations.

x-cmd/x-cmd · 48 tokens

x-nets

Enhanced netstat module with cached data and structured output. View network connections, routing tables, and interface statistics in interactive or TSV/CSV formats. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.

x-cmd/x-cmd · 69 tokens

x-theme

Change terminal command line prompt theme. Globally manage the display style of all x-cmd interactive components. Supports multiple theme vendors: theme, starship, ohmyposh. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.

x-cmd/x-cmd · 74 tokens

x-arp

Display ARP cache table with MAC vendor lookup and suspicious entry detection. Supports CSV, TSV, and TUI output. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.

x-cmd/x-cmd · 64 tokens

x-osv

CLI for Google OSV database. Query vulnerabilities for packages, scan local projects for vulnerable dependencies. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill). Required Tool: Install osv-scanner for project scanning (see https://github.com/google/osv-scanner).

x-cmd/x-cmd · 72 tokens

x-uptime

Enhanced uptime with structured YAML output showing uptime, users, and 1/5/15-minute load averages. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.

x-cmd/x-cmd · 67 tokens