Skip to main content

Module plugin_shadow

Module plugin_shadow 

Source
Expand description

Plugin-shadow detector (Claude Code).

The runner stages eval skills into each dispatch’s project-local .claude/skills/ dir, but every claude -p dispatch ALSO loads the user/global plugins and the global skills dir from its Claude config. When a staged skill name collides with one of those, both copies are discoverable and the with/without comparison is contaminated. The runner cannot strip an installed plugin from a dispatch, so this module only detects and reports the overlap, reading declared settings as a best-effort proxy. The report/banner shapes are harness-neutral and live in skill_shadow.

Functions§

config_dir_from_env
The Claude Code config dir, reading the CLAUDE_CONFIG_DIR override from the environment (else ~/.claude). Thin convenience over resolve_config_dir for the call sites that should honor the env var — the override logic itself is covered by resolve_config_dir’s tests.
detect_plugin_shadows
Which of staged_skill_names are also discoverable from enabled plugins or the global skills dir. Matches on the skill folder name (exact).
resolve_config_dir
The Claude Code config dir: a non-empty CLAUDE_CONFIG_DIR override (passed in), else ~/.claude.
shadow_preflight
The build-time preflight: Some(report) only when a staged name is shadowed. config_dir is passed in so the env-reading caller (the adapter’s detect_shadowed_skills) stays a thin wrapper.