refine

refine is a command for Claude Code from Data-Wise/claude-plugins. It costs 0 tokens per session (3,486 once invoked), scanned A, original, MIT.

A prompt editor that turns vague requests into clearer, more specific instructions for Claude, using information about the project and recent work.

In plain words
What is it for?
Use it to improve a single prompt or work interactively on a request for an R, Python, Node.js, Quarto, or other Git project.
Why use it?
Unclear prompts can produce incomplete or irrelevant results; this helps define what is needed before asking.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

Part of the workflow plugin — 10 commands shipped together

Good fit Use it to improve a single prompt or work interactively on a request for an R, Python, Node.js, Quarto, or other Git project.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/data-wise/claude-plugins/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/Data-Wise/claude-plugins

Made for: Claude Code.

Or install workflow, the plugin that ships this one along with the rest of its 10 commands.

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/data-wise/claude-plugins/refine/github.svg)](https://agentmods.dev/commands/data-wise/claude-plugins/refine)
Your own site
<a href="https://agentmods.dev/commands/data-wise/claude-plugins/refine"><img src="https://agentmods.dev/badge/commands/data-wise/claude-plugins/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/data-wise/claude-plugins/refine"><img src="https://agentmods.dev/badge/commands/data-wise/claude-plugins/refine.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 3,486 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.03486
Opus 5.5 $0.00000 $0.01394
Sonnet 5.5 $0.00000 $0.00697
Haiku 4.5 $0.00000 $0.00349

Measured 3mo ago against content hash 473e3ca2a58e, 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 3mo 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.

workflow/commands/refine.md · 597 lines

How it starts

The opening of the file, as written. The whole thing — 597 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/refine - Prompt Optimizer

Optimize vague or unclear prompts into specific, well-structured requests that get better results from Claude.

Purpose

Help users write better prompts by:

  • Analyzing clarity and specificity
  • Checking project context
  • Rewriting with improvements
  • Explaining what changed and why
  • Learning prompt engineering patterns

Usage

  • /refine "<your prompt>" - Optimize a specific prompt
  • /refine - Interactive mode (will ask for prompt)

When invoked:

Step 1: Get the Prompt

If provided as argument:

/refine "Can you help me write a function that does X?"

Use the provided text.

If invoked without argument:

💡 PROMPT OPTIMIZER

Paste or type the prompt you want to optimize:

(Type 'cancel' to exit)
>

Wait for user input.

Step 2: Analyze Context

Before optimizing, gather context:

  1. Project type - Check for:

    • R package (DESCRIPTION file)
    • Python (pyproject.toml, setup.py)
    • Node.js (package.json)
    • Quarto (_quarto.yml)
    • General (git repo)
  2. Project instructions - Read if exists:

    • CLAUDE.md in project
    • ~/.claude/CLAUDE.md for user preferences
  3. Recent work - Check git log (last 3 commits) for context

  4. Coding patterns - Infer from context:

    • Language/framework in use
    • Testing framework
    • Documentation style
    • Type hints/annotations preference

Step 3: Analyze the Prompt

Identify issues:

  • ❌ Vague requirements - "make it better", "fix this", "help with X"
  • ❌ No language specified - "write a function" (which language?)
  • ❌ Question phrasing - "Can you..." instead of directive
  • ❌ Missing quality criteria - No mention of tests, docs, types
  • ❌ Unclear scope - What exactly should be done?
  • ❌ No edge cases - What should handle errors, empty input, etc.
  • ❌ Context missing - Doesn't mention relevant constraints

Step 4: Optimize the Prompt

Rewrite to be:

  • Specific - Clear language, framework, requirements
  • Directive - "Write X" not "Can you write X?"
  • Structured - Use bullets for multi-part requests
  • Complete - Include quality criteria (tests, docs, types)
  • Contextual - Reference project context when relevant
  • Edge-case aware - Mention error handling, validation

Read the full file on GitHub · 597 lines

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. 3mo ago First seen · 597 lines · 0 tokens per session scan A 473e3ca2a58e

Subscribe to this mod's changes

refine is a command published in the GitHub repository Data-Wise/claude-plugins (7 stars, last pushed 12d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,486 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-31.

Related

refine compared with commands from other repositories

refine next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
refineData-Wise/claude-pluginsCommand712d agoMITA0Claude Code
promptsaadshahd/moo.mdCommand38yesterdayMITA22Claude Code
prompt-showyaleh/meta-ccCommand223d agoMITA12Claude Code
bootmicrosoft/PromptKitCommand1161mo agoMITA14GitHub Copilot
music-suno-promptfrankxai/Starlight-Intelligence-SystemCommand1023d agoMITA23Claude Code
develop-image-prompt.evaldavistroy/claude-marketplaceCommand54d agoMITA0Claude Code
aiterrene-foundation/kailash-coc-claude-pyCommand132mo agoApache-2.0A0Claude Code