/cc-authoring:cc-pluginroot-directory-source-ignoredfrom cc-authoring
Fix for the Claude Code startup error `Plugin directory not found at path: <marketplace_root>/<plugin_name>. Check that the marketplace entry has the correct path.` when a local `source: "directory"` marketplace uses `metadata.pluginRoot` to factor a common prefix out of its plugin sources. Use when: you authored a directory-source marketplace via `claude plugin marketplace add <local-path>`; marketplace.json pairs `{"name":"foo","source":"./foo"}` with a top-level `metadata.pluginRoot: "./plugins"`; the subdirectories exist at `<root>/plugins/foo` but Claude Code reports them missing at `<root>/foo`, the `/plugins/` segment silently dropped; you manage the marketplace with APM (`apm.yml` with `marketplace.metadata.pluginRoot`) whose packaging step emits a pluginRoot-factored marketplace.json that Claude Code then rejects at load; or the plugin loads once you change its source to `./plugins/foo` and remove `pluginRoot`. Covers why the field is schema-accepted and honored for `git-subdir` sources yet ignored for directory ones (resolved literally against installLocation as of Claude Code 2.1.158), and what to change at both the apm.yml and marketplace.json layers.
Trending skills
7-day visitors to each skill page
Ships in cc-authoring. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Claude Code refuses to load plugins from a local directory-source marketplace and prints, for each affected plugin:
Plugin directory not found at path: <marketplace_root>/<plugin_name>.
Check that the marketplace entry has the correct path.
The directory IS present on disk — just at
<marketplace_root>/plugins/<plugin_name>, not at the resolved path
Claude Code is reporting. The marketplace.json's
metadata.pluginRoot: "./plugins" is being silently ignored.
The error message blames "the marketplace entry" but the entry is correct per the documented schema; the bug is in the resolver.
ALL of these together strongly point at this failure mode:
source: "directory" (you can
see this in ~/.claude/plugins/known_marketplaces.json — look for
"source": "directory" under the marketplace name).marketplace.json includes "metadata": { ..., "pluginRoot": "./plugins" }.{"name": "claudeception", "source": "./claudeception"} —
relying on pluginRoot to add ./plugins/ to that path.<root>/plugins/<name>, NOT at <root>/<name>../plugins/ segment.The Claude Code 2.1.158 binary's marketplace schema accepts
metadata.pluginRoot (validated as
h.object({pluginRoot: h.string().optional()...})). The field IS
read at multiple call sites (H.pluginRoot, v.pluginRoot,
z.pluginRoot are visible in the binary), but NONE of those call
sites are the source-resolution path for source: "directory"
marketplaces. For directory sources, the plugin source string is
joined directly against the marketplace's installLocation with no
pluginRoot prepending.
Result: a marketplace.json that validates fine at install time and
even passes APM's packaging step in --dry-run mode (since APM uses the same schema)
fails at plugin-load time.
Whether this is intentional ("pluginRoot is git-subdir only") or a forgotten branch is unclear from the binary alone; the public docs don't say. Either way the symptom is consistent.
Revert the affected marketplace to explicit per-plugin source
paths and remove pluginRoot from metadata.
// before — broken
{
"metadata": {
"homepage": "...",
"pluginRoot": "./plugins"
},
"plugins": [
{ "name": "foo", "source": "./foo" },
{ "name": "bar", "source": "./bar" }
]
}
// after — works
{
"metadata": {
"homepage": "..."
},
"plugins": [
{ "name": "foo", "source": "./plugins/foo" },
{ "name": "bar", "source": "./plugins/bar" }
]
}
apm.yml is the source of truth and APM's packaging step regenerates
marketplace.json. You must fix BOTH:
Edit apm.yml:
marketplace:
metadata:
homepage: ...
# remove this line:
# pluginRoot: ./plugins
packages:
- name: foo
source: ./plugins/foo # make sure these are full paths
...
Re-run APM's packaging step. The generated marketplace.json will lose
pluginRoot and contain explicit ./plugins/<name> sources.
DO NOT edit only marketplace.json — the next run of APM's packaging step (or
the CI staleness check that repacks and runs git diff --quiet) will clobber
your hand-edit.
If many plugins, this replace_all Edit works because the literal
appears nowhere else:
"source": "./ → "source": "./plugins/Then remove the pluginRoot line + clean up its preceding comma in
the metadata block.
After fixing, restart Claude Code. The errors disappear.
JSON still parses:
python3 -c 'import json; d=json.load(open(".claude-plugin/marketplace.json")); print(len(d["plugins"]), "plugins")'
No more pluginRoot:
grep pluginRoot .claude-plugin/marketplace.json apm.yml || echo OK
All sources have the prefix:
python3 -c '
import json
d = json.load(open(".claude-plugin/marketplace.json"))
bad = [p["name"] for p in d["plugins"] if not p["source"].startswith("./plugins/")]
print("missing prefix:", bad)
'
Restart Claude Code. The Plugin directory not found at path: errors
for every plugin in the marketplace stop firing.
Observed 2026-05-30 on Claude Code 2.1.158 (macOS arm64) with the
local marketplace at /Users/<user>/Projects/workspace/claude-skills.
PR #30 in that repo ("portable plugin paths") had switched from
explicit ./plugins/<name> source paths plus no pluginRoot →
short ./<name> sources plus metadata.pluginRoot: "./plugins".
Schema-wise that's identical; APM happily packed it; but at runtime
Claude Code logged for two plugins:
Plugin directory not found at path:
/Users/.../claude-skills/claudeception
/Users/.../claude-skills/semantic-search
. Check that the marketplace entry has the correct path.
The fix reverted both apm.yml (removed pluginRoot, kept
./plugins/<name> in packages — they were already full there) and
regenerated marketplace.json via APM's packaging step. Diff was ~15 lines.
metadata
fields can be silently ignored on some code paths.cc-plugin-cache-multi-version-not-recorded — handles the
different not cached at (not recorded) failure mode where
cache parents have >1 version subdir.apm-marketplace-authoring-gotchas — handles APM build-time
issues (staleness check, prettier conflicts, etc.). Cross-link
from there if updating.pluginRoot for directory
sources, this skill becomes obsolete — check release notes before
assuming the fix is still needed./Users/<user>/.local/share/claude/versions/<version> — search for
Plugin directory not found at path, pluginRoot,
metadata+pluginRoot+marketplace schema (h.object({pluginRoot: h.string().optional()...})).What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub cajias/claude-skills --plugin cc-authoring16 skills in this plugin
/apm-marketplace-authoring-gotchasEight APM-marketplace-authoring gotchas discovered during real
migrations from hand-authored .claude-plugin/marketplace.json to
APM-managed and from CC-native plugin authoring.
Use when: (1) running APM's packaging step (with or without
`--dry-run`) or its marketplace-check command in a repo with an
`apm.yml`; (2) wiring CI for an APM
marketplace; (3) the CI staleness check (repack, then `git diff
--quiet`) fails despite a clean local; (4) prettier reformats
`marketplace.json` after APM's packer writes it; (5) APM exit code 1 on
local-path-only marketplaces; (6) confused by `packages:` in apm.yml
vs `plugins:` in marketplace.json; (7) commitlint rejects a commit
with `footer-leading-blank` despite no apparent footer; (8) `apm
compile -t claude` exits 0 with zero output and no compiled plugin
appears; (9) husky+lint-staged pre-commit blocks the FIRST marketplace
commit with markdownlint `MD040/fenced-code-language` errors on a
SKILL.md file copied verbatim from `~/.claude/skills/`. The gotchas
form a chain — fixing one usually surfaces the next.
/apm-plugin-distribution-pathsCanonical authoring layout for an APM (microsoft/apm)
package, plus the decision matrix for whether you need a `marketplace:` block.
Use when: (1) you've run `apm init` and are unsure where SKILL.md / agent .md
/ command .md files belong (answer: under `.apm/`, NOT at repo root); (2)
you've authored CC-native files at `commands/agents/skills/` at repo root and
wonder if that's "right" (it works as fallback layout #3 "Claude plugin", but
it's not the canonical authoring path); (3) you're trying to choose between
the three layouts APM recognizes (one-skill repo, multi-primitive `.apm/`,
Claude plugin); (4) `apm targets` fails with "No such command" in CLI 0.12.1
(subcommand doesn't exist); (5) `apm validate` fails with "No such command"
in CLI 0.12.1 (use APM's packaging command in dry-run mode instead); (6) wondering whether
`apm compile -t claude` will generate output for a hand-authored CC-native
plugin (it won't; it's a no-op for layout #3); (7) wondering if you need a
`marketplace:` block in apm.yml (you don't, for a single-plugin repo).
Covers the canonical `.apm/` source layout, the source-to-plugin remap
table, the three-layout choice, and the four distribution paths.
/autoresearch-is-code-metric-optimizerThe `/autoresearch:autoresearch` Claude Code skill is a CODE-METRIC
OPTIMIZER (modify → verify → keep/discard loop). Use when: (1) you are
about to invoke `/autoresearch:autoresearch` to do literature / web
research (it does NOT fetch papers, search the web, or synthesize cited
reports — use `/deep-research` for that); (2) you have a measurable
target (test pass rate, perf delta, p&l, win rate, composite metric)
AND code-or-config that can be modified to hit it — that IS the right
use case, including non-traditional optimization targets like trading
strategy backtest results; (3) you're confused about when to reach for
the BASE skill vs the sub-skills `:reason` (adversarial debate) or
`:probe` (8-persona interrogation) — the base skill is for iterative
optimization with a clear verify function; the sub-skills are for
qualitative investigation when there is no verify function.
/cc-hooks-main-vs-subagentHow a Claude Code PreToolUse/PostToolUse hook can tell whether a tool call
came from the MAIN conversation thread or from a SUBAGENT (Task/Agent tool),
plus the gotchas of testing hooks via headless `claude -p`. Use when:
(1) building a hook that should apply only to the main thread (e.g.
orchestrator-only enforcement that denies Edit/Write in main but allows
subagents) or only to subagents; (2) wondering if hook input contains an
is_subagent / agent indicator — it does, but it's undocumented;
(3) a hook behaves differently than expected under `claude -p` because
CLAUDE_CODE_ENTRYPOINT is sdk-cli there and `env CLAUDE_CODE_ENTRYPOINT=cli`
does NOT survive (the CLI overwrites it); (4) a headless hook test shows
"Claude requested permissions ... but you haven't granted it yet" instead of
the hook's deny reason — the permission gate fires before the hook surfaces;
(5) you need to force the interactive code path in a headless test (use a
--settings file with an env block).
/cc-mid-session-registry-stalenessFix for two Claude Code mid-session staleness traps that fail Workflow runs
instantly (<15ms). Use when: (1) a Workflow agent() call fails with
"agent type '<name>' not found" listing only plugin/built-in agents, even
though .claude/agents/<name>.md exists with valid frontmatter — the agent
registry only loads .claude/agents/ at session START, so agent files created
mid-session are not resolvable via agentType/subagent_type until restart;
(2) re-invoking a saved workflow via Workflow({name}) runs STALE code after
you edited .claude/workflows/<name>.js — name resolution serves a cached
snapshot, so mid-session edits never reach it. Both failures look like your
code is wrong when it's actually registry caching. Fixes: launch via
Workflow({scriptPath: <live file path>}) to bypass the name cache, and
design workflow scripts with a registry-independent persona fallback
(prompt the agent to Read its own .claude/agents/<name>.md and adopt the
role) toggled by an arg like useAgentTypes:false.
/cc-plugin-cache-multi-version-not-recordedFix for Claude Code startup warning `Plugin "<name>" not cached at (not
recorded) — run /plugins to refresh`. Use when: (1) Claude Code prints a
`plugin-cache-miss` warning whose installPath is the literal string
`(not recorded)`; (2) `claude plugin list` shows the plugin as installed
with a valid version, AND
`~/.claude/plugins/installed_plugins.json` has a real `installPath` for
it, yet the warning still fires every session; (3) running `/plugins` or
reinstalling the plugin doesn't clear the warning; (4) the plugin's
cache directory at
`~/.claude/plugins/cache/<marketplace>/<plugin>/` contains TWO (or more)
version subdirectories — typically an old SHA-prefix dir and the
current one — left over from an in-place marketplace SHA bump.
Root cause: the Claude Code cache resolver (`fk8` in the binary) skips
any cache parent whose subdir count `!== 1`, returns null, and the
install-record fallback emits the warning with the hardcoded sentinel
`installPath: "(not recorded)"`. The phrase is NOT a missing config
field — it's a literal string in the error branch. Fix: delete every
stale version subdir under that plugin so exactly one remains (the one
recorded in `installed_plugins.json`).