Repository navigation
fix: the capture skill could not find its own scripts on Claude Code - #6
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The capture skill found
recall.py(the capture-time overlap check) andscan_secrets.py(the capture-time secret scan) withR="${CLAUDE_PLUGIN_ROOT:+${CLAUDE_PLUGIN_ROOT}/scripts/}recall.py". On Claude Code,CLAUDE_PLUGIN_ROOTis 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
shthe 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 onmain.python -m unittest discover -s tests: 172 passed, 1 skipped. Theshcases are skipped on Windows; the static check runs everywhere.🤖 Generated with Claude Code
https://claude.ai/code/session_01DMXx6BJswH6xiwdqrwQnEf
Generated by Claude Code