AI Catchup

Claude's ant CLI Can Now Manage Agent Resources as Code

By 4 min read

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:

  1. Describe each Claude resource in a file under the project directory.
  2. Run ant apply to generate a plan.
  3. Review and approve the proposed creates or updates.
  4. 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:

ResourceTypical locationFile format or behavior
Agentsagents/Commonly Markdown; prose becomes the agent's system prompt
Environmentsenvironments/YAML, JSON, or Markdown
Skillsskills/A directory containing a root-level SKILL.md, uploaded as one bundle
Memory storesmemory_stores/YAML, JSON, or Markdown
Deploymentsdeployments/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

Keep building the workspace playbook

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.

Get the weekly AI Catchup

Tools, practices, and what matters, in your inbox every week.