Skip to content

fix: the capture skill could not find its own scripts on Claude Code - #6

Merged
aoc81 merged 1 commit into
mainfrom
fix/skill-script-paths
Sep 30, 2026
Merged

aoc81 merged 1 commit into
mainfrom
fix/skill-script-paths

Conversation

@aoc81

@aoc81 aoc81 commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Summary

The capture skill found recall.py (the capture-time overlap check) and scan_secrets.py (the capture-time secret scan) with R="${CLAUDE_PLUGIN_ROOT:+${CLAUDE_PLUGIN_ROOT}/scripts/}recall.py". On Claude Code, CLAUDE_PLUGIN_ROOT is not in the Bash tool's environment (per the plugin docs), and skill text only gets the exact token ${CLAUDE_PLUGIN_ROOT} substituted (I confirmed this in the CLI). The :+ form therefore expanded to nothing, and the snippet fell through to the Codex path ~/.codex/lore/…, which doesn't exist on a Claude Code install. Both write-time guards failed, leaving only the pre-push hook and CI as backstops.

The fix uses the literal token. Claude Code substitutes the plugin path. Codex substitutes nothing, the resulting /scripts/… path doesn't exist, and the existing fallback picks the installed copy as before. The slash commands already used the literal form.

Test plan

  • The skill's two locator snippets run in sh the way each target runs them: Claude Code with the token substituted and the variable unset; Codex with no substitution and the scripts under ~/.codex/lore. There is also a static check that skill and command text spells the variable no other way. The Claude Code cases and the static check fail on main.
  • python -m unittest discover -s tests: 172 passed, 1 skipped. The sh cases are skipped on Windows; the static check runs everywhere.
  • Merges cleanly with the other two v0.5.2 branches in any order.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DMXx6BJswH6xiwdqrwQnEf


Generated by Claude Code

The skill locates recall.py (the capture-time overlap check) and
scan_secrets.py (the capture-time secret scan) with

    R="${CLAUDE_PLUGIN_ROOT:+${CLAUDE_PLUGIN_ROOT}/scripts/}recall.py"
    [ -f "$R" ] || R="$HOME/.codex/lore/recall.py"

That only works if CLAUDE_PLUGIN_ROOT is set in the shell, and on Claude Code
it is not: the plugin docs state the variable is absent from the environment
of commands run through the Bash tool, and in skill/command text Claude Code
substitutes only the exact token `${CLAUDE_PLUGIN_ROOT}` (checked in the CLI:
a plain replace of that literal). The `:+` form is left alone, expands to
nothing, and the snippet falls through to the Codex path -- which does not
exist on a Claude Code install:

    Claude Code   R = $HOME/.codex/lore/recall.py      (missing file)
    Codex         R = $HOME/.codex/lore/recall.py      (correct)

So on Claude Code both write-time guards failed: the overlap check that stops
near-duplicates, and the scan that catches a secret before it is committed
(leaving only the pre-push hook and CI as backstops).

Use the literal token, which Claude Code substitutes with the plugin path.
Codex does no substitution, the shell sees an unset variable, the path
becomes `/scripts/recall.py`, and the existing fallback picks the installed
copy exactly as before. The slash commands already used the literal form.

Tests: the skill's two locator snippets run in `sh` as each target would run
them (Claude Code: token substituted, variable unset; Codex: no substitution,
scripts under ~/.codex/lore), plus a static check that skill and command
text uses no other spelling of the variable. The Claude Code cases and the
static check fail without the change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DMXx6BJswH6xiwdqrwQnEf
@aoc81
aoc81 merged commit ff84dea into main Sep 30, 2026
6 checks passed
@aoc81 aoc81 mentioned this pull request Sep 30, 2026
2 of 3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants