Skip to content

Conversation

@ellyxir
Copy link
Contributor

@ellyxir ellyxir commented Oct 30, 2025

Summary by cubic

Add a small bash script to parse Claude JSON logs and stream only assistant text content.
Works with stdin or files; uses line-buffered grep and unbuffered jq for real-time output.

Written for commit 93f7b19. Summary will update automatically on new commits.

@ellyxir ellyxir requested a review from seefeldb October 30, 2025 19:57
@ellyxir ellyxir self-assigned this Oct 30, 2025
@ellyxir ellyxir force-pushed the ellyse/extract-json-script branch from 3323225 to 304ef30 Compare October 30, 2025 19:58
@ellyxir ellyxir marked this pull request as ready for review October 30, 2025 20:04
@ellyxir ellyxir merged commit aedc2f5 into main Oct 30, 2025
2 checks passed
@ellyxir ellyxir deleted the ellyse/extract-json-script branch October 30, 2025 20:04
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="scripts/extract-text.sh">

<violation number="1" location="scripts/extract-text.sh:2">
Filtering on a top-level type of &quot;assistant&quot; means the script never forwards Claude streaming events (which are typed message_start/message_delta/etc.), so it outputs nothing. Please match on the assistant role and feed the real content structure to jq.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
grep --line-buffered -E '^\{"type":"assistant"' "$@" | jq --unbuffered -r '.message.content[]? | select(.type=="text") | .text'
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filtering on a top-level type of "assistant" means the script never forwards Claude streaming events (which are typed message_start/message_delta/etc.), so it outputs nothing. Please match on the assistant role and feed the real content structure to jq.

Prompt for AI agents
Address the following comment on scripts/extract-text.sh at line 2:

<comment>Filtering on a top-level type of &quot;assistant&quot; means the script never forwards Claude streaming events (which are typed message_start/message_delta/etc.), so it outputs nothing. Please match on the assistant role and feed the real content structure to jq.</comment>

<file context>
@@ -0,0 +1,2 @@
+#!/usr/bin/env bash
+grep --line-buffered -E &#39;^\{&quot;type&quot;:&quot;assistant&quot;&#39; &quot;$@&quot; | jq --unbuffered -r &#39;.message.content[]? | select(.type==&quot;text&quot;) | .text&#39;
</file context>
Fix with Cubic

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