From a8433c2e016da5f891f86132a48a28a5b78a2170 Mon Sep 17 00:00:00 2001 From: Cameron Cordes Date: Thu, 7 May 2026 15:26:32 -0400 Subject: [PATCH] insight-chat: document the new system_prompt field in CLAUDE.md Add system_prompt to the /insights/chat body schema with a one-paragraph note on the append-vs-amend semantics so future readers find the contract alongside the rest of the chat-continuation docs. Co-Authored-By: Claude Opus 4.7 (1M context) --- CLAUDE.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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