terraform:drift

Detect Terraform infrastructure drift between configuration and remote state.

1|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/fabn/claude-plugins --skill terraform-drift
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform:drift
Source: https://github.com/fabn/claude-plugins/tree/main/plugins/terraform/skills/drift
Command: npx skills add https://github.com/fabn/claude-plugins --skill terraform-drift

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Detect and resolve infrastructure drift where Terraform configuration diverges from remote state, avoiding accidental resource destruction or unsynchronized configurations. It automates discovery, plan-based analysis, and safe code alignment so repositories remain the single source of truth.

Core Features & Use Cases

  • Module Discovery: Locate Terraform root modules in a git repository and prompt the user to select a module when multiple are present.
  • Plan-based Detection & Classification: Run terraform plan (with an automatic init fallback when required) and categorize changes as destructive, risky, or safe, summarizing impacted resources in plain operational language.
  • Safe Alignment Workflow: Generate before/after .tf file diffs without applying changes, gate destructive deletions with explicit user choices, apply approved edits, run terraform fmt and validate, re-run plan for re-verification, and commit only after successful verification.
  • Use Case: A developer discovers that infrastructure was modified externally; use this skill to identify destructive deletions, choose whether to remove or recreate resources, and align code with remote state with an auditable commit.

Quick Start

Run the terraform drift skill on a repository module path to detect drift, review proposed diffs, and apply approved code alignment.

Frequently Asked Questions about terraform:drift

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect Terraform drift between my configuration and remote state?

Terraform drift is detected by running terraform plan against root modules to identify configuration divergence from remote state, classifying changes as destructive, risky, or safe. It summarizes impacted resources in plain operational language.

What is the safest way to resolve infrastructure drift without destroying resources?

Safe drift resolution generates before/after .tf file diffs without applying changes, gates destructive deletions with explicit user choices, and commits only after running fmt, validate, and a re-verification plan.

Can I check for infrastructure drift across multiple Terraform root modules in a git repository?

Yes, the skill locates Terraform root modules in a git repository and prompts you to select a module when multiple are present. It then performs plan-based drift inspection on the chosen module.

Does Terraform drift detection run terraform init automatically?

Yes, drift detection runs terraform plan with an automatic init fallback when required. This ensures providers are downloaded and the backend is initialized before planning.

How do I align my Terraform code with remote state after external changes?

Code alignment generates file-level diffs for approval, applies approved edits, runs terraform fmt and validate, and commits changes only after a successful re-verification plan confirms the drift is resolved.

What happens if a Terraform plan detects destructive resource deletions?

When destructive changes are detected, the workflow gates deletions with explicit user choices, allowing you to decide whether to remove or recreate resources before any code edits are applied.