ReferenceCheck has no pattern for bare command paths, so 32 broken `bun ~/.claude/...` invocations in the shipped payload go unreported
LIFEOS/TOOLS/ReferenceCheck.ts only recognises a path reference when it carries a delimiter — a backtick, a table pipe, or an arrow. A path sitting bare on a shell command line matches nothing. Since that is exactly how every runnable command in a LifeOS workflow is written, the tool validates the references that are illustrative and misses the ones that actually execute.
The ``` fence skip compounds this, but it is the smaller half and I want to be precise about the split, because it determines whether a fix works: of the 32 broken invocations in the payload, 28 are missed because of the absent bare-path pattern and 4 because of the fence skip. Disabling the fence skip alone surfaces 4 and leaves all 14 skills/art hits invisible.
Verified against a fresh read-only clone of main at d1d6240. Distinct from #1541, which covered the missing-reference count, the absent invoker, and orphan scope — none of those touch reference-pattern coverage.
Why it matters
A broken prose path costs a reader one confused minute. A broken command path is a workflow step that fails when the assistant runs it, in the middle of a task, with the user watching — and the shipped payload has 32 of them. ReferenceCheck reports the payload clean on all 32.
Two of the 32 are already known to you and I'm not re-reporting them, but they're worth noting here because of how they were found: skills/_HARVEST/Tools/harvest.ts (#1577) and the private-skill references generally (#1504) both reached a release and were caught by users rather than by the validator. That is the pattern this gap produces.
Where it is
The primary cause — no pattern matches a bare path. REF_PATTERNS (lines 286-305) captures the ~/.claude/… form only when it is backtick-quoted (backtick-home, line 290). A command line writes the path bare, so nothing matches it — inside a fence or outside one. Payload-wide there are 337 tilde-form command invocations against 7 $HOME-form ones, and all 42 broken invocations are tilde-form, so this pattern gap accounts for essentially the whole population.
The secondary cause — the fence skip. ReferenceCheck.ts:355-371 builds a bitmap of character positions inside ``` fences, gated at :379 to .md files, and line 413 drops matches inside it:
// ReferenceCheck.ts:412-413
// Skip refs inside ``` code fences (usually examples, not live refs)
if (fences && fences[m.index] === 1) continue;
The rationale at lines 352-354 is sound and I'd keep the heuristic — for illustrative prose paths it is doing exactly the right thing. It only bites the $HOME form, which json-home (line 304) does match unquoted; that is where the 4 come from.
The reason the split matters: patching the fence skip is the intuitive fix and it would leave 28 of the 32 still invisible.
Minimal reproduction
The fenced and unfenced cases are both included, because the contrast is the point — the bare path is missed either way.
git clone --depth 1 https://github.com/danielmiessler/LifeOS && cd LifeOS
mkdir -p /tmp/fx/.claude/LIFEOS/TOOLS /tmp/fx/.claude/skills/Demo
cp LifeOS/install/LIFEOS/TOOLS/ReferenceCheck.ts /tmp/fx/.claude/LIFEOS/TOOLS/
cat > /tmp/fx/.claude/skills/Demo/SKILL.md <<'EOF'
# Demo
Prose reference: `hooks/NotThere.hook.ts`
Bare path outside any fence: bun run ~/.claude/skills/Demo/Tools/OutsideFence.ts
Inside a fence, the real-world shape:
```bash
bun run ~/.claude/skills/Demo/Tools/InsideFence.ts --flag
```
EOF
cd /tmp/fx/.claude/LIFEOS/TOOLS && HOME=/tmp/fx bun ReferenceCheck.ts
Actual:
❌ MISSING REFERENCES (1):
skills/Demo/SKILL.md:3 → hooks/NotThere.hook.ts
ReferenceCheck: 2 files, 1 refs, 1 missing, 0 stale, 0 orphan — 4ms
All three references are broken. The backticked prose path is caught; both executable paths are not, and the unfenced one shows this isn't fence behaviour.
This shape is not contrived — it is Art/Workflows/Frameworks.md:279 and eleven of its siblings, which is issue #1677.
What is in the payload today
Scanning LifeOS/install for command invocations inside fences — (bun|bunx|node|tsx) [run] {~|$HOME}/.claude/<path> — finds 302 invocations, of which 35 name a path that is not in the payload. Three are deliberate documentation placeholders (hooks/my-hook.ts, hooks/my-custom-hook.ts, skills/SkillName/Tools/ToolName.ts). The other 32:
| Invoked path | Hits | Status |
|---|---|---|
skills/art/Tools/Generate.ts |
14 | Ships as skills/Art/ — lowercase fails on Linux and any case-sensitive FS |
Templates/Tools/RenderTemplate.ts |
5 | No Templates/ in the payload |
filesystem-mcps/apify/*.ts |
5 | No filesystem-mcps/ in the payload |
skills/_HARVEST/Tools/harvest.ts |
3 | Private skill, not in the release (same class as #1504) |
LIFEOS/ARBOL/Actions/{lifeos,lib/runner.v2,lib/pipeline-runner}.ts |
3 | No LIFEOS/ARBOL/Actions/ in the payload |
LIFEOS/TOOLS/RelationshipReflect.ts |
1 | Not present |
skills/Evals/EvalServer/cli-run.ts |
1 | Not present |
The skills/art group is the one I would look at first: skills/Art/Tools/Generate.ts exists, so this is a pure case mismatch across 14 workflow files, invisible on macOS and fatal on Linux. I filed that separately as #1677 since the find/replace is independent of anything here — it also serves as the worked example for why this gap matters, since none of those 14 are reportable by the validator today.
Reproduce the scan:
cd LifeOS/install
grep -rEn '(bun|bunx|node|tsx)( run)? ~/\.claude/[A-Za-z0-9_@./-]+\.(ts|sh|js|md)' --include='*.md' . | wc -l # 335 raw hits
(302 is the fenced subset after the same fence walk ReferenceCheck performs; the raw grep also catches inline mentions.)
And confirm none are currently reported:
mkdir -p /tmp/rc && cp -R LifeOS/install /tmp/rc/.claude
cd /tmp/rc/.claude/LIFEOS/TOOLS && HOME=/tmp/rc bun ReferenceCheck.ts --quiet \
| grep -E 'Generate\.ts|harvest\.ts|RenderTemplate|cli-run|RelationshipReflect|apify/get-'
# (no output)
Suggested direction
Deleting the fence skip is the wrong fix twice over: it surfaces only 4 of the 32, and it adds 51 findings (259 → 310) that are mostly genuine illustration — from './lib/identity' in hook code samples, Workflows/WorkflowOne.md in CreateSkill templates. The fence heuristic is correct for what it was written for, and a permanently-half-red report is worse than none.
A narrower shape that seems to work: add one pattern for command invocations and exempt only that label from the fence bitmap.
// New pattern — executable invocation, tilde or $HOME form, unquoted:
{ re: new RegExp('(?:bun|bunx|node|tsx)(?:\\s+run)?\\s+(?:~|\\$\\{?HOME\\}?)\\/\\.claude\\/([\\w/@.-]+?' + EXT + ')', 'g'),
label: 'fenced-command' },
// Line 413 becomes:
if (fences && fences[m.index] === 1 && !FENCE_EXEMPT_LABELS.has(label)) continue;
with FENCE_EXEMPT_LABELS = new Set(['fenced-command']) kept deliberately tiny, plus a small placeholder skip so the three documentation examples above (my-hook.ts, SkillName, etc.) do not become noise.
Applied against the staged payload this moves refs 1558 → 1897 and surfaces 36 command references, of which the only noise is the three placeholders above. The design question of where to draw the exempt set is genuinely yours — that is the one thing here I would not decide for you.
Filing as a report rather than a PR, per the README note that the public repo is generated from a private source tree. Happy to send the patch if that ports more easily than a description.
A further verification pass turned up a third mechanism I missed, plus two numbers of mine that need correcting. The third one makes the issue stronger, so I'd rather add it than leave it out.
Third mechanism: backtick-home anchors the backtick against the tilde
REF_PATTERNS line 290 is:
{ re: new RegExp('`~\\/\\.claude\\/([\\w/@.-]+?' + EXT + ')`', 'g'), label: 'backtick-home' },
The opening backtick must sit immediately before ~. So an inline-backticked command — `bun ~/.claude/LIFEOS/TOOLS/Foo.ts` — never matches, because the leading bun is inside the backticks. These are outside fences, so the fence bitmap is irrelevant to them; they're missed by pattern coverage alone.
Real instances in the payload:
skills/Art/SKILL.md:354—`bun ~/.claude/LIFEOS/TOOLS/RemoveBg.ts`skills/CMUX/SKILL.md:11andskills/CMUX/DESIGN.md:33skills/Interview/SKILL.md:44,:50,skills/Interview/Workflows/ContextCheckin.md:40,:232skills/Upgrade/Workflows/Upgrade.md:89
So the accurate breakdown of what hides executable references is three mechanisms, not two: the absent bare-path pattern (the bulk), the backtick anchor above, and the fence skip (4).
Corrections to my numbers
The proposed fix yields more than the 32 I documented. Applied against the payload it produces 42 new findings, not 32. The extra ten are the three placeholders I flagged, plus six of the backtick-anchor cases above, plus one additional unfenced apify hit. A maintainer applying the patch and expecting 32 would reasonably wonder what went wrong — it's the fix quietly repairing a class my write-up didn't name.
"No false positives I could find" was too strong. The patch also surfaces LIFEOS/USER/CUSTOMIZATIONS/ARBOL/Workers/_A_AMBER_LEDGER/Tools/InstallAmberRoute.ts (from BackgroundServices.md:59). EXCLUDE_PATH_PREFIXES already lists LIFEOS/USER/CUSTOMIZATIONS/ARBOL at line 81 as a private worker tree, so that one is expected-absent and the placeholder skip should extend to CUSTOMIZATIONS/ generally.
The repro grep doesn't quite produce the 302. The command I gave matches only the ~/ form; its fenced subset is 297. Reaching 302 needs the $HOME form too — widen it to (~|\$\{?HOME\}?). None of the 32 are affected, since all five $HOME-form fenced hits resolve.
One structural suggestion, revised
Rather than a parallel FENCE_EXEMPT_LABELS set keyed on a string label, it may be cleaner to put the exemption on the pattern record itself — an optional fenceSafe?: true on the REF_PATTERNS entry, tested at the skip. Same line count, and the exemption can't drift out of sync with the pattern list. For the placeholders, the noise filter at line 401 already tests raw.includes('$SkillName'); relaxing that to SkillName and adding the two my-hook names clears all three inside the existing block.
Fixed, using the fenceSafe shape from your follow-up rather than a parallel label set — that was the right call. The checker now sees bare bun ~/.claude/... invocations, which made 381 previously-invisible references visible.
Your count was 42; mine came out at 11 surfaced. Of those, 7 were genuinely broken and are fixed (5 pointing at a Templates/Tools/RenderTemplate.ts path that lives under skills/Prompting/, plus two stale UpdatePaiState.ts references). The other 4 are now filtered rather than "fixed", deliberately: 3 are placeholders in authoring guides (hooks/my-hook.ts and friends) and 2 are migration prose that tells the installer to go find and delete those exact stale paths — "fixing" either class would have been wrong.
One larger thing your issue led us to that we have NOT fixed yet, and you should know about: the backtick-anchored pattern's top-level anchor list is case-sensitive and contains LifeOS but not LIFEOS, so every backticked `LIFEOS/…` path — the dominant convention in this tree, including most of the routing table — is matched by no pattern at all and never validated. It's a one-token change with an unpredictable blast radius on a checker currently reporting zero missing, so it gets its own pass rather than riding along with this. Credited in source.