Skip to content

Humanify claude stream-json events into the kennel log (always-on, DEBUG-like level). Also set log level to DEBUG #493

@FidoCanCode

Description

@FidoCanCode

iter_events currently logs each raw stream-json line at DEBUG — unreadable, and DEBUG isn't always on anyway. When claude stalls (see #491 / #489) we have no visibility into what claude was actually doing right before it got stuck.

Add a human-readable log trace of every stream-json event, emitted at a level we always listen to (either INFO, or a new always-on level between INFO and DEBUG if INFO would be too spammy).

Event shapes to humanify (from the stream-json transcript):

Event Rendered as
{"type":"assistant","text":"..."} claude> <text>
{"type":"tool_use","name":"Bash","input":{...}} claude tool: Bash <first 120 chars of command>
{"type":"tool_result",...} claude tool result (<N lines>)
{"type":"system","subtype":"...",...} claude system: <subtype>
{"type":"result","result":"..."} claude result: <first 200 chars>
{"type":"error",...} claude error: <message> (WARNING)

Prefix with the repo context already injected by the existing log filter so multi-repo output is disambiguated: [home] claude> ....

This should make stalls pinpointable to a specific tool call or turn rather than a silent gap in the kennel log. Follow-up to the entry/exit logging added in #489's fix, which only bounds where stalls happen; this bounds what claude was doing.

Future: route the same humanified stream to a file-per-repo rolling log so we can keep the kennel log skimmable but still have full detail on disk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions