Skip to content

Add claude-stream-shim action for beautified Claude Code output#22

Merged
nsheaps merged 1 commit into
mainfrom
claude/stream-action-output-UtYyT
May 16, 2026
Merged

Add claude-stream-shim action for beautified Claude Code output#22
nsheaps merged 1 commit into
mainfrom
claude/stream-action-output-UtYyT

Conversation

@nsheaps
Copy link
Copy Markdown
Owner

@nsheaps nsheaps commented May 16, 2026

Summary

Adds a new GitHub Action that beautifies anthropics/claude-code-action output by streaming Claude's JSON through claude-stream for a live chatroom view in workflow logs.

Changes

  • New Action: claude-stream-shim - A composite action that:

    • Installs claude-stream from nsheaps/claude-utils
    • Installs the claude CLI via npm
    • Creates a shim binary that tees Claude's stream-json stdout through claude-stream to stderr
    • Gracefully handles missing dependencies (falls back to passthrough mode)
    • Includes safeguards against recursive invocation if the shim is accidentally placed on PATH
  • Updated README - Documents the new action with:

    • Usage example showing integration with anthropics/claude-code-action
    • Description of how to suppress raw JSON output while displaying the live chatroom view
    • Output variable documentation

Implementation Details

The shim is a bash wrapper that:

  • Locates the real claude binary installed by npm
  • Pipes its output through claude-stream to stderr while preserving stdout for the calling action
  • Uses PIPESTATUS to maintain the original exit code
  • Falls back gracefully if claude-stream is unavailable (logs warning but continues)
  • Avoids infinite recursion by filtering its own directory from PATH when searching for the real binary

Configurable inputs allow specifying versions of both claude-utils and @anthropic-ai/claude-code.

https://claude.ai/code/session_01FNyYwqkK5828bq8nWE941N

Wraps anthropics/claude-code-action's claude binary via
path_to_claude_code_executable. The shim tees claude's stream-json stdout
through claude-stream (from nsheaps/claude-utils) so the workflow log shows
a live colored chatroom view as Claude produces tokens, instead of raw JSON.

Callers set show_full_output: false on the underlying action; the shim
streams the chatroom view to the log via claude-stream's stderr.
@nsheaps nsheaps enabled auto-merge (squash) May 16, 2026 04:41
@nsheaps nsheaps merged commit 100f5b4 into main May 16, 2026
2 checks passed
@nsheaps nsheaps deleted the claude/stream-action-output-UtYyT branch May 16, 2026 04:42
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.

2 participants