record_user_preference
Store explicit user preferences and query-rewrite corrections in persistent memory so future interactions honor clarified intent and improve retrieval accuracy across sessions.
Instructions
Store an explicit user preference or query-rewrite correction.
Standard preferences (preference_key = any label): Store as: record_user_preference("response_format", "code-first, then explanation") Surfaced via get_user_profile()['explicit_preferences'].
Query-rewrite corrections (preference_key = "query_rewrite"): Use when you asked for X but user says they actually meant Y. Store the wrong phrasing as preference_value, intent in context: record_user_preference("query_rewrite", "deploy model", context="user means: update the ML model weights in production, not software deploy") Stored in query_rewrites list; agents apply these before retrieval so future similar queries hit the right code even when phrasing is off.
Persona selection (preference_key = "persona", COGNIREPO-402): Opt-in only — never enable a persona without the user explicitly asking. Valid values: "mentor" (deeper retrieval + full explanations + links to history), "pair" (default-equivalent, mood-aware phrasing), "caveman" (economy/telegraphic output, see COGNIREPO-403). "none" clears a previously-set persona (COGNIREPO-400-D01) — not a 4th persona. An unknown value is rejected, not stored — response includes {"recorded": false, "error": "..."}. Surfaced via get_user_profile()['active_persona'] / ['persona_behavior']. Precedence: explicit user request > persona > framing_hints/mood (see CLAUDE.md).
Claude: call this when:
User corrects your interpretation ("no, I meant X not Y")
User expresses a repeated preference ("always show code first")
User clarifies what a query actually means in this codebase
Do NOT call for one-off answers — only for durable preferences that should persist across sessions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | No | ||
| repo_path | No | ||
| preference_key | Yes | ||
| preference_value | Yes |