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.
Listen to this story
The audio brief
Story brief
3 key pointsAnthropic 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...
- 01
The first apply creates claude-lock.json with organization, workspace, resource IDs, and local/remote state hashes.
- 02
-dry-run previews changes; --force bypasses conflict protection, while --yes enables noninteractive CI execution.
- 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.
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
- platform.claude.comManage resources as code with ant apply