Skip to content

Tear down with destroy

destroy tears down everything the workspace’s state holds, dependents first, in one round. It never touches your files. Turf™ stops at the approval point with the plan, and the agent never approves a destroy plan itself: it asks you, and waits for an explicit yes.

✦Your agentin Claude Code
You
Tear down kind-crd.
Agent
  • init
  • open
  • destroy→awaiting_plan
  • plan→awaiting_approval

Plan: 3 to destroy.

- kubernetes_manifest.instance
- kubernetes_manifest.crd
- kind_cluster.demo

The custom resource goes first, then the CRD that defines its kind, then the cluster that holds both. Nothing here keeps data outside the cluster. Ready to destroy these resources? This cannot be undone.

TOOL RESULTplan→awaiting_approval
convergence_id: "…" kind: destroy round: 1
plan: { uri: "turf://workspaces/default/convergences/…/rounds/1/plan",
digest: "sha256:…", destroy: 3 }
next: { tool: "apply", args: { convergence_id: "…" } }
You
Yes, destroy them.
Agent
  • apply→converged

Destroy complete! 3 resources destroyed.

illustrative · the shape of a session, not a transcript

In Claude Code:

/turf:destroy terraform/kubernetes/kind-crd

Or in words, in any client: “destroy everything in terraform/kubernetes/kind-crd”. The agent runs the /destroy runbook: init and open, then destroy with the values the configuration needs (a provider’s variables too), then plan. If nothing is planned, it says there is nothing to destroy and stops.

It presents the plan as Plan: X to destroy, one - <address> per line, with anything to be forgotten as . <address>. It names everything that holds data, and every turf action the round will run. Then it asks, in these words:

Ready to destroy these resources? This cannot be undone.

It applies only on your explicit yes, and declines the plan on a no. Instructions steer the teardown (“only destroy module.staging”) but never replace that question.

One round, dependents first. destroy starts a convergence that plans tearing down everything in state, dependents before what they depend on, and stops at its plan gate. plan plans it; apply with the plan’s digest applies it. An address with a removed block and lifecycle { destroy = false } plans as a forget: it leaves state and keeps running.

Your yes is the guard. In a destroy, a failing turf action is only a warning: the teardown goes on and ends converged, with the failure listed in rounds[].actions and the warnings. A before_destroy action cannot stop a destroy. So the agent says, when it presents the plan, that your yes is what guards it.

Keeping something. If you want something in the workspace kept, the agent stops and offers a backup first, or to stop managing it and leave it running: it deletes the resource’s block and adds a removed block with lifecycle { destroy = false }, then plans the teardown again. It edits your files only when you ask.

prevent_destroy holds. A plan that prevent_destroy refuses fails, names the instance, and applies nothing. The agent tells you what the plan wanted to destroy, and never disables the flag or removes its block without your say-so.

destroy takes the arguments every start verb takes. plan takes refresh for the round; replace is refused in a destroy.

Argument Meaning
workspace_alias The workspace, as open named it. Omit it for the default workspace.
var Root variable values for this run only, as tofu -var. A provider’s variables are needed here too.
var_file Variables files for this run only, in order, below var.
overlays *.turf.hcl files laid over the configuration in memory for this run alone.
plan_only Plan the teardown and end planned, keeping it as a planfile for a later apply. See Plan now, apply later.

Turf™ is a trademark of Turf LLC. Terraform® is a trademark of HashiCorp. Ansible® is a trademark of Red Hat, LLC, registered in the United States and other countries. Helm®, Kubernetes®, Prometheus® and OpenTelemetry® are registered trademarks, and Jaeger™ is a trademark, of the Linux Foundation. OpenTofu® and Model Context Protocol® are registered trademarks of LF Projects, LLC. All other trademarks are the property of their respective owners. Turf is not affiliated with, endorsed by, or sponsored by HashiCorp, IBM, Red Hat, the Linux Foundation, LF Projects or the OpenTofu project.

© 2026 Turf LLC. Free for individuals, education and small businesses within the Community limits, under the Turf Community Edition License 1.0. Government and larger organizations need a commerciallicense.turf.build · Discord ·GitHub