finetune-monitor

finetune-monitor is a command for Claude Code from jmanhype/claude-code-plugin-marketplace. It costs 0 tokens per session (528 once invoked), scanned A, original, MIT.

A command that fine-tunes a monitoring model after GEPA optimization. Fine-tuning adjusts a model using selected examples, and the command uses the OpenAI API to adjust the model's weights.

In plain words
What is it for?
Use it after GEPA optimization to generate predictions, keep the correct examples, create a fine-tuning dataset, start fine-tuning, and save the resulting model.
Why use it?
It turns correct predictions from the optimized model into a fine-tuning dataset, which can help when the audit budget is very small or the best available performance is needed.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: positional $N argument.

Part of the code-safety-monitor plugin — 8 commands, 6 agents shipped together

Good fit Use it after GEPA optimization to generate predictions, keep the correct examples, create a fine-tuning dataset, start fine-tuning, and save the resulting model.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/jmanhype/claude-code-plugin-marketplace/finetune-monitor
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/jmanhype/claude-code-plugin-marketplace

Made for: Claude Code.

Or install code-safety-monitor, the plugin that ships this one along with the rest of its 8 commands, 6 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for finetune-monitor

README.md
[![agentmods](https://agentmods.dev/badge/commands/jmanhype/claude-code-plugin-marketplace/finetune-monitor/github.svg)](https://agentmods.dev/commands/jmanhype/claude-code-plugin-marketplace/finetune-monitor)
Your own site
<a href="https://agentmods.dev/commands/jmanhype/claude-code-plugin-marketplace/finetune-monitor"><img src="https://agentmods.dev/badge/commands/jmanhype/claude-code-plugin-marketplace/finetune-monitor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for finetune-monitor

Your own site · 80×15
<a href="https://agentmods.dev/commands/jmanhype/claude-code-plugin-marketplace/finetune-monitor"><img src="https://agentmods.dev/badge/commands/jmanhype/claude-code-plugin-marketplace/finetune-monitor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 528 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00528
Opus 5 $0.00000 $0.00264
Sonnet 5 $0.00000 $0.00106
Haiku 4.5 $0.00000 $0.00053

Measured 12d ago against content hash 9cde96ae34fa, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

finetune-monitor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/code-safety-monitor/.claude/commands/finetune-monitor.md · 91 lines

What it actually says

Finetune Monitor Command

Bootstrap fine-tune the monitor after GEPA optimization to further improve performance.

Usage

/finetune-monitor --base-model models/gepa_optimized.json --dataset control_tax.json [--samples 200]

When to Finetune

  • After GEPA optimization (not before!)
  • When you need the absolute best performance
  • For production deployments
  • When audit budget is very tight (<0.5%)

What It Does

  1. Loads GEPA-optimized monitor
  2. Generates predictions on training set
  3. Filters for correct predictions (attack > honest)
  4. Creates fine-tuning dataset from trajectories
  5. Fine-tunes model weights via OpenAI API
  6. Saves fine-tuned model

Example

/finetune-monitor \
  --base-model models/gepa_optimized.json \
  --dataset datasets/control_tax.json \
  --samples 200

Output

Loading GEPA-optimized model...
Generating predictions on 200 samples...
Filtering correct predictions: 178/200 (89%)

Creating fine-tuning dataset...
Uploading to OpenAI...
Starting fine-tuning job: ftjob-abc123...

[Progress: ████████████████░░░░] 80%

Fine-tuning complete!
Model: ft:gpt-4.1-nano-2025-04-14:abc123
Saved to: models/gepa_finetuned.json

Performance Impact

GEPA Only:
  Safety @ 0.5%: 80%
  Safety @ 1.0%: 90%

GEPA + Finetune:
  Safety @ 0.5%: 85%  (+5%)
  Safety @ 1.0%: 90%  (same)

Fine-tuning helps most at very low audit budgets.

Cost Considerations

  • GEPA: ~$5-10 (API calls for reflection)
  • Fine-tuning: ~$50-100 (model training)

Use GEPA first, only finetune if needed.

Programmatic Usage

from code_safety_monitor.src.trainer import FinetuneTrainer, train_pipeline

# Full pipeline with fine-tuning
monitor = train_pipeline(
    trainset=train_examples,
    run_finetune=True  # Enable fine-tuning
)
  • /optimize-gepa: Run this first
  • /validate-safety: Evaluate fine-tuned model
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 91 lines · 0 tokens per session scan A 9cde96ae34fa

Subscribe to this mod's changes

finetune-monitor is a command published in the GitHub repository jmanhype/claude-code-plugin-marketplace (27 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 528 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.