
Terraform
Install and run Terraform commands from Claude Code: init, fmt, validate, plan, apply, destroy, import, taint, output and state. It talks to a Terraform MCP Server that runs terraform binaries, reads your HCL files and module folders, and returns plan JSON, stdout/stderr and exit codes. You can request a human-readable plan diff, ask for the resources affected, or fetch remote state and resource attributes without leaving your editor.
The plugin reads workspace and backend settings, accepts environment variables and var files, and runs targeted applies or refreshes. It can upload or download state snapshots, run show on a plan file, and parse plan details into resources to add comments or approvals. It also checks for formatting and validation errors and can run terraform fmt / validate as part of a pre-commit check you trigger from Claude Code.
Use it to generate a concise change summary, fetch outputs for downstream scripts, or run a safe plan then produce an approved apply command. It shows plan diffs and resource counts so reviewers see exactly what changes will occur.
Example: instead of switching to a shell to run terraform plan, open the module in Claude Code, ask for a plan and a list of tainted resources, then request apply after an approval—saving context switches when reviewing and applying PR-linked infrastructure changes.
Without this tool
- ✗AI writes Terraform without best practices
- ✗No infrastructure validation
- ✗Error-prone IaC generation
With this tool
- ✓AI generates validated Terraform code
- ✓Follows infrastructure best practices
- ✓Safer infrastructure automation