refine

refine is a command for Claude Code from Ertinox7711/SGRR-AGI-V2. It costs 38 tokens per session (354 once invoked), scanned A, original, MIT.

A command that runs the continual-harness refinement process, saving durable lessons from a session as notes, skills, rules, or reusable agent roles. It also records snapshots and a change history so edits can be reviewed or rolled back.

In plain words
What is it for?
Use it to refine the agent setup, inspect previous refinements, or review and explicitly approve a rollback.
Why use it?
It prevents useful session knowledge from disappearing while limiting unsupported or destructive changes. It requires evidence and keeps the main instruction file unchanged.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

Good fit Use it to refine the agent setup, inspect previous refinements, or review and explicitly approve a rollback.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/ertinox7711/sgrr-agi-v2/refine
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/Ertinox7711/SGRR-AGI-V2

Made for: Claude Code.

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 refine

README.md
[![agentmods](https://agentmods.dev/badge/commands/ertinox7711/sgrr-agi-v2/refine/github.svg)](https://agentmods.dev/commands/ertinox7711/sgrr-agi-v2/refine)
Your own site
<a href="https://agentmods.dev/commands/ertinox7711/sgrr-agi-v2/refine"><img src="https://agentmods.dev/badge/commands/ertinox7711/sgrr-agi-v2/refine/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 refine

Your own site · 80×15
<a href="https://agentmods.dev/commands/ertinox7711/sgrr-agi-v2/refine"><img src="https://agentmods.dev/badge/commands/ertinox7711/sgrr-agi-v2/refine.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 354 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.00038 $0.00354
Opus 5.5 $0.00015 $0.00142
Sonnet 5.5 $0.00008 $0.00071
Haiku 4.5 $0.00004 $0.00035

Measured 21d ago against content hash 4c1667e6137f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

refine 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 21d 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.

commands/refine.md · 30 lines

What it actually says

Run the continual harness refinement on this session. Invoke the refine skill and follow it exactly.

Arguments: $ARGUMENTS

Routing:

  • --status / --list / --rollback <id> -> read-only inspection path of the skill (harness-refine.py status|list|show|rollback). A rollback is dry-run first; it only runs with --go after the operator gives a per-file GO.
  • otherwise -> the full refine procedure: check state, find trajectory evidence, snapshot, write the real files, record the payload, report.

Default scope is global for cross-session lessons. Pass --local for session/project state. If the lesson is project-specific, the entry title or content must name the project, or it goes local.

Non-negotiable on this rig: the base ~/.claude/CLAUDE.md is immutable, and delete edits are refused by the engine unless the operator gave an explicit per-item GO. Additive only by default.

Max 3 edits unless asked for more. No evidence in this trajectory = no edit, and say so in one line rather than inventing one.

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. 21d ago First seen · 30 lines · 38 tokens per session scan A 4c1667e6137f

Subscribe to this mod's changes

refine is a command published in the GitHub repository Ertinox7711/SGRR-AGI-V2 (1 stars, last pushed 1mo ago), licensed MIT. It adds 38 tokens to every session and 354 once invoked, about $0.0002 per session on Opus 5.5. 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-10-04.