tomás ravalli

/reprompt

Motivation

I kept sending bad prompts to Claude Code, even if the task was non-trivial. I knew the prompt was too vague when I sent it, and I sent it anyway. "report checkout funnel drop-off last week." Six words and no mention of which events define the steps, whether steps must happen in order, whether to count users or sessions. The agent had to guess, and it wasn't always right.

This pattern ports to any agent with custom commands (Cursor, Codex, Antigravity). I describe the Claude Code version because that's what I use.

I did this because the costs looked asymmetric. Writing the spec costs a few minutes and real attention. Firing the lazy version costs seconds and almost no thought. But each rerun is itself another lazy send, plus the time to read the bad output and figure out what's missing. By the third rerun, I'd spent more than the spec would have cost. The lazy path only looks cheap if you stop counting at the first send.


A better approach

I built /reprompt as a slash command. It takes the lazy prompt, expands it into a spec (goal, inputs, Definition of Done, constraints), and copies the result to my clipboard. It does not run the spec. I paste it into a fresh session (/clear) and edit if needed. Then I run it on plan mode or auto-mode depending on the complexity of the task.

reprompt-palette

/reprompt in Claude Code's command palette.

The command is here. Install path ~/.claude/commands/reprompt.md. The slots come straight from Anthropic's prompt-engineering best practices.

What the six-word version becomes, in full:

Produce a step-by-step drop-off table for the checkout funnel over the last calendar week, from the GA4 export in BigQuery.

Inputs: the events_* table in the analytics dataset; the funnel events view_item → add_to_cart → begin_checkout → purchase; user_pseudo_id as the user key.

Definition of Done: one row per step, showing distinct users at that step, step-to-step conversion rate, and drop-off count. A user counts at step N only if they also reached every prior step, in order, within the week. Rates reconcile (step N users = step N–1 users × conversion).

Constraints: count distinct users, not events. Partition pruning on _TABLE_SUFFIX. Exclude internal traffic. Do not break out by date, channel, or device.

Confirm before starting: whether "last week" means the previous Mon–Sun or trailing 7 days, and whether step order must be strict (timestamps in sequence) or just "all four events occurred in the window".

The slot doing the most quiet work is "Confirm before starting". Most prompt templates just expand and submit. This one makes the agent ask its questions before any work runs, which is where most of my bad runs came from to begin with: ambiguity neither side surfaced until after the fact.

The friction tax on writing a rich prompt was higher than the friction tax on sending it raw and correcting in-turn. /reprompt flips that. Ten seconds, paste, edit, go. I send fewer bad prompts now. Not because I got more disciplined. Because the command made the disciplined version cheaper than the lazy one.

One nice consequence: Claude Code recently shipped /goal, which keeps a session running across turns until a condition holds. A reprompted spec already contains the kind of condition /goal wants. Lift the DoD line out, pass it to /goal, and you have auto continuation for long-running tasks.


Where it fits

There are two ways to get more out of an LLM, and you control them unevenly as a consumer.

two-dimensions

Diagram from Stanford CS230, Autumn 2025, Lecture 8 (Agents, Prompts, and RAG).

The horizontal axis is the model. You pick from what is on the shelf today (Opus, Sonnet, GPT-5, whichever tier you pay for), but you do not decide what ships next. GPT-5 ships, Claude Opus 4.7 ships, your runs improve and you did nothing. Your control on this axis caps at selection. The vertical axis is everything else: the prompt, the context, retrieval, agents, multi-agent stacks. That one is yours top to bottom. The cheapest move on it is also the first one: write a better prompt.

/reprompt is that move, automated. It does not replace RAG or agent design. It is the step underneath all of them, the one most people skip because writing a good prompt by hand is the kind of work that always loses to "just run it and see".


Built by with AI.