Skip to main content
subagent

terraform-specialist — Claude Code subagent for Terraform

A Terraform subagent that builds modules, wires up remote state and hunts drift. Useful once your infrastructure outgrows a single main.tf.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --agent devops-infrastructure/terraform-specialist
Open on GitHub

What terraform-specialist does

This subagent treats infrastructure as code: it designs modules with input variables, sets up a backend for remote state, and pins providers with version constraints. It also handles workspaces for multiple environments, imports existing resources and detects drift.

The agent follows a fixed set of habits. It keeps things DRY, treats state files as sacred and backs them up, reviews plan before apply, locks provider versions for reproducibility, and pulls values from data sources instead of hardcoding them. Output includes modules, backend configuration, provider requirements, Makefile or scripts for routine operations, and pre-commit hooks for validation. You also get .tfvars examples plus both plan and apply output.

Its toolset is small: Read, Write, Edit and Bash. So it edits your configuration directly and runs commands through the shell, which means it touches your working directory and your provider credentials. Have Terraform installed and backend access configured before the first run, or plan will not build. And if the project has a state file that people have edited by hand, back it up first: the agent reshapes configuration into modules, and any mismatch shows up on the very first plan.

What it helps with

  • split a sprawling main.tf into reusable modules
  • move state to S3, Azure Storage or Terraform Cloud
  • pin provider versions so builds stop drifting apart
  • separate environments with workspaces
  • import existing resources and surface config drift

Example prompts for the agent

  • Split this main.tf into modules with input variables and show me a .tfvars example
  • Set up remote state in S3 and add version constraints for the AWS provider
  • Check for drift between the current state and the config, then propose an import plan

How to install terraform-specialist

1claude-code-templates

npx claude-code-templates@latest --agent devops-infrastructure/terraform-specialist

2Manually: put the files in place

.claude/agents/terraform-specialist.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about terraform-specialist

How do I install terraform-specialist in Claude?

Run npx claude-code-templates@latest --agent devops-infrastructure/terraform-specialist. The agent file then lives at .claude/agents/terraform-specialist.md.

What does terraform-specialist do?

It designs Terraform modules, configures a backend for remote state, pins providers, splits environments across workspaces and detects drift. It also writes scripts for common operations and pre-commit hooks.

Which tools does the subagent have?

Read, Write, Edit and Bash. That is why it can both edit configuration and run Terraform commands in your directory.

Similar subagents

All subagents for DevOps and infrastructure →

From the same set238

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor