Toolspublished

Anthropic Adds ant apply to Manage Claude API Resources as Code

The new CLI command lets teams keep Claude API resource definitions alongside application code, while its lockfile sets strict limits on what the tool can manage.

By 2 min read
Anthropic Adds ant apply to Manage Claude API Resources as Code
Anthropic Adds ant apply to Manage Claude API Resources as Code

Listen to this story

The audio brief

About 1:24
0:001:24
Read transcript
Anthropic has added ant apply, a command that lets teams manage Claude API resources from files in a repository. Instead of keeping agent configurations and deployment settings only in a hosted console, developers can review them alongside application code, then apply approved changes to the API. The command covers agents, environments, skills, memory stores, and deployments. On its first run, ant apply creates a claude-lock.json file. That lockfile records the organization, workspace, remote resource IDs, and hashes of both local and remote state. Later runs use it to update the same resources and detect changes made outside the repository workflow. The files can reference one another by relative path, so a multi-part setup can be applied in dependency order. Agent and skill references are pinned to versions created in that same run. But the lockfile also draws a firm boundary. ant apply cannot adopt resources created in the Claude Console or through ant beta:agents create. Conflicts block a plan by default; --dry-run previews it, --force bypasses that protection, and --yes supports noninteractive CI runs. Removing a file does not remove its remote resource. With --prune, most omitted resources are archived, while skills are deleted. Anthropic recommends dry runs on pull requests and one apply after each default-branch merge. The key constraint is that teams must serialize those applies, because the lockfile itself is not locked.

Story brief

3 key points

Anthropic has introduced ant apply for managing Claude API resources through repository files, bringing infrastructure-as-code workflows to agents, environments, skills, memory stores, and deployments. The command creates a claude-lock.json file that maps local definitions to remote IDs and detects drift, while relative references coordinate multi-resource updates. It is deliberately scoped: existing Console-created...

  1. 01

    The first apply creates claude-lock.json with organization, workspace, resource IDs, and local/remote state hashes.

  2. 02

    -dry-run previews changes; --force bypasses conflict protection, while --yes enables noninteractive CI execution.

  3. 03

    Deleting a file does not delete its resource; --prune archives most omitted resources and deletes skills.

Anthropic has added ant apply, a command that creates and updates Claude API resources from files in a repository. Teams can review agent configuration, deployment settings and supporting resources alongside their application code before applying changes to the API.

The command covers agents, environments, skills, memory stores and deployments. A developer describes a resource in a repository file, runs ant apply, reviews the plan, and approves it. The first run writes claude-lock.json; later runs use that record to update the same remote resources rather than create new copies.

A lockfile connects files to API objects

The lockfile records resource IDs, the organization and workspace, and hashes of local and remote states. Those records let a later run detect an edited file or a remote change. Repository files can also refer to one another by relative path rather than hard-coded API IDs.

Apply a project directory
ant apply .

That dependency handling supports multi-part agent setups. The command creates linked resources in the needed order, fills in their API IDs, and pins agent and skill references to versions applied in the same run. Editing a referenced agent or skill therefore updates linked references together.

Plans catch conflicts before changes land

If a tracked resource was changed, archived or deleted outside the repository workflow, ant apply blocks the plan. Developers can use --dry-run to inspect a detailed plan without changing resources, while --force overrides the conflict protection and --yes skips interactive confirmation.

Deletion works differently from an update. Removing a tracked file leaves its remote resource in place, and renaming a file declares a new resource while leaving the old one behind. The --prune flag removes no-longer-declared resources, archiving most resources and deleting skills.

CI needs one writer at a time

Anthropic’s CI guidance runs ant apply --yes after a merge on the default branch and ant apply --dry-run on pull requests, where reviewers can inspect proposed changes. Dry runs exit successfully even when a plan is blocked.

Teams must run one apply at a time because the command does not lock the lockfile. It also refuses credentials or lockfiles tied to a different organization or workspace than the project record, preventing an apply against a mismatched Claude API location.

Sources

  1. platform.claude.comManage resources as code with ant apply