-
Notifications
You must be signed in to change notification settings - Fork 266
Description
What happened?
entire explain --checkpoint <id> --generate fails with a JSON parsing error. Entire expects a single JSON object from Claude CLI but Claude Code 2.x returns a JSON array when invoked with --output-format json.
$ entire explain --checkpoint 336b6c705d35 --generate
2026/03/22 00:32:21 INFO generating checkpoint summary
failed to generate summary: failed to generate summary: failed to parse claude CLI response: json: cannot unmarshal array into Go value of type summarize.claudeCLIResponse
The root cause: Claude Code 2.x --print --output-format json returns an array of objects ([{type:"system",...}, {type:"assistant",...}, {type:"result",...}]) instead of a single object. The Go struct summarize.claudeCLIResponse tries to unmarshal this array as a single object, which fails.
Auto-summarization on commit (strategy_options.summarize.enabled: true in .entire/settings.json) is also silently broken for the same reason — summaries are never generated.
Steps to reproduce
- Have Claude Code 2.x installed
- Enable summarize in
.entire/settings.json:{ "enabled": true, "strategy_options": { "summarize": { "enabled": true } } } - Make a commit (checkpoint is created without summary)
- Run
entire explain --checkpoint <id> --generate - Error:
failed to parse claude CLI response: json: cannot unmarshal array into Go value of type summarize.claudeCLIResponse
You can verify the format change by running:
echo "hello" | claude --print --output-format json --max-turns 1
# Returns: [{...}, {...}, {...}] ← array, not objectEntire CLI version
Entire CLI 0.5.1 (d46fdc2), Go version: go1.26.1, OS/Arch: linux/amd64
OS and architecture
Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 (WSL2)
Agent
Claude Code 2.1.81
Terminal
Bash (WSL2)
Logs / debug output
$ entire explain --checkpoint 336b6c705d35 --generate
2026/03/22 00:32:21 INFO generating checkpoint summary
failed to generate summary: failed to generate summary: failed to parse claude CLI response: json: cannot unmarshal array into Go value of type summarize.claudeCLIResponseAdditional context
- Related to Explain command: failed to generate summary #334 (same
explain --generatecommand, different error) - The fix would likely involve parsing the JSON array and extracting the
resultobject (last element withtype: "result") instead of trying to unmarshal the entire response as a single object - Git version: 2.47.2, shell: bash