fix: save full Claude session log on no_push for debugging #49

Closed
opened 2026-03-29 07:23:09 +00:00 by dev-bot · 0 comments
Collaborator

Problem

When the dev-agent fails with no_push, there is no way to see what the model actually did — which files it read, what tool calls it made, what thinking traces it produced. Debugging requires manually finding the session JSONL in the Claude config dir, which gets cleaned up with the worktree.

Current state

We added agent-run-last.json output capture (the final result JSON). But this only shows the last turn's result text, not the full conversation — no tool calls, no thinking, no intermediate steps.

Fix

On no_push, before cleaning up the worktree, copy the full session JSONL to a persistent location:

In dev/dev-agent.sh, in the no_push handler:

# Save full session log for debugging
session_log="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/projects/$(echo "$WORKTREE" | tr '/' '-'  | sed 's/^-//')/${_AGENT_SESSION_ID}.jsonl"
if [ -f "$session_log" ]; then
  cp "$session_log" "${DISINTO_LOG_DIR}/dev/no-push-session-${ISSUE}-$(date +%s).jsonl"
  log "no_push session log saved"
fi

This gives full visibility: every Read, Edit, Bash call, every thinking trace, every text response.

Also consider

  • Log a summary (number of tool calls by type, total turns, which files were read/edited)
  • Alert if the model attempted tool calls that failed (curl to external URLs, apt-get, etc.)

Affected files

  • dev/dev-agent.sh — no_push handler
## Problem When the dev-agent fails with `no_push`, there is no way to see what the model actually did — which files it read, what tool calls it made, what thinking traces it produced. Debugging requires manually finding the session JSONL in the Claude config dir, which gets cleaned up with the worktree. ## Current state We added `agent-run-last.json` output capture (the final result JSON). But this only shows the last turn's result text, not the full conversation — no tool calls, no thinking, no intermediate steps. ## Fix On `no_push`, before cleaning up the worktree, copy the full session JSONL to a persistent location: In `dev/dev-agent.sh`, in the no_push handler: ```bash # Save full session log for debugging session_log="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/projects/$(echo "$WORKTREE" | tr '/' '-' | sed 's/^-//')/${_AGENT_SESSION_ID}.jsonl" if [ -f "$session_log" ]; then cp "$session_log" "${DISINTO_LOG_DIR}/dev/no-push-session-${ISSUE}-$(date +%s).jsonl" log "no_push session log saved" fi ``` This gives full visibility: every Read, Edit, Bash call, every thinking trace, every text response. ## Also consider - Log a summary (number of tool calls by type, total turns, which files were read/edited) - Alert if the model attempted tool calls that failed (curl to external URLs, apt-get, etc.) ## Affected files - `dev/dev-agent.sh` — no_push handler
dev-bot added the
backlog
label 2026-03-29 07:23:09 +00:00
dev-qwen self-assigned this 2026-03-29 11:12:37 +00:00
dev-qwen added
in-progress
and removed
backlog
labels 2026-03-29 11:12:37 +00:00
dev-qwen removed their assignment 2026-03-29 11:45:23 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: johba/disinto#49
No description provided.