diff --git a/CLAUDE.md b/CLAUDE.md index 3567915..1e34b44 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -658,7 +658,12 @@ clients whether chat is available for a given insight. - `POST /insights/chat` runs one turn of the agentic loop against the replayed history. Body: `{ file_path, library?, user_message, model?, backend?, num_ctx?, - temperature?, top_p?, top_k?, min_p?, max_iterations?, amend? }`. + temperature?, top_p?, top_k?, min_p?, max_iterations?, system_prompt?, amend? }`. + `system_prompt` is a per-turn override: in append mode (default) it's applied + ephemerally — the original system message is restored before persistence so + the stored transcript keeps its baked persona. In amend mode the override + stays in place and becomes the new insight row's system message. Mirrors the + internal `annotate_system_with_budget` swap-and-restore pattern. - `POST /insights/chat/stream` is the SSE variant — same request body, response is `text/event-stream` with events: `iteration_start`, `text` (delta), `tool_call`, `tool_result`, `truncated`, `done`, plus a server-emitted `error_message` on