Problem
Two fields from Claude Code's hook stdin JSON are parsed but dropped before reaching the backend:
1. Claude Code's native session_id
- Parsed by the claude adapter in
DecodeHookInput
- Stored in
agent.HookEvent.SessionID
- Dropped in
main.go's evaluateViaSidecar() — the EvaluateRequest struct has no SessionID field
- The Kontext session ID is used instead, so Claude Code's own session identity is lost
2. permission_mode
- Parsed by the claude adapter's
hookInput struct
- Dropped at the adapter layer — never transferred to
agent.HookEvent
- This field indicates whether Claude Code is running in
default, plan, or bypassPermissions mode — important security context
Impact
- Cannot correlate Kontext events back to a specific Claude Code session (matters when multiple Claude instances share a Kontext session)
- No visibility into whether the agent was running with permissions bypassed — critical for audit/compliance
Fix
- Add
SessionID and PermissionMode fields to sidecar.EvaluateRequest
- Add corresponding fields to the proto
ProcessHookEventRequest
- Store both in the events table
Problem
Two fields from Claude Code's hook stdin JSON are parsed but dropped before reaching the backend:
1. Claude Code's native
session_idDecodeHookInputagent.HookEvent.SessionIDmain.go'sevaluateViaSidecar()— theEvaluateRequeststruct has noSessionIDfield2.
permission_modehookInputstructagent.HookEventdefault,plan, orbypassPermissionsmode — important security contextImpact
Fix
SessionIDandPermissionModefields tosidecar.EvaluateRequestProcessHookEventRequest