Repository navigation
Description
Corrected below. The "Narrowing" and "Where it comes from" sections
of this report are wrong: it is not a span bound, and the trigger is not
the call expression. See the follow-up comments for the traced chain and
the real condition. The Impact section's "0 findings" was also my own
misreading. The reproducer still reproduces.
Summary
A single ordinary TypeScript template literal makes static_patterns_tool_misuse report static_parse_limit, so the file counts as partially inspected. The trigger is narrow and fully deterministic: a backtick-delimited template literal whose ${...} interpolation contains a call expression.
This is the same analyzer and reason code as #694 and #628, but a different and much narrower trigger: the backticks here are balanced, the file is valid TypeScript, and the deciding factor is the ( inside the interpolation rather than a stray backtick running to EOF. Filing separately so the JS/TS case doesn't get lost; close as a duplicate if you'd rather fold it into #694.
Versions: reproduces on v2.11.2 and v2.13.0. Linux, Python 3.12, --no-llm.
Reproducer
Two files:
skill/SKILL.md
---
name: template-literal-repro
description: Minimal reproducer for a TypeScript template literal tripping the bounded shell parser.
---
This skill does nothing. It exists only to carry the TypeScript file next to it.skill/hook.ts — one line, no shell, no commands:
export const label = (n: number): string => `${format(n)}`skillspector scan skill --no-llm --format json --output r.json
Actual
{
"total_components": 2,
"scanned_components": 1,
"coverage_percent": 50.0,
"is_complete": false,
"status": "partial",
"partially_inspected_files": 1,
"ledger_exceptions": [
{
"outcome": "partial",
"phase": "static",
"reason_code": "static_parse_limit",
"message": "A security-relevant expression exceeded a bounded static parser's span limit.",
"path": "hook.ts",
"analyzers": ["static_patterns_tool_misuse"]
}
]
}Narrowing
Calling static_patterns_tool_misuse.has_bounded_parse_exhaustion(text, lambda: None) directly:
| Input | Result |
|---|---|
`${a}:${b}` |
ok |
`${f(1)}` |
exhausted |
`${a.b()}` |
exhausted |
`${a}(${b})` |
ok |
`plain (parens) no interpolation` |
ok |
'${f(1)}' |
ok |
"${f(1)}" |
ok |
So all three of these must coincide: backtick delimiters, ${...} interpolation, and a ( inside the interpolation. Single- and double-quoted strings with identical contents are fine, which is what points at the backtick being read as a shell command substitution.
Where it comes from
has_bounded_parse_exhaustion is reached through _SHELL_COMMAND_WORD_START_RE, which lists the backtick as a command-word start character. The bounded word parser then treats the template literal as a shell backtick substitution, reads ${...} as a shell parameter expansion, and the ( inside leaves the bounded parameter-expansion scan without an end, which surfaces as static_parse_limit.
A template literal is not shell syntax, so for .ts/.tsx/.js/.jsx the backtick probably shouldn't seed a shell command word at all. (The same reasoning appears in #694's "Expected" section for Rust and Python.)
Impact
`${f(x)}` is everyday TypeScript — string formatting, logging, path building. In practice this means a TS/JS codebase cannot reach complete analysis.
Measured on a real plugin, a Claude Code hooks package of 80 files:
- 25 of 80 files flagged, all of them this pattern, e.g.
`${trimZero((n / 1000).toFixed(1))}k``${one.slice(0, max - 1)}…``${row}:${index}:${backdrop ?? 'none'}:${whole ? 'whole' : 'part'}`
- Reported coverage 67.5%,
is_complete: false - 0 findings — nothing was actually detected; the package simply can't be certified
Dropping the test directory makes the ratio worse (19 of 57), because the flagged files are the library sources. File size and line length are not the discriminator: a 49 KB file and a 1139-column file both pass, while an 11 KB file fails.
The 13 other static analyzers complete 79 of 80 files on the same package, so a single analyzer's parse bound decides the completeness number for the whole scan.
Our marketplace gates distribution on completeness, so this currently blocks an entire language ecosystem rather than one package. Happy to test a fix.
Activity
KazunoriNakajima commentedon Oct 20, 2026
Two follow-ups on the Impact section.
Correction. I wrote "0 findings — nothing was actually detected". That was wrong, and the mistake was mine, not the scanner's. A run that stops on insufficient coverage returns before classification, so its summary has empty counts; I read that emptiness as "nothing found". Classifying the saved result gives 24 findings on that package (9 HIGH). The rest of the report is unaffected — the 25 files are still flagged by the parse bound alone, and the package still cannot reach complete analysis.
Extra evidence, per file. Rather than eyeballing the pattern, I ran
static_patterns_tool_misuse.has_bounded_parse_exhaustionover all 80 files of that package under v2.11.2:So for this package the backtick is the whole cause, with nothing else contributing. All 25 are
.ts/.tsx; none is a shell script.Happy to test a patch.
KazunoriNakajima commentedon Oct 20, 2026
I traced this through v2.11.2 and my "Where it comes from" section is wrong on both points. Posting the correction since it changes what a fix would have to address.
It is not a span bound
_skip_backtick_substitutionfinds the closing backtick without trouble, and the input is nine characters, so nothing is running out of budget. The chain is:_SHELL_COMMAND_WORD_START_RE(L44)_parse_shell_command_word(L1337)_is_printf_substitution: could this substitution invokeprintf? (printf output is evaluated statically so a destructive command cannot hide behind it)_invocation_expansion_marker(L802)${...}. Anything_SIMPLE_BRACED_PARAMETER_RE(L57) does not match — i.e. anything other than${NAME},${1},${@}— is treated as a complex expansion that may nest a command substitution, and gets_DYNAMIC_SHELL_WORD_SENTINEL_consume_printf_invocation(L706)(recognized=True, exact=False)— "could be printf, basename not determinable"limited = True→static_parse_limitSo it is a deliberate fail-closed answer — I cannot rule out that this is printf — reached on input that was never shell. The parse bound itself behaves correctly.
The trigger is wider than a call expression
I said the deciding factor was the
(inside the interpolation. It is not. Two conditions:${...}, and${}is not a bare identifierIn practice what trips it is a template literal that builds a path, an id or a formatted scalar with no leading space:
`${row}:${index}`,`${n}k`,`/api/${id}`. All 25 files in the package I measured are of that shape.This also means a fix that only skips call expressions would still leave
`${a.b}`and`/api/${id}`flagged. Not seeding a shell command word from a backtick in.ts/.tsx/.js/.jsxwould cover all of them.[-]static_parse_limit: a TypeScript template literal with a call in its interpolation marks the file partially inspected[/-][+]static_parse_limit: a backtick template literal whose first word holds a non-trivial ${...} is read as a possible printf substitution[/+]fix(analyzer): stop TypeScript templates from hitting parse limits
fix(analyzer): stop TypeScript templates from hitting parse limits
fix(analyzer): stop TypeScript templates from hitting parse limits
fix(analyzer): stop TypeScript templates from hitting parse limits
esarav commentedon Nov 6, 2026
Also reproduces on v2.13.3 for JavaScript inside an HTML file's inline
<script>, not only.ts. Minimal case:has_bounded_parse_exhaustionreturnsTrue.${count}in place of${rows.length}, orrows.length+' rows', returnsFalse. In a full scan (--no-llm),static_patterns_tool_misusereportsdegradedwithstatic_parse_limiton the.htmlfile; the other two variants scan complete.#990 scopes the fix to
.ts/.tsx, so.js,.jsxand inline<script>blocks in.htmlstay affected. We hit this on a real skill bundle (a generated HTML dashboard), and the only workaround was rewriting every nested template string as+joins.fix(analyzer): stop TypeScript templates from hitting parse limits
fix(analyzer): stop TypeScript templates from hitting parse limits
fix(analyzer): stop TypeScript templates from hitting parse limits
lucas-saldanha-werneck commentedon Nov 13, 2026
More real-world cases of this trigger, all ordinary TypeScript in Claude Code plugin hook modules (
--no-llm,static_patterns_tool_misuse,static_parse_limit,parser_diagnostic.check = printf_invocation,cause = runtime_dependent). The reported span is exactly the template literal's first word:hooks/register.tsx#L58mcp__${$.plugin.name}__${name}hooks/register.tsx#L140${SHELF}${Number.MAX_SAFE_INTEGER}:${cwd}hooks/register.tsx#L202${key}:${await $.session.cwd()}hooks/register.tsx#L393${++i} · ${n}${shown(n) ? '' : ' (not shown)'}hooks/register.tsx#L129s${Date.now().toString(36)}${(idCounter++).toString(36)}So the trigger also covers member access (
$.plugin.name,Number.MAX_SAFE_INTEGER),await, prefix++and a ternary in the first word, not only call expressions.Checked on
mainat 17c4d38 and on #990's head at a2c6aae (scanning each plugin root): #990 clears theprintf_invocationcase in plan-checklist'shooks/plan.ts, but all five spans above still reportstatic_parse_limitthere. Each plugin'stests/*.test.tsxhas the same pattern (for examplemcp__assumptions-pane__${e.name}). Happy to retest a later head.agam-am-duggal commentedon Nov 17, 2026
Another real-world case, with two details that may help.
1. The trigger also fires inside a fenced
typescriptblock in a Markdown reference file, not only in a.tssource file.Minimal reproducer on v2.12.0 (macOS, Python 3.12,
--no-llm):SKILL.mdreference/guide.mdResult:
reference/guide.mdispartialwithstatic_parse_limit,parser_diagnostic.check = printf_invocation,start_line = 7; coverage 50%; oneAE1HIGH on the link inSKILL.md.2. On a public skill it adds four HIGH findings from one line.
anthropics/skillsmcp-builder/reference/node_mcp_server_v2.md#L461holds the same pattern in a documentation sample. The reported span isusers/${encodeURIComponent(user_id)}.SKILL.mdlinks to that file four times and each link gets its ownAE1HIGH. Two other reference files in the skill are also partial (expansion_boundary,command_word_boundary), and together the scan reports 10analysis-evasionfindings and ends at score 100,DO_NOT_INSTALL. Without the coverage findings the skill has 1 HIGH, 12 MEDIUM and 4 LOW.Found while wrapping SkillSpector as the static tier of a skill evaluator. We now read
analysis_completenessseparately from the security findings, which works around it on our side.fix(analyzer): stop TypeScript templates from hitting parse limits
fix(analyzer): keep member calls out of TypeScript control heads