Skip to content

fix(claude): use temp file for plugin list to avoid 64KB pipe truncation#38

Merged
bojanrajkovic merged 1 commit into
mainfrom
fix/pipe-truncation-large-plugin-list
Mar 17, 2026
Merged

fix(claude): use temp file for plugin list to avoid 64KB pipe truncation#38
bojanrajkovic merged 1 commit into
mainfrom
fix/pipe-truncation-large-plugin-list

Conversation

@bojanrajkovic
Copy link
Copy Markdown
Contributor

Summary

  • The claude CLI (Node.js) truncates stdout at 64KB when writing to an OS pipe
  • With enough installed plugins, claude plugin list --json --available exceeds this limit, causing unexpected end of JSON input on startup
  • Fix: write CLI stdout to a temp file instead of a pipe buffer, which has no size limit

🤖 Generated with Claude Code

The claude CLI (Node.js) can truncate stdout at 64KB when writing to a
pipe. With enough installed plugins, `claude plugin list --json
--available` exceeds this limit, causing "unexpected end of JSON input"
on startup. Writing to a temp file instead of a pipe buffer avoids this.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bojanrajkovic
Copy link
Copy Markdown
Contributor Author

Test plan

  • mise run ci passes (fmt, vet, lint, test, build)
  • On a machine with >64KB of claude plugin list --json --available output, verify cpm launches without "unexpected end of JSON input"
  • On a machine with few plugins (<64KB output), verify cpm still works normally
  • Verify temp file is cleaned up after use (no /tmp/cpm-plugins-*.json files left behind)

@github-actions
Copy link
Copy Markdown

PR Build

Version: 0.3.3-pr.38+526efd1

Platform Archive
Linux (amd64) cpm-linux-amd64
Linux (arm64) cpm-linux-arm64
macOS (universal) cpm-macos-universal
Windows (amd64) cpm-windows-amd64

Download artifacts

Built from 14d7f25

@bojanrajkovic bojanrajkovic merged commit 1247d45 into main Mar 17, 2026
6 checks passed
@bojanrajkovic bojanrajkovic deleted the fix/pipe-truncation-large-plugin-list branch March 17, 2026 02:08
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.

1 participant