The ant apply command might be the most quietly important thing Anthropic has shipped this month — and in this guide I’ll show you exactly what it does and how I’d use it to run AI agents like real infrastructure. Released in version 1.30.0 of the ant CLI on 3 September 2026 (per the official Claude Platform release notes), ant apply lets you declare Claude agents, environments, skills, memory stores and scheduled deployments as plain files in your repository — then sync them to the API with one command, Terraform-style. I’ve been through the official docs line by line, and here’s everything that matters.
Short answer:
ant applycreates and updates Claude API resources from files: agents, environments, skills, memory stores and deployments.- It shows you a plan first and waits for approval — like Terraform for Claude Managed Agents.
- It writes a
claude-lock.jsonlockfile you commit, so the next run updates the same resources instead of creating duplicates. - Requires
antCLI version 1.30.0 or later, released 3 September 2026. - Built for CI:
ant apply --yes .after merge,ant apply --dry-run .on pull requests.
What the Ant Apply Command Actually Does
Straight from the official docs (fetched September 2026): “ant apply creates and updates Claude API resources from files: agents, environments, skills, memory stores, and deployments. They live in your repository and change through the same review as your code.”
The workflow is three steps. You describe each resource in a file, run ant apply, and approve the plan it shows. Then you commit the claude-lock.json it writes, so the next run updates the same resources instead of creating new ones.
The simplest possible example is a single agent as a Markdown file under agents/:
---
name: Summarizer
model: claude-opus-5
tools:
- type: agent_toolset_20260401
---
You are a helpful assistant that writes concise summaries.
Run ant apply agents/summarizer.md and the CLI prints a plan — what will be created, with which credentials, organisation and workspace — and asks “Apply these changes? (y)es / (n)o / (d)etails”. Answer d to see a field-by-field breakdown, or use --dry-run to print the detailed plan and exit without changing anything. To change the agent later, edit the file and run ant apply again; the plan then shows an update instead of a create.
If you’ve used infrastructure-as-code tools, this whole loop will feel familiar within about ninety seconds. If you haven’t, the mental model is simple: your repo is the source of truth, and the API gets reconciled to match it.
The Lockfile: Why claude-lock.json Matters
The first ant apply writes claude-lock.json in the directory you run it from (so run it from the repository root). It records the ID of the resource each file created, plus the organisation and workspace those resources live in, and two hashes that fingerprint what was last sent and what the API returned — that’s how a later run notices an edited file, or a resource changed outside your files.
You commit the lockfile with your code. It’s how the next run — on your machine or in CI — finds the same resources instead of creating them again, and it’s where you read an agent’s ID when you want to start a session with it. One sharp edge worth knowing, per the docs: ant apply can’t adopt a resource you created in the Claude Console or with ant beta:agents create. Only what’s in the lockfile is managed, and applying a file that describes an existing agent creates a second one. The exception: if you download an agent from the Console with Export as code, the download includes its own claude-lock.json, so applying it updates the resources you built there.
🔥 Want this set up without the guesswork? Inside the AI Profit Boardroom we’re building agents-as-code workflows for SEO content pipelines — 3,700+ members, four live calls per week, daily tutorials, done-for-you templates and a 30-day roadmap. Prefer a one-on-one? Book a free SEO strategy session and we’ll map out where managed agents fit in your business.
Five Resource Types, One Directory Layout
Beyond agents, ant apply manages four other resource kinds, each as a file holding what you’d send to that kind’s create endpoint:
| Resource | File format | Lives in |
|---|---|---|
| Agent | Markdown (frontmatter = config, body = system prompt) | agents/ |
| Environment | YAML | environments/ |
| Memory store | YAML | memory_stores/ |
| Deployment | Markdown (frontmatter = config, prose = the message that starts each session) | deployments/ |
| Skill | Directory with a SKILL.md at its root, uploaded as one bundle |
skills/ |
The genuinely clever part is path references. Wherever the API expects another resource’s ID, you write the relative path to that resource’s file instead — a reviewer agent lists ../skills/pr-summary under skills, a deployment names its agent as ../agents/reviewer.md — and ant apply creates everything in dependency order and fills in the real IDs. A skill reference can even be a GitHub URL of the form https://github.com/<owner>/<repo>/tree/<branch>/<dir>, which the CLI downloads and pins to the resolved commit until you run with --upgrade.
Kind detection is layered: a top-level type field wins, then the directory the file sits in, then a file name that starts with the kind (like environment_staging.md). Files that match none — READMEs, CI configs — are skipped unless you name them on the command line. Apply a whole project with ant apply .
Running the Ant Apply Command in CI
This is where it earns its keep for teams. Without a terminal, ant apply prints the plan and stops, telling you to re-run with --yes. The documented CI setup:
- Run
ant apply --yes .on your default branch after merge, naming the project directory — a bareant apply --yesonly reconciles files the lockfile already tracks and skips newly added ones. - On pull requests, run
ant apply --dry-run .to print the plan for reviewers (informational only, exits 0 even when blocked). - Commit the updated
claude-lock.jsonat the end of the job even if the apply failed partway, because a partial apply still records what it created. - Run one apply at a time — nothing locks the lockfile.
- Authenticate with Workload Identity Federation rather than a stored API key;
ant applyrefuses credentials that resolve to a different organisation or workspace than the lockfile records.
Drift handling is strict by default: if a resource was edited, archived or deleted outside your files (in the Claude Console, say), the plan ends with “This plan cannot be applied:” and the command exits with “refusing to apply” — --force overrides. Deleting a file leaves its resource in place with a warning; --prune actually removes it. Renaming a file declares a new resource, so prune the old one.
The full flag set: --dry-run, --yes, --force, --prune, --upgrade, --lock-file <path> and --verbose.
Why This Matters If You Run Agents for a Living
I run content and SEO automation across multiple sites, and the failure mode with hosted agent platforms has always been the same: someone tweaks a prompt in a web console, nothing is versioned, and three weeks later nobody knows why the agent behaves differently. ant apply kills that whole class of problem — prompts, schedules, memory stores and permissions all go through pull-request review like the rest of your code. Pair it with the wider Managed Agents platform (the same one that got the new server-evaluated auto permission policies on 10 September 2026, per the release notes) and you’ve got scheduled, reviewable, reproducible agent deployments. If you’re weighing up the model side of this stack, my Claude Fable 5.1 review covers the current default model, and my guide to Claude Code managed MCP servers covers the org-level tooling story on the Claude Code side.
The Bottom Line on the Ant Apply Command
If you’re building anything serious on Claude Managed Agents, the ant apply command is now the correct way to do it: resources as files, plans before changes, a committed lockfile, and CI reconciliation with --yes and --dry-run. It shipped in ant CLI 1.30.0 on 3 September 2026, it’s documented in depth, and it turns “someone edited the agent in the console” into a version-controlled diff. For solo builders it’s a nice-to-have; for teams it’s the difference between agents as toys and agents as infrastructure. And if your API bill matters, file-based review also makes model choices auditable — compare costs in my DeepSeek V4.1 Flash API pricing breakdown.
FAQ: ant apply command
What is the ant apply command?
It’s a subcommand of Anthropic’s ant CLI that creates and updates Claude API resources from files in your repository — you describe each resource in a file, run ant apply, approve the plan it prints, and commit the claude-lock.json it writes.
What resources can ant apply manage?
Five kinds: agents (Markdown), environments (YAML), memory stores (YAML), scheduled deployments (Markdown) and skills (a directory with a SKILL.md). Any resource except a skill can also be written as YAML, JSON or Markdown.
What is claude-lock.json and should I commit it?
It’s the lockfile ant apply writes, recording each file’s resource ID, the organisation and workspace, and content hashes. Yes — commit it, because it’s how later runs (including CI) update the same resources instead of creating duplicates.
How do I run ant apply in CI?
Run ant apply --yes . on the default branch after merge and ant apply --dry-run . on pull requests, commit the updated lockfile at the end of the job, run one apply at a time, and authenticate via Workload Identity Federation to the same organisation and workspace the lockfile records.
Can ant apply adopt agents I created in the Claude Console?
Not directly — only lockfile-tracked resources are managed, and applying a file that describes an existing agent creates a second one. The supported route is the Console’s Export as code download, which ships with its own claude-lock.json so applying it updates those resources.
What version of the ant CLI do I need for ant apply?
ant apply requires CLI version 1.30.0 or later, released 3 September 2026 per the Claude Platform release notes.
Building an AI-powered business? Inside the AI Profit Boardroom you get the exact agent workflows, prompts and templates we use — 3,700+ members, four live calls a week, daily tutorials and a 30-day roadmap. Or book a free SEO strategy session and we’ll look at where agents-as-code could remove manual work from your pipeline.
About the author: Julian Goldie is an SEO agency owner with 10+ years in SEO, 394K+ YouTube subscribers, a 100% Upwork job-success score, 75K+ community members across his groups, and a best-selling SEO book. He publishes daily AI SEO content on YouTube, runs the AI Profit Boardroom community, and offers a free SEO strategy session for businesses that want AI-driven growth.
Related reading
- Claude Fable 5.1 Review: Worth the Upgrade?
- Claude Code Managed MCP Servers: Full Setup Guide
- DeepSeek V4.1 Flash API Pricing: Full Cost Breakdown
Last updated September 2026. This is the living guide to the ant apply command — it gets updated as the tools change.

