--- layout: default title: Clew taste-1 nav_order: 14 --- # Clew taste-1 **Local-first preference-learning runtime for ClewCode.** Clew taste-1 learns the user's coding taste and working style from accept/reject/edit/test/lint signals and manual rules. It combines symbolic rules, semantic preference scoring, and contextual bandit optimization to adapt ClewCode's output to the user's preferences. It does **not** fine-tune the base LLM. All learning is local, online, and preference-based. ## What It Learns - **Code style**: formatting, naming conventions, preferred patterns - **Architecture**: module structure, dependency direction, layering - **Tooling**: preferred build tools, linters, test frameworks - **Testing**: test style, coverage expectations, mocking patterns - **Naming**: variable/function/class naming conventions - **Security**: safe patterns vs unsafe patterns - **Performance**: efficient algorithms, caching, resource management - **UI patterns**: component structure, state management, styling approach - **Workflow**: commit style, review preferences, deployment habits ## What It Does Not Do - Does not fine-tune or modify the base LLM - Does not send taste data to remote services (all data stays local) - Does not automatically block edits without showing a reason - Does not replace memory, skills, or CLAUDE.md files ## How It Differs from Other Systems | System | Purpose | Storage | Scope | |--------|---------|---------|-------| | **CLAUDE.md** | Project instructions | `.claude/` files | Static project rules | | **Memory** | Cross-session facts | `memdir/` | Recall | | **Skills** | Reusable procedures | Plugin/skill system | Task automation | | **taste-1** | Learned preferences | `.clew/taste1/` | Adaptive preference optimization | - Rules are explicit user preferences - Memory is facts about the user and project - Skills are reusable task procedures - Taste is learned, weighted preference signals ## Storage Paths | Data | Path | |------|------| | Project profile | `.clew/taste1/profile.json` | | Project event log | `.clew/taste1/events.jsonl` | | Project packages | `.clew/taste1/packages/` | | Global profile | `~/.clew/taste1/profile.json` | | Global packages | `~/.clew/taste1/packages/` | ## Commands | Command | Description | |---------|-------------| | `/taste1` | Show status panel | | `/taste1 status` | Print status | | `/taste1 learn ` | Add a manual rule | | `/taste1 forget ` | Remove a rule by ID | | `/taste1 profile` | Show full profile with rules | | `/taste1 events` | Show recent learning events | | `/taste1 decay` | Apply confidence decay | | `/taste1 eval` | Run profile self-evaluation | | `/taste1 export` | Export high-confidence rules | | `/taste1 import ` | Import rules from file | | `/taste1 on` | Enable taste-1 | | `/taste1 off` | Disable taste-1 | ## Configuration Settings in `settings.json`: ```json { "taste1": { "enabled": true, "autoLearn": true, "injectPrompts": true, "validateEdits": true, "minConfidence": 0.55, "maxInjectedRules": 8, "decayEnabled": true, "banditEnabled": true, "neuralScoringEnabled": true } } ``` ## Architecture Clew taste-1 consists of several subsystems: 1. **Signal Collection** — Captures accept, reject, edit, test, lint, and tool signals from user interactions and converts them into learning events. 2. **Reward Model** — Maps signal types to numeric reward values (accept = +1.0, reject = -1.0, test pass = +0.4, etc.) and computes edit distance rewards dynamically. 3. **Symbolic Engine** — Compiles high-confidence rules into checkable constraints. Rules with confidence >= 0.85 can block edit acceptance. Rules below threshold warn without blocking. Never blocks silently. 4. **Neural Scorer** — Provider-agnostic lexical similarity scoring (Jaccard/TF-IDF) that scores candidate output against active rules. Extensible to use embedding APIs when available. 5. **Contextual Bandit** — Epsilon-greedy bandit with 6 strategy arms (minimal, strict_style, architecture_first, test_first, safety_first, refactor_heavy). Selects optimal strategy based on feedback and context features. 6. **Prompt Injection** — Injects a compact `` block into the system prompt with relevant rules. Max 8 rules by default, filtered by confidence and sorted by relevance. 7. **Decay Engine** — Gradual confidence reduction for unused rules (half-life based, default 30 days). Prevents stale preferences from persisting. 8. **Event Log** — Append-only JSONL file storing all raw learning events for auditability and regression analysis. ## Continuous RL (Local Online Preference Optimization) Clew taste-1 implements **local online preference optimization**: - **Online**: learns continuously from each interaction, no batch training - **Local**: all computation and storage stays on the user's machine - **Preference-based**: optimizes for user preferences via reward signals - **Multi-objective**: balances style, correctness, safety, and efficiency The learning loop: 1. User interacts with ClewCode (accepts, rejects, edits output) 2. Signal collector captures the interaction as a typed event with reward 3. Bandit arm updates based on reward signal 4. Rule confidence adjusts based on positive/negative evidence 5. Prompt injection adapts to reflect current learned preferences 6. Decay gradually reduces stale rule confidence This is **not** LLM fine-tuning. The base model's weights never change. taste-1 adapts the prompt context and edit validation, not the model itself. ## Privacy - All taste data stays local by default - Profiles and event logs are stored in `.clew/taste1/` or `~/.clew/taste1/` - No data is sent to remote services - Export/import is explicit and user-initiated - Event logs are append-only for auditability ## Integration Points | Point | Status | Description | |-------|--------|-------------| | Prompt injection | Implemented | System prompt taste block via `TastePromptInjector` | | Edit validation | No-op stub | Ready for `PreAcceptEdit` hook wiring | | Accept/reject signals | No-op stub | Ready for tool approval flow wiring | | Test/lint signals | No-op stub | Ready for `PostToolUse` output analysis | | Tool result signals | No-op stub | Ready for `PostToolUse` hook wiring | | Settings config | Implemented | `taste1.*` in `settings.json` | ## Example Usage ``` /taste1 learn Use const instead of let /taste1 learn Prefer named exports /taste1 learn Never use any type /taste1 status /taste1 profile /taste1 eval /taste1 export ```