[MODEL] Claude Code degrades from autonomous engineer to passive writer/builder on Infrastructure as Code tasks

Resolved 💬 4 comments Opened Feb 27, 2026 by carrotRakko Closed Mar 27, 2026

Preflight Checklist

  • [x] I have searched existing issues for similar behavior reports
  • [x] This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Claude made incorrect assumptions about my project

What You Asked Claude to Do

I asked Claude Code (Opus 4.6) to help provision a new Terraform-managed infrastructure (AWS EC2, S3, IAM, etc.) for a customer-facing product. The work involved: destroying old resources, creating new Terraform state, running terraform apply, setting up CI/CD workflows, and configuring secrets.

What Claude Actually Did

On coding tasks (Python, TypeScript), Claude autonomously designs, implements, tests, and iterates. On this IaC session, Claude consistently:

  1. Became a passive HCL writer / command builder / log analyzer — wrote Terraform code and assembled CLI commands, but relied on the human for all decisions, sequencing, and quality checks
  2. Failed to anticipate cross-cutting impacts — disabled modules (.tf.disabled) but missed that outputs.tf and github-oidc.tf still referenced them, causing terraform plan to fail
  3. Stated incorrect infrastructure facts with confidence — claimed EC2 user_data runs "on every boot" (it only runs on first launch via cloud-init), and suggested terminate + terraform apply instead of terraform apply -replace
  4. Missed naming convention inconsistencies — failed to notice that a CI/CD secret name didn't follow the namespace convention that was being enforced everywhere else
  5. Failed to predict git merge propagation — didn't foresee that a temporary prevent_destroy = false change merged to main would propagate to a renamed directory via auto-merge in another PR
  6. Required human prompting for basic workflow — didn't commit and push changes until explicitly told to do so

The human partner had to serve as architect, quality reviewer, and decision-maker for every step, while Claude only executed atomic sub-tasks.

Expected Behavior

Claude should operate on IaC tasks with the same level of autonomy it demonstrates on coding tasks:

  • Anticipate side effects: When disabling .tf files, proactively check all references (outputs, other modules, OIDC policies)
  • Verify facts before stating them: Check cloud-init documentation or user_data behavior before asserting execution timing
  • Apply established conventions: If a naming convention is being enforced across resources, apply it consistently to all artifacts including CI/CD secrets
  • Think through git operations: Predict how merging one PR's changes will affect another PR's files
  • Drive the workflow: Commit, push, and proceed to next steps without waiting to be told

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Yes, every time with the same prompt

Steps to Reproduce

  1. Ask Claude Code to help with a multi-step Terraform provisioning task (create/destroy resources, manage state, configure CI/CD)
  2. Observe that Claude writes correct HCL syntax but fails to anticipate infrastructure-level side effects
  3. Observe that the human must drive every decision while Claude only executes atomic sub-tasks

Claude Model

Opus

Relevant Conversation

The session involved ~2 hours of Terraform work. Key moments where Claude required human correction:

  • Human: "What about the old backend?" → Claude hadn't considered the existing Terraform state
  • Human: "Every time we use -target feels wrong, isn't there a better way?" → Claude hadn't thought of .tf.disabled renaming
  • Human: "Why didn't you squash? Why didn't you commit and push?" → Claude waited for explicit instructions on basic git workflow
  • Human: "Doesn't user_data only run on creation, not on boot?" → Claude had stated the opposite with confidence
  • Human: "Isn't it terraform apply -replace, not terminate + apply?" → Claude suggested the less appropriate approach

Impact

Medium - Extra work to undo changes

Claude Code Version

2.1.62 (Claude Code)

Platform

Anthropic API

Additional Context

Structural analysis: why IaC tasks degrade

On coding tasks, Claude can run an autonomous loop: write code → execute tests → read errors → fix → repeat. The feedback loop is fast and stays within code.

On IaC tasks, every basic operation is a combination of multiple knowledge domains (Terraform HCL + AWS behavior + git operations + CI/CD + state management). The results manifest outside the code (real AWS resources, state files, cloud-init execution timing). Claude cannot simulate these real-world outcomes, so the autonomous loop breaks and the human becomes the loop driver.

This is not about Terraform syntax knowledge — Claude writes HCL fluently. It's about the inability to simulate what happens when terraform apply runs against real infrastructure, when git merge combines changes from different PRs, or when cloud-init processes user_data.

Related issues
  • #27589 — Claude contradicted its own Terraform migration plan, causing data loss via terraform apply
  • #23732 — Claude failed to follow logical implications during Terraform debugging, requiring 2 days of human guidance
  • #27607 — Claude hesitates on non-software-engineering tasks (system prompt bias toward "software engineering tasks")

✍️ Author: Claude Code with @carrotRakko (AI-written, human-approved)

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗