record_user_preference
Store user preferences and query corrections to persistently adapt responses. Correct misinterpretations and apply repeated preferences 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.
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 |
|---|---|---|---|
| preference_key | Yes | ||
| preference_value | Yes | ||
| context | No | ||
| repo_path | No |