Skip to content

claude-ops fleet-state.sh crashes on large-catalog marketplaces (Windows jq arg-length limit) #1336

Closed

Description

@kyle-sexton

Summary

skills/plugins/scripts/fleet-state.sh (claude-ops plugin, /claude-ops:plugins skill) crashes with Argument list too long when run against a marketplace whose catalog is large enough that the JSON blob no longer fits as a single command-line argument. Confirmed on Windows (Git Bash / MSYS jq, WinGet-installed jqlang.jq).

Environment

  • Claude Code: 2.1.220
  • OS: Windows 11 Pro 10.0.26200
  • Shell: Git Bash (MSYS)
  • jq: WinGet jqlang.jq, resolved at C:\Users\<user>\AppData\Local\Microsoft\WinGet\Links\jq
  • claude-ops version: 0.19.1 (skill script path: skills/plugins/scripts/fleet-state.sh)

Repro

"$HOME/.claude/plugins/cache/melodic-software/claude-ops/<version>/skills/plugins/scripts/fleet-state.sh" --marketplace claude-plugins-official

or

"$HOME/.claude/plugins/cache/melodic-software/claude-ops/<version>/skills/plugins/scripts/fleet-state.sh" --all

(--all fails the same way as soon as it reaches any large-catalog marketplace in its loop.)

Actual output

skills/plugins/scripts/fleet-state.sh: line 105: /c/Users/<user>/AppData/Local/Microsoft/WinGet/Links/jq: Argument list too long
jq: invalid JSON text passed to --argjson
Use jq --help for help with command-line options,
or see the jq manpage, or online docs at https://jqlang.org

Exit code 2, empty stdout — the marketplace is silently skipped/unusable rather than producing a degraded-but-valid report.

Root cause

fleet-state.sh passes full catalog/installed/enabled JSON blobs into jq via --argjson, e.g.:

--argjson catalog "$catalog_ids" \
--argjson installed "$installed_ids" \
...

(see lines ~333-401, plus similar patterns at 171/175/182/368/373). For a marketplace with a large catalog — reproduced against anthropics/claude-plugins-official, 273 plugins — the serialized JSON exceeds the command-line length this shell/jq combination can pass as a single argv entry. This is specifically an issue with embedding large JSON as a command-line argument; it is not a jq correctness bug.

Impact

  • Any marketplace with a catalog large enough to trip this (empirically, claude-plugins-official's 273-entry catalog does; smaller catalogs like melodic-software's ~58 entries do not) cannot be synced via /claude-ops:plugins at all — sync, audit, and converge all depend on fleet-state.sh.
  • Failure is silent from the skill's perspective (script exits 2, no partial report) — a user running /claude-ops:plugins sync all would see this marketplace simply drop out of the sweep with only the raw jq stderr as a clue.
  • Confirmed Windows-specific in my testing (Git Bash argv limits differ from Linux/macOS execve limits), but the underlying pattern — embedding a potentially-unbounded JSON blob via --argjson — is not portable regardless of platform; a sufficiently large catalog would eventually hit real OS ARG_MAX limits anywhere.

Suggested fix

Route large JSON payloads through stdin or a temp file instead of argv, e.g.:

jq -cn --slurpfile catalog <(printf '%s' "$catalog_ids") '...'

or write the value to a temp file and use --slurpfile name path, rather than --argjson name "$value". This avoids the argv-length ceiling entirely regardless of catalog size or platform.

Workaround used

Queried installed_plugins.json / the marketplace's own .claude-plugin/marketplace.json directly via jq (reading from file, not embedding as a captured argv value) instead of going through fleet-state.sh for the affected marketplace, to compute the same install/enable deltas by hand.

Activity

  1. added
    needs-triage
    on Jul 25, 2026
  2. kyle-sexton commented on Jul 25, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during triage.

    Triage

    Verified. Confirmed against plugins/claude-ops/skills/plugins/scripts/fleet-state.sh at HEAD: multiple jq invocations pass full JSON blobs via --argjson (e.g. catalog_ids, installed_ids, explicit_false_ids, known_at_mp, effective_map, and others across the catalog/installed/enabled computation), exactly the pattern the issue diagnoses as hitting the Windows argv-length ceiling on large catalogs. No fix present at HEAD.

    Classification: Bug, priority: medium (breaks fleet sync entirely for large-catalog marketplaces, but has a documented workaround and doesn't corrupt state), work-class: scoped.

    Agent Brief

    Type: Bug
    Summary: fleet-state.sh embeds JSON blobs directly as jq --argjson command-line arguments; for a marketplace catalog large enough (confirmed against a 273-plugin catalog), the serialized JSON exceeds the shell/jq combination's single-argument length ceiling and the script crashes with Argument list too long, silently dropping that marketplace from the sweep.

    Current behavior: Every --argjson <name> "$value" call embeds $value as a literal command-line argument. Once a catalog crosses the platform's argv-length limit, jq fails to parse and the script exits non-zero with no partial report — the marketplace becomes silently unusable via /claude-ops:plugins sync|audit|converge.

    Desired behavior: Large JSON payloads route through stdin or a temp file (e.g. --slurpfile) instead of argv, so catalog size never determines whether a marketplace can be synced. This should hold on every platform, not just Windows — the underlying argv-length ceiling is a real limit everywhere, only reached sooner on this platform's shell/jq combination.

    Key interfaces:

    • Every jq ... --argjson <name> "$value" call site in the fleet-state computation (catalog IDs, installed IDs, enabled-map computations, and the rest of the composed report) — convert each to a stdin/--slurpfile route.

    Acceptance criteria:

    • Running the fleet-state computation against a large catalog (200+ plugins) completes without Argument list too long.
    • Output for a large-catalog marketplace matches what the same computation would have produced for a small catalog (same fields, same semantics) — no silent truncation or partial report.
    • Existing behavior for small catalogs is unchanged.

    Out of scope:

    • Any change to what fleet-state.sh reports — only how the JSON is threaded into jq.
  3. added
    agent-ready
    and removed
    needs-triage
    on Jul 25, 2026
  4. added theissue type on Jul 25, 2026
  5. self-assigned this
    on Jul 25, 2026
  6. kyle-sexton commented on Jul 25, 2026

    @kyle-sexton
    MemberAuthor
    No description provided.
  7. kyle-sexton commented on Jul 25, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during work-loop execution.

    Claimed and worked as part of the /work-items:work-loop autonomous worker lane. Fix implemented in plugins/claude-ops/skills/plugins/scripts/fleet-state.sh: every large-payload jq --argjson call site now routes through a temp file via --slurpfile instead of embedding the JSON on the command line, closing the argv-length ceiling the issue describes. Verified against a synthetic 500-plugin catalog (exceeds the real 273-plugin repro) — reproduced the exact pre-fix Argument list too long crash against the unpatched script on the same fixture, then confirmed clean success post-fix. Two follow-on defects surfaced during verification (a temp-file cleanup leak from a subshell-local array, and a fail-loud regression on malformed source JSON) and are fixed in the same change. claude-ops bumped to 0.19.3.

    PR: #1380

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-ready

Type

Fields

No fields configured for Bug.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions