Problem
The CLI populates agent and cwd in every ProcessHookEventRequest, but the API handler never reads them:
agent — the agent type (e.g. "claude") is sent per event but discarded. Only stored once at session creation inside client_info JSON.
cwd — the working directory per event is sent but completely ignored. This means if the agent changes directories during a session, that context is lost.
Impact
- No way to filter/query events by agent type without joining to the session
- No per-event working directory in the audit trail — only the initial
cwd from session creation
- Wasted bytes on the wire (minor)
Fix
The API handler should read these fields and either:
- Store them as first-class columns on
mcp_events (preferred for queryability)
- At minimum, include them in the
request_json blob
Problem
The CLI populates
agentandcwdin everyProcessHookEventRequest, but the API handler never reads them:agent— the agent type (e.g. "claude") is sent per event but discarded. Only stored once at session creation insideclient_infoJSON.cwd— the working directory per event is sent but completely ignored. This means if the agent changes directories during a session, that context is lost.Impact
cwdfrom session creationFix
The API handler should read these fields and either:
mcp_events(preferred for queryability)request_jsonblob