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.
npx skills add cdeust/session-optimizer --skill refinegit clone --depth 1 https://github.com/cdeust/session-optimizerWrote 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.
[](https://agentmods.dev/skills/cdeust/session-optimizer/refine)<a href="https://agentmods.dev/skills/cdeust/session-optimizer/refine"><img src="https://agentmods.dev/badge/skills/cdeust/session-optimizer/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.
<a href="https://agentmods.dev/skills/cdeust/session-optimizer/refine"><img src="https://agentmods.dev/badge/skills/cdeust/session-optimizer/refine.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00118 | $0.03577 |
| Opus 5.5 | $0.00047 | $0.01431 |
| Sonnet 5.5 | $0.00024 | $0.00715 |
| Haiku 4.5 | $0.00012 | $0.00358 |
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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 223 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Automation
On Claude Code, a UserPromptSubmit hook (hooks/refine_gate.py, wired by
this plugin's hooks/hooks.json) applies this skill automatically on two
tiers. Codex and Gemini load the same skill explicitly or by description;
their packages do not claim to install the Claude-specific hook.
- Tier 1 — reference markers: prior-artifact shorthand, "exactly as/like", repeat-failure phrasing → inject the full binding-table instruction naming the matched marker classes.
- Tier 2 — ungrounded work request (the generic net): the prompt asks for work (fix/build/improve/problem/bug/should/…) but contains NO concrete anchor — no file path, no commit sha, no line ref. Any named system/variable/concept ("the memory system", "the heat variable") must then be bound to its actual code artifact before reasoning. Prompts the user grounded themselves (a path in the prompt) pass through untouched.
Explicit /refine remains for prompts both heuristics miss.
Purpose
Communication failures cost more than code failures. A terse prompt like "it must work exactly as the SSE solution" carries a precise intent that the model can mis-bind to the wrong artifact and then build the wrong thing — correctly. This skill makes the binding explicit and cheap to correct BEFORE work starts, instead of expensive to redo after.
Procedure
1. Capture — never paraphrase away the original
Quote the raw prompt verbatim at the top of the contract. The user's exact words are evidence; frustration markers ("still", "again", "back to square one") signal a REPEATED failure — treat those as pointers to prior attempts that must be recalled, not as noise to sanitize away.
2. Bind every reference — the core move
Two reference classes need binding, and BOTH go in the table:
Deictic/temporal — "it", "the X solution", "like before", "the last release", "that file", "the same way": shorthand for prior work.
Domain-entity — "the memory system", "the wiki system", "the heat variable", "recall scores": names of systems, components, variables, and concepts. These feel concrete to the user but map to MANY possible code artifacts ("heat" alone: the memory row field, thermodynamics.py, decay_cycle.py, the WRRF heat signal, the viz heat display). Picking the wrong one solves the wrong problem correctly.
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.
- 1mo ago First seen · 223 lines · 118 tokens per session scan A 2e310374441c
refine is a skill published in the GitHub repository cdeust/session-optimizer (1 stars, last pushed 5d ago), licensed MIT. It adds 118 tokens to every session and 3,577 once invoked, about $0.0005 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-08-31.
Other skills, from other repositories
llm-eng-checks
Use when building or hardening an LLM feature — prompt design, RAG, eval harness, model/provider selection, guardrails, and token/cost budgeting — with omp-native tools (bash for real API round-trips, read/grep for the repo's own client, no vendor-plugin dependency, provider-agnostic). PRIME RULE — no LLM feature is…
cursor-prompting
Internal guidance for composing compact, operator-style prompts for cursor-agent across coding, review, diagnosis, and research tasks.
nativeprompt
A prompt editor that adapts a user's request to the rules of a selected coding model, such as Claude Code, Codex, Gemini CLI, or GPT-5.
cortex-prompt
Build a production-ready prompt package — system prompt, few-shot examples, output format, edge case handling, eval criteria. Use when asked to "prompt engineering", "build a prompt", "write a system prompt", or "improve this prompt".
structured-prompt-writer
Structured AI prompt writing tool with 395+ built-in prompt templates. Supports both detailed mode and simple mode. Used for creating professional AI persona prompts, system prompts, or task prompts. Use this skill when the user needs to: (1) create a new AI prompt (2) design an AI persona (3) write a system prompt…
agy-prompting
Internal helper — how to tighten a user request into a sharp prompt for the Antigravity CLI (agy / Gemini 3.x with native web search and agentic tools).