Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions assistant/hook-templates/debug-prompt-logger/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ echo "" >&2

if ! command -v jq >/dev/null 2>&1; then
echo "(jq not found — install jq for formatted output)" >&2
printf '%s' "$data" | dd bs=3000 count=1 >&2 2>/dev/null
printf '%s' "$data" >&2
echo "" >&2
echo "════════════════════════════════════════════════════════════════" >&2
echo "" >&2
exit 0
fi

# System prompt (first 2000 chars)
# System prompt
echo "── System Prompt ──────────────────────────────────────────────" >&2
printf '%s' "$data" | jq -r '.systemPrompt // "N/A"' | dd bs=2000 count=1 >&2 2>/dev/null
printf '%s' "$data" | jq -r '.systemPrompt // "N/A"' >&2
echo "" >&2
echo "" >&2

Expand All @@ -34,19 +34,19 @@ toolCount=$(printf '%s' "$data" | jq -r '.toolCount // 0')
echo "Model: $model | Messages: $msgCount | Tools: $toolCount" >&2
echo "" >&2

# Last 10 messages (compact)
echo "── Recent Messages (last 10) ──────────────────────────────────" >&2
# All messages
echo "── Messages ───────────────────────────────────────────────────" >&2
printf '%s' "$data" | jq -r '
.messages[-10:][] |
.messages[] |
"\(.role): " + (
if (.content | type) == "string" then
.content[:200]
.content
Comment thread
siddseethepalli marked this conversation as resolved.
elif (.content | type) == "array" then
[.content[] |
if .type == "text" then .text[:200]
elif .type == "tool_use" then "[tool_use: \(.name)]"
elif .type == "tool_result" then "[tool_result: \(.content // "" | tostring | .[:100])]"
else "[" + .type + "]"
if .type == "text" then .text
elif .type == "tool_use" then "[tool_use: \(.name)] \(.input | tostring)"
elif .type == "tool_result" then "[tool_result: \(.content // "" | tostring)]"
else "[" + .type + "] " + (. | tostring)
end
] | join(" | ")
else
Expand Down