Agent skill

Optimize Classifier

by coyvalyss1 in coyvalyss1/model-matchmaker

Analyze your Model Matchmaker override patterns and tune the local classifier to match your preferences.

MITAuto-check passed

Install Optimize Classifier

skills CLI
$ npx skills add coyvalyss1/model-matchmaker --skill optimize-classifier -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install coyvalyss1/model-matchmaker optimize-classifier --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/coyvalyss1/model-matchmaker.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/optimize-classifier .claude/skills/optimize-classifier && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
optimize-classifier
GitHub stars
168
Token cost
~1.8k tokens
SKILL.md length
582 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

Analyze your Model Matchmaker override patterns and tune the local classifier to match your preferences.

  • Works in 6 steps: Read and Validate Log File → Analyze Override Patterns → Extract Keyword Candidates → …
  • SKILL.md covers What This Skill Does, Instructions for the AI and Next Steps
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Optimize Classifier is an agent skill from coyvalyss1/model-matchmaker. Analyze your Model Matchmaker override patterns and tune the local classifier to match your preferences. Use after collecting 50+ recommendations.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Local hook for Cursor and Claude Code that routes prompts to the right model tier. Stop paying Opus prices to rename files. The licence is MIT.

Example prompts

  • “/optimize-classifier”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Read and Validate Log File
  2. Analyze Override Patterns
  3. Extract Keyword Candidates
  4. Generate Proposed Changes
  5. Calculate Impact
  6. Present Recommendations

What it can do on your machine

Read from SKILL.md and the folder at commit 4b99e64. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Optimize Classifier loads about 1.8k tokens when it runs. Until then it costs about 42 tokens; SKILL.md has 582 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~42
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from coyvalyss1/model-matchmaker at commit 4b99e64, republished under its MIT licence (© coyvalyss1). 582 words, ~1,767 tokens.

Download SKILL.mdSave it as .claude/skills/optimize-classifier/SKILL.md (or your agent's skills folder).
name
optimize-classifier
description
Analyze your Model Matchmaker override patterns and tune the local classifier to match your preferences. Use after collecting 50+ recommendations.

Optimize My Classifier

This skill helps you personalize your Model Matchmaker classifier based on your actual usage patterns. After you've collected 50+ recommendations, this skill analyzes when you disagreed with the advisor and tunes your local classifier to match your preferences.

What This Skill Does

  1. Reads your local Model Matchmaker logs (~/.cursor/hooks/model-matchmaker.ndjson)
  2. Analyzes when you overrode the advisor's recommendations
  3. Finds patterns in the prompts where you disagreed (common words, task types)
  4. Suggests keyword additions to your model-advisor.sh file
  5. Updates your classifier (with your approval) so future recommendations match your preferences

Privacy: Everything happens locally. No data leaves your machine. You review and approve every change.

Instructions for the AI

You are helping the user optimize their Model Matchmaker classifier based on their personal override patterns. Follow these steps:

Step 1: Read and Validate Log File

Read the NDJSON log file at ~/.cursor/hooks/model-matchmaker.ndjson.

Check if there's enough data:

  • Need at least 50 recommendation events total
  • Need at least 5 OVERRIDE events to find patterns
  • If not enough data, tell the user: "You need more usage data. Come back after 50+ prompts with at least a few overrides."
Step 2: Analyze Override Patterns

Filter to action: "OVERRIDE" events and group by model direction:

Group A: User preferred Opus over recommended Haiku/Sonnet

  • These are prompts where the classifier said "use a cheaper model" but you said "no, I need Opus"
  • Extract common words from prompt_snippet fields in this group

Group B: User preferred Sonnet over recommended Opus

  • These are prompts where the classifier said "use Opus" but you said "no, Sonnet is fine"
  • Extract common words from prompt_snippet fields in this group

Group C: User preferred Sonnet over recommended Haiku

  • Extract common words from prompt_snippet fields in this group

Group D: User preferred Haiku over recommended Sonnet/Opus

  • Extract common words from prompt_snippet fields in this group
Show full SKILL.md (274 more words)Show less
Step 3: Extract Keyword Candidates

For each group, find words that appear in 3+ override prompts (minimum frequency threshold).

Exclude common stop words:

  • the, a, an, is, are, was, were, be, been, being, have, has, had, do, does, did
  • in, on, at, to, for, of, with, from, by, about, as, into, through, during
  • this, that, these, those, I, you, we, they, it, he, she, me, my, your

Focus on action verbs and technical terms:

  • Examples: debug, investigate, refactor, optimize, analyze, build, create, fix, update, configure
Step 4: Generate Proposed Changes

For each keyword group, map to the correct section of model-advisor.sh:

For Group A keywords (user prefers Opus): → Add to opus_keywords list around line 46

For Group B/C keywords (user prefers Sonnet): → Add to sonnet_patterns list around line 63

For Group D keywords (user prefers Haiku): → Add to haiku_patterns list around line 53

Step 5: Calculate Impact

For each proposed keyword:

  • Count how many past overrides would become correct recommendations if this keyword were added
  • Show confidence: "3 overrides → 'debug' should trigger Opus"
Step 6: Present Recommendations

Output in this format:

markdown
# Classifier Optimization Report

## Your Usage Summary

- Total recommendations: N
- Overrides: M (X.X%)
- Ready for optimization: [Yes/No - need 5+ overrides]

## Patterns Found

### You prefer Opus for:

**Keyword: "debug"**
- Frequency: 5 overrides
- Current behavior: Recommends Sonnet
- Proposed: Add "debug" to opus_keywords
- Impact: 5 past overrides would become correct recommendations

**Keyword: "investigate"**
- Frequency: 3 overrides
- Current behavior: Recommends Sonnet
- Proposed: Add "investigate" to opus_keywords
- Impact: 3 past overrides would become correct recommendations

[Repeat for other keywords]

### You prefer Sonnet over Opus for:

[Same structure]

### You prefer Haiku for:

[Same structure]

## Proposed Changes to ~/.cursor/hooks/model-advisor.sh

**Add to opus_keywords (line 46):**
```python
opus_keywords = [
    "architect", "architecture", "evaluate", "tradeoff", "trade-off",
    "strategy", "strategic", "compare approaches", "why does", "deep dive",
    "redesign", "across the codebase", "investor", "multi-system",
    "complex refactor", "analyze", "analysis", "plan mode", "rethink",
    "high-stakes", "critical decision",
    # NEW - Added based on your override patterns:
    "debug", "investigate"  # 8 overrides support this
]

Add to sonnet_patterns (line 63): [Show specific regex additions if any]

Next Steps

Would you like me to apply these changes to your classifier?

  1. Yes - I'll update ~/.cursor/hooks/model-advisor.sh with these keywords
  2. Some of them - Tell me which keywords to add
  3. No - Just show me the analysis, don't change anything

If you approve, I'll:

  1. Read your current model-advisor.sh
  2. Add the new keywords to the appropriate lists
  3. Write the updated file back
  4. Confirm the changes

You can test immediately by restarting Cursor or starting a new composer session.


### Step 7: Apply Changes (If User Approves)

If user says "yes" or approves specific keywords:

1. Read `~/.cursor/hooks/model-advisor.sh`
2. Locate the appropriate keyword list (opus_keywords, sonnet_patterns, or haiku_patterns)
3. Add the new keywords to the list with a comment explaining they were auto-added
4. Write the file back using the StrReplace tool
5. Confirm: "Updated! Your classifier now recommends [model] for prompts containing [keywords]. Changes take effect in your next Cursor session."

### Important Notes

- Only suggest keywords with 3+ override occurrences (confidence threshold)
- Don't add generic words that could cause false positives ("the", "make", "update")
- Show the user exactly what will change before changing it
- If the user's overrides are inconsistent (sometimes want Opus, sometimes want Sonnet for the same keyword), note that and ask for clarification

---

## How to Use This Skill

As a user, invoke this skill by saying something like:

- "Optimize my Model Matchmaker classifier"
- "Tune my classifier based on my overrides"
- "Analyze my Model Matchmaker usage and improve it"
- "Update my classifier to match my preferences"

The AI will analyze your logs, find patterns, and propose keyword additions. You review and approve before any changes are made.

## When to Run This

- After your first 50-100 prompts (to establish baseline patterns)
- Monthly or quarterly as your workflow evolves
- After a major project shift (switching from backend to frontend work, for example)
- Whenever you notice you're overriding the advisor frequently

© coyvalyss1, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/optimize-classifier of coyvalyss1/model-matchmaker.

Open the folder on GitHubat commit 4b99e64

Compare with similar skills

Optimize Classifier next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Optimize Classifier compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Optimize Classifier this skillcoyvalyss1/model-matchmaker168—~1.8kAutomated safety check: PassMIT
SQL Optimizationgithub/awesome-copilot40k2 repos~2.3kAutomated safety check: PassMIT
Database Optimizerdavila7/claude-code-templates32k8 repos~2.5kAutomated safety check: PassMIT
Postgresql Optimizationdavila7/claude-code-templates32k4 repos~951Automated safety check: PassMIT
Agent Performance Optimizerruvnet/ruflo74k2 repos~3.6kAutomated safety check: PassMIT
Prompt Optimizeraffaan-m/ECC275k2 repos~2.4kAutomated safety check: PassMIT

Similar skills

  • SQL Optimization

    github/awesome-copilot

    Official

    Universal SQL performance optimization assistant for comprehensive query tuning, indexing strategies, and database performance analysis across all SQL databases (MySQL, PostgreSQL, SQL Server…

    40k GitHub starsUsed in 2 repos~2.3k tokens
    DatabasesAuto-check passed
  • Database Optimizer

    davila7/claude-code-templates

    Expert database optimizer specializing in modern performance tuning, query optimization, and scalable architectures.

    32k GitHub starsUsed in 8 repos~2.5k tokens
    DatabasesAuto-check passed
  • Postgresql Optimization

    davila7/claude-code-templates

    PostgreSQL database optimization workflow for query tuning, indexing strategies, performance analysis, and production database management.

    32k GitHub starsUsed in 4 repos~951 tokens
    DatabasesAuto-check passed
  • Agent skill for performance-optimizer - invoke with $agent-performance-optimizer

    74k GitHub starsUsed in 2 repos~3.6k tokens
    Auto-check passed
  • Prompt Optimizer

    affaan-m/ECC

    分析原始提示,识别意图和差距,匹配ECC组件(技能/命令/代理/钩子),并输出一个可直接粘贴的优化提示。仅提供咨询角色——绝不自行执行任务。触发时机:当用户说“优化提示”、“改进我的提示”、“如何编写提示”、“帮我优化这个指令”或明确要求提高提示质量时。中文等效表达同样触发:“优化prompt”、“改进prompt”、“怎么写prompt”、“帮我优化这个指令”。不触发时机:当用户希望直接执行任…

    275k GitHub starsUsed in 2 repos~2.4k tokens
    DevelopmentAuto-check passed
  • Cost Optimize

    ruvnet/ruflo

    Analyze token usage patterns and recommend cost optimizations with estimated savings

    74k GitHub starsUsed in 1 repo~997 tokens
    AI & LLM EngineeringAuto-check: notes

More from coyvalyss1/model-matchmaker

  • Context Monitor

    coyvalyss1/model-matchmaker

    Monitor conversation context and prevent MAX mode by warning at token thresholds and generating handoff summaries.

    168 GitHub stars~1.9k tokensUpdated 15 days ago
    Auto-check passed
  • Share Analytics

    coyvalyss1/model-matchmaker

    Build a sanitized analytics report from your Model Matchmaker usage for community contribution.

    168 GitHub stars~1.8k tokensUpdated 15 days ago
    Auto-check passed

Questions about Optimize Classifier

What does Optimize Classifier do?

Analyze your Model Matchmaker override patterns and tune the local classifier to match your preferences. Optimize Classifier is an agent skill from coyvalyss1/model-matchmaker. Analyze your Model Matchmaker override patterns and tune the local classifier to match your preferences.

How do I install Optimize Classifier in Claude Code?

Run `npx skills add coyvalyss1/model-matchmaker --skill optimize-classifier -a claude-code`. Or copy the skill folder (skills/optimize-classifier in coyvalyss1/model-matchmaker) into .claude/skills/optimize-classifier in your project. Claude Code loads it when a task matches its description.

How do I install Optimize Classifier in Codex?

Run `npx skills add coyvalyss1/model-matchmaker --skill optimize-classifier -a codex`. Or copy the skill folder (skills/optimize-classifier in coyvalyss1/model-matchmaker) into .agents/skills/optimize-classifier in your project. Codex loads it when a task matches its description.

Can I use Optimize Classifier in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add coyvalyss1/model-matchmaker --skill optimize-classifier -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/optimize-classifier, .gemini/skills/optimize-classifier, .github/skills/optimize-classifier and .opencode/skills/optimize-classifier in your project.

What does Optimize Classifier need to run?

SKILL.md names no scripts, command-line tools or credentials: Optimize Classifier is instructions for the agent only. Our summary lists: Python 3.

Does Optimize Classifier access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Optimize Classifier safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Optimize Classifier use?

Optimize Classifier is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Optimize Classifier use?

About 1.8k tokens (SKILL.md is roughly 7.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Optimize Classifier?

Skills that share tags, products or a category with Optimize Classifier: SQL Optimization (github/awesome-copilot, 40k stars), Database Optimizer (davila7/claude-code-templates, 32k stars), Postgresql Optimization (davila7/claude-code-templates, 32k stars) and Agent Performance Optimizer (ruvnet/ruflo, 74k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Optimize Classifier?

coyvalyss1 (a GitHub user) maintains it in coyvalyss1/model-matchmaker, which has 168 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on September 22, 2026.

Source: coyvalyss1/model-matchmaker on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.