Update dependencies
Use this page to take new versions of your agent packages without surprises.
A plain apm install never moves a version: it replays apm.lock.yaml.
Versions change when you run apm update, edit apm.yml, or merge a
pull request that does one of those.
See what is outdated
Section titled “See what is outdated”apm outdatedapm outdated compares each locked dependency with its upstream and changes
nothing. Add -v to list the newer tags. An unreachable source shows as
unknown.
Update on purpose
Section titled “Update on purpose”Preview, then apply:
apm update --dry-runapm updateapm update prints a plan (added, updated, removed, unchanged) and asks
before changing anything; the default answer is No. Name packages to limit
the update to them (apm update contoso/review-skills). In scripts and CI, pass
--yes. apm update also revalidates any marketplace behind a dependency and fails
rather than use stale data.
“Latest” means the newest version your apm.yml allows:
Entry in apm.yml | What apm update does |
|---|---|
#^1.1.0 (range) | Moves to the highest matching tag |
#main (branch) | Moves to the branch tip |
#<40-char SHA> (commit) | Moves to the commit of the newest annotated release tag and adds the tag as a comment |
#v1.1.0 (exact tag) | Stays on that tag; edit it to move |
To jump to a release outside your range, edit apm.yml and run apm install.
Review the lockfile diff
Section titled “Review the lockfile diff”The lockfile diff is the change your reviewers approve. When Ben releases
contoso/review-skills 1.2.0, Ana’s update pull request shows:
- repo_url: contoso/review-skills resolved_ref: v1.1.0 resolved_commit: 3f2a9c1... resolved_ref: v1.2.0 resolved_commit: b71e04d... deployed_files: - .agents/skills/security-review/SKILL.md - .agents/skills/security-review/references/owasp.mdRead it for:
- New packages: a new
repo_urlis a new transitive dependency. - New files, especially hooks, MCP servers and scripts. If your project
uses the approval gate, they stay parked until someone runs
apm approve. - Changed sources: a different host or repository for the same name.
apm update also re-checks executables against current approvals. If your
organization turns the approval gate on, packages installed before it go through the
gate on the next update. If you remove the approval for one type, such as hooks, from a
package, the update retires that type. The lockfile lists the approved types in
exec_allowed_types.
After a lock bump, run apm install
Section titled “After a lock bump, run apm install”A pull request that changes apm.lock.yaml does not change the files on
anyone’s machine. After you pull it, run:
apm installCI rebuilds from the lockfile with apm install --frozen; see
Run in CI.
Dependabot
Section titled “Dependabot”Dependabot opens pull requests for git dependencies in apm.yml and
regenerates apm.lock.yaml when one exists:
version: 2updates: - package-ecosystem: "apm" directory: "/" schedule: interval: "weekly"- Tag pins move to the newest semver tag, including package-scoped tags such
as
review-v1.4.0. - SHA pins move to the newest annotated, non-prerelease release tag, with the tag added as a comment.
- Branch pins change the lockfile, not
apm.yml. - It refreshes
apm.lock.yamlwith the APM release bundled in Dependabot. Today that bundle is older than 0.37 and runsapm lock, which cannot readlockfile_version: "4", so its pull requests on such projects can fail until dependabot/dependabot-core#16792 (APM 0.39.2 or later,apm install --no-frozen) ships. See Update bots.
It skips object-form entries (git:, path:), entries without a ref, local
paths, Azure DevOps and http:// sources, and mcp: entries. Reference:
Dependabot supported ecosystems.
Renovate
Section titled “Renovate”Renovate’s apm manager reads every apm.yml and updates entries pinned with
an exact #ref:
{ "extends": ["config:recommended"]}With pinDigests (part of config:best-practices), it keeps a SHA pin and its
tag comment current. When apm.lock.yaml exists, Renovate refreshes it with
the apm CLI, so the CLI must be available to Renovate (for example
binarySource=global on a self-hosted runner). Renovate sets CI=true, which
makes a plain apm install frozen. Today Renovate runs plain apm install, so
a bump that edits apm.yml can fail until its apm manager passes
--no-frozen; see Update bots. Reference:
Renovate apm manager.
Update bots
Section titled “Update bots”These are the recommended commands for bot maintainers. They describe what a bot should run, not what Dependabot and Renovate run today (see above).
| Bot | Run | Commit |
|---|---|---|
| Dependabot (APM 0.39.2 or later) | apm install --no-frozen; apm update --yes --target <t> <pkg> for branch pins | apm.yml, apm.lock.yaml and every tracked deployed file the run changed |
| Renovate | apm install --no-frozen for bumps; apm install --update for lock maintenance | every file git status reports |
| Any bot | set APM_NO_SCRIPTS=1; never pass --force; never commit apm_modules/ |
- Bundle APM 0.39.2 or later. APM 0.37 to 0.39.1 refuse a lockfile
written by any newer APM, so a bot pinned to them breaks within days. From
0.39.2 a newer writer only warns, so the bundle keeps working until the
lockfile format changes. See Compatibility.
A bot running an older APM records its own version in
apm_version; that line moving down in a bot PR is expected. - Use
apm install --no-frozen, notapm lock.apm lockkeeps the previous deployed-file rows, so its output can fail a laterapm install --frozen. - No targets needed. On a clean checkout with gitignored harness
directories and no
targets:inapm.yml,apm installuses the targetsapm.lock.yamlrecorded. Passing--targetstill works. The fallback can deploy to several recorded targets; a later install in the same checkout then finds several harness directories and stops with the ambiguous-harness error (exit 2), as it does today. Declaretargets:inapm.ymlto avoid this; update bots start from a fresh clone and are not affected. - Commit the deployed files. In a repository that commits deployed files,
a pull request that changes only
apm.lock.yamlfailsapm install --frozenandapm audit --cion a fresh clone. Commit every deployed file the run changed.
Verify
Section titled “Verify”apm outdated[*] All dependencies are up-to-dateClaude: instructions move to AGENTS.md (0.38)
Section titled “Claude: instructions move to AGENTS.md (0.38)”Claude projects now get always-on and single-directory instructions through
AGENTS.md, which each generated CLAUDE.md imports with @AGENTS.md.
Path-scoped instructions (for example applyTo: "**/*.py") stay in
.claude/rules/.
- In a project that compiles, run
apm install. Once a compiledAGENTS.mdcarries an always-on or directory instruction, it removes the.claude/rules/<name>.mdfile APM wrote for it and names where it moved. A rule file you edited is kept with a warning; delete it to finish the move. - Run
apm compile(install prints a reminder). It writes the rootAGENTS.md, a<dir>/AGENTS.mdfor each single-directory instruction, and aCLAUDE.mdnext to each that contains@AGENTS.md. - Commit the new
AGENTS.mdandCLAUDE.mdfiles.
A hand-authored root CLAUDE.md that does not import @AGENTS.md changes
nothing: apm install keeps every instruction in .claude/rules/ and warns
once. To opt in, add a line @AGENTS.md to it, then rerun apm install and
apm compile. A hand-authored root AGENTS.md also keeps every instruction in
.claude/rules/; to opt in, set compilation.agents_md.mode: managed_section
in apm.yml and add the <!-- apm:start --> and <!-- apm:end --> markers to
the file once each. APM never overwrites either file.
The apm compile reminder clears once a compile has written each routed
instruction as it is now. Changing an instruction’s applyTo or body brings
the reminder back until you compile again.
In projects that target Claude plus Copilot or Codex, the shared AGENTS.md
keeps the optimizer’s placement, so a directory or file-type instruction can
load at the root for Claude. Use Claude-only targets or narrower globs if that
matters. A directory instruction stays in .claude/rules/ when its directory
does not exist or compilation.strategy is single-file.
A nested AGENTS.md loads when Claude opens a file in that folder, not in
sessions that only run shell commands; put guidance needed there at the root.
User scope (apm install -g) is unchanged: every instruction stays in
~/.claude/rules/. Details: apm compile.
Projects that never compile
Section titled “Projects that never compile”From 0.39, a project that installs without running apm compile keeps the 0.37 layout: apm install writes always-on and directory instructions to .claude/rules/, as before 0.38. If a 0.38 install removed those files, the next apm install restores them. Projects that compile keep AGENTS.md and its CLAUDE.md import. No action is needed either way.
Update the APM CLI binary
Section titled “Update the APM CLI binary”Updating APM itself is separate from updating packages: see Install APM.
Copyright (c) Microsoft Corporation. General documentation: CC-BY-4.0. Software, code examples and OpenAPM: Apache-2.0. See scope and exclusions.