Claude's ant CLI Can Now Manage Agent Resources as Code
Anthropic added `ant apply` to the Claude CLI, letting teams declare Managed Agent environments, agents, skills, memory stores, and deployments in a repository and reconcile them with the Claude API.
Anthropic added ant apply to the ant CLI, giving teams a repository-first way to manage Claude Managed Agent resources. The command can declare environments, agents, skills, memory stores, and deployments as files, then create or update the corresponding Claude API resources from a reviewed plan. (ClaudeDevs on X; Claude Platform docs)
This extends Anthropic's existing command-line workflow into infrastructure-as-code territory. Instead of configuring each resource separately in a console or issuing individual API commands, a team can keep the declaration beside its application code, review the diff, and reconcile the remote resources from CI. (Claude Platform docs)
The ant apply workflow
The documented workflow is:
- Describe each Claude resource in a file under the project directory.
- Run
ant applyto generate a plan. - Review and approve the proposed creates or updates.
- Commit the generated
claude-lock.json.
The lockfile records the resource IDs, organization, workspace, and hashes for the last sent and returned state. Subsequent runs use those entries to update the same resources instead of creating duplicates. (Claude Platform docs)
The command supports a targeted first apply, such as ant apply agents/summarizer.md, as well as a project-wide apply with ant apply .. With no path, ant apply reconciles files already tracked by the lockfile. A new file should be included explicitly in CI, for example:
ant apply --yes .
That distinction matters: a bare non-interactive apply reconciles tracked resources, while passing the project directory lets CI include newly added declarations. (Claude Platform docs)
What can be managed
ant apply supports five resource types:
| Resource | Typical location | File format or behavior |
|---|---|---|
| Agents | agents/ | Commonly Markdown; prose becomes the agent's system prompt |
| Environments | environments/ | YAML, JSON, or Markdown |
| Skills | skills/ | A directory containing a root-level SKILL.md, uploaded as one bundle |
| Memory stores | memory_stores/ | YAML, JSON, or Markdown |
| Deployments | deployments/ | Frontmatter is the request body; prose becomes the first session message |
Any resource except a skill can be represented as YAML, JSON, or Markdown. Anthropic's docs also allow resources to refer to one another by relative path, so a deployment can point to its agent, environment, or memory store without hard-coding IDs in the declaration. (Claude Platform docs)
Plans, dry runs, and CI
For local work, ant apply --dry-run prints a detailed plan without changing remote resources or writing the lockfile. It exits with status 0 even when the plan is blocked, so CI should inspect the plan output rather than treating a zero exit code as proof that changes can be applied. (Claude Platform docs)
For a non-interactive apply, --yes skips the confirmation prompt. Anthropic's documented CI workflow runs ant apply --yes . after a merge, then commits the updated lockfile. For pull requests, the docs recommend ant apply --dry-run . so reviewers can see the proposed plan without applying it. (Claude Platform docs)
Authentication must resolve to the organization and workspace recorded in claude-lock.json. Anthropic recommends Workload Identity Federation rather than a stored API key for CI, and private GitHub-hosted skills require GITHUB_TOKEN. (Claude Platform docs)
Updates, external changes, and pruning
Editing a declaration and running ant apply again produces an update plan. If a resource was changed, archived, or deleted outside the managed files, the CLI refuses to apply by default; --force is the documented override. A renamed file declares a new resource, while the old resource remains until it is explicitly pruned. (Claude Platform docs)
The --prune flag removes resources that are in the lockfile but no longer declared. For most resource types, Anthropic says removal archives the resource; for a skill, removal deletes it. This makes the lockfile and repository state operationally important: teams should review a prune plan carefully before applying it. (Claude Platform docs)
What this changes for Claude builders
ant apply gives teams a repeatable control plane for Claude Managed Agent resources:
- Resource definitions can be reviewed in pull requests.
- The lockfile keeps local declarations tied to remote IDs.
- Relative references let agents, skills, environments, and deployments be composed as a project.
- Dry-run and non-interactive modes fit both review and deployment pipelines.
- External edits are detected instead of silently overwritten.
Anthropic's documentation does not state that ant apply itself is in beta or generally available, nor does it publish pricing or account-tier limits for the command. Teams should therefore treat the documented CLI behavior as the current source of truth and confirm workspace permissions before wiring it into a production pipeline. (Claude Platform docs)
Sources
- ClaudeDevs on X, “We've added
ant applyto the ant CLI”: https://x.com/ClaudeDevs/status/2095651107645145538 - Claude Platform, “Manage resources as code with ant apply”: https://platform.claude.com/docs/en/cli-sdks-libraries/cli/apply
Read next
Keep building the workspace playbookClaude Platform's 'ant' CLI Brings the Full Claude API to Your Terminal
Anthropic's Claude Platform documents 'ant', a command-line tool that exposes every Claude API resource as a subcommand. It sends Messages requests, browses responses, version-controls agents and environments, and runs a self-hosted Managed Agents worker, with Claude Code able to drive it natively.
Claude Managed Agents Add Self-Hosted Sandboxes (Public Beta) and MCP Tunnels (Research Preview)
Anthropic says Claude Managed Agents can now run tool execution in a sandbox you control (public beta) and connect to private MCP servers via MCP tunnels (research preview). The update targets enterprise security requirements by keeping execution and private services within an organization's perimeter.
Anthropic Open-Sources a Commerce Agents Blueprint for Claude
Anthropic has launched an open-source blueprint for building commerce agents with Claude. It includes shopping and merchant agent implementations, demos across retail, travel, telecom, and ticketing, guardrails, and a Claude Code plugin.
Frequently Asked Questions
What does ant apply do?
`ant apply` creates and updates Claude API resources from files in a repository. It shows a plan, applies approved changes, and records resource IDs and state in `claude-lock.json`.
Which Claude resources can ant apply manage?
The documented resource types are agents, environments, skills, memory stores, and deployments. Files can be YAML, JSON, or Markdown, with skills represented as a directory containing a root-level `SKILL.md`.
Can ant apply run in CI?
Yes. Anthropic documents `ant apply --yes .` for a non-interactive CI workflow and recommends committing the resulting `claude-lock.json` so later runs reconcile the same resources.
Does ant apply delete resources automatically?
No. Removing a declaration leaves its resource in place unless `--prune` is used. For most resources pruning archives the resource; for a skill it deletes it.