Repository navigation
Description
Summary
When a project has a CLAUDE.md file (strong signal that Claude Code is in use) but no .claude/ directory, apm install and apm compile --targets all silently skip Claude skill deployment. No warning is emitted, and the user has no indication that Claude was excluded from skill integration.
To Reproduce
-
Start with a repo that has
CLAUDE.mdand.github/but no.claude/directory:CLAUDE.md ← exists (file) .github/ ← exists (directory) apm.yml ← no explicit target: field -
Run
apm installfollowed byapm compile --targets all -
Observe that
.agents/skills/is populated (for Copilot, Cursor, Codex, etc.) but.claude/skills/is never created.
Expected behavior
One of:
.claude/skills/is created and populated (sinceCLAUDE.mdindicates Claude Code usage), OR- A warning is emitted explaining that Claude skill deployment was skipped because
.claude/does not exist, with guidance on how to enable it (e.g., "create.claude/or settarget: claudein apm.yml")
Root cause
Three factors combine to produce the silent skip:
-
Auto-detection doesn't see Claude.
target_detection.py:167checks(project_root / ".claude").exists()— this looks for a path literally named.claude, not forCLAUDE.md. A project with onlyCLAUDE.md(no.claude/directory) does not register Claude as a detected target. -
auto_create=Falsefor Claude. Even when--targets allresolves and includes Claude in the target list, the directory-creation loop ininstall/phases/targets.py:161skips it:if not _t.auto_create and not _explicit: continue
The
--targets allvalue from auto-detection (triggered by ≥2 detected folders) is not considered "explicit" in the_explicitvariable sense (which tracks--targetCLI flag orapm.yml target:field). -
Skill integrator bails out.
skill_integrator.py:341independently guards on the directory:if not target.auto_create and not target_root_dir.is_dir(): continue
So even if Claude somehow ends up in the resolved target set, skills aren't deployed.
Relationship to existing issues
-
[BUG] apm install never deploys local .apm/ primitives to .claude/ because claude isn't a registered runtime #751 (closed): Described
apm install --target claudesilently skipping deployment. Fixed by PR fix: create target dir for explicit --target claude; content hash fallback when .git absent #763, which gates directory creation on_explicit— so explicit--target claudeortarget: claudeinapm.ymlnow works correctly. The scenario here is different: no explicit target is set, and the user relies on auto-detection. -
Scope-awareness gaps: hook integrator, auto_create, integration tests #576 (closed): Identified that
install.pywas creating directories forauto_create=Falsetargets under--target=all(P1-4). The fix correctly gatedmkdironauto_create— but didn't account for the case where a project clearly uses Claude (evidenced byCLAUDE.md) without having a.claude/directory yet.
Workarounds
Any of:
mkdir .claudebefore runningapm install- Add
target: claude(ortarget: all) toapm.yml
Neither is documented, and the behavior is surprising for users who expect CLAUDE.md to be sufficient signal.
Possible approaches
A few options (not prescriptive — just thinking out loud):
- Expand auto-detection: Treat the existence of
CLAUDE.mdas equivalent to.claude/for target detection purposes. - Emit a warning: When Claude is in the resolved target set but
.claude/doesn't exist, log a message suggesting the user create it or set an explicit target. - Treat
--targets allas explicit: When the user passes--targets allon the CLI, treat it the same as an explicit target for theauto_createguard (distinct from auto-detected "all").
Environment
- APM: v0.12.2 (2b1fb6b)
- OS: macOS 15.5 (Darwin 25.4.0)
- Claude Code: 1.0.33
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
tillig commentedon May 5, 2026
Before I submit a PR for this, I'm curious how the project team would like to resolve it. It seems like there's some sort of migration away from compiling everything into a central
CLAUDE.md(orAGENTS.mdor whatever) and into using the.agentsor.claudefolders instead.If it was up to me...
--targets allwould actually mean all targets - and it'd generate whatever was required for Claude even if it wasn't already present.CLAUDE.mdwas there already or not, if the.claude/folder needed to be created based on the set of targets, it would be created and populated.This somewhat relates to my other issue where things in
.claude/rulesget doubled intoCLAUDE.md. It could potentially mean that there is noCLAUDE.mdbut there is totally a.claudefolder, all of which should come out ofapm. Thus the presence or absense ofCLAUDE.mdwouldn't have quite as much impact on whether.claude/needs to be created - it would be entirely based on the target being specified. For auto-detection, either a.claude/folder orCLAUDE.mdwould signify Claude usage.ux(compile): align provenance line wording with install
fix(targets): explicit, auditable target resolution (closes #1154) (#…
Merge origin/main + address Copilot review feedback
fix(install): restore static-target deploy path; tighten test fixture…
test: add target to ADO fixtures; relax drift-perf budget for Windows (…
test(release-validation): pass --target copilot to apm init on Windows (
fix(isolated): inject target input into generated apm.yml (#33)
fix: address PR #1257 review comments
fix(install,tests): repair 63 integration tests in merge queue (#1257)
fix(targets): explicit, auditable target resolution (closes #1154) (#…
fix(install): restore static-target deploy path; tighten test fixture…
test: add target to ADO fixtures; relax drift-perf budget for Windows (…
test(release-validation): pass --target copilot to apm init on Windows (
fix(install,tests): repair 63 integration tests in merge queue (#1257)
fix(manifest): fold legacy 'all' in targets to auto-detect with depre…
fix(manifest): fold legacy 'all' in targets to auto-detect with depre…
fix(manifest): fold legacy 'all' in targets to auto-detect with depre…
fix(manifest): fold legacy 'all' in targets to auto-detect with depre…
fix(manifest): fold legacy 'all' in targets to auto-detect with a dep…