# Meta Prompting — runnable examples / ejemplos ejecutables

Companion code for **Meta Prompting with Claude Code** (Vibe Coding Nights LATAM, July 16, 2026 — Irina Vélez + Rayyan Zahid). Deck: [vcn-latam-metaprompting.vercel.app](https://vcn-latam-metaprompting.vercel.app)

Six examples, one per technique from the talk. Every script is **standalone, pure stdlib, no API keys**: the model calls go through the `claude` CLI you already have if you use Claude Code.

Seis ejemplos, uno por técnica. Cada script es independiente, sin dependencias, sin API keys: las llamadas al modelo pasan por el CLI `claude` que ya tienes si usas Claude Code.

## Setup

1. Install Claude Code: [claude.com/claude-code](https://claude.com/claude-code) (gives you the `claude` CLI)
2. `git clone` this repo, `cd examples`
3. Run any script with `python 0X_name.py`

Optional: `set METAPROMPT_MODEL=sonnet` (Windows) / `export METAPROMPT_MODEL=sonnet` (mac/linux) — default is `haiku` for speed.

## The ladder / la escalera

| # | Script | Technique | Paper | Model calls |
|---|--------|-----------|-------|-------------|
| 01 | `01_self_refine.py "your task"` | Generate → critique → revise. The loop you can build tonight. | [Self-Refine, 2023](https://arxiv.org/abs/2303.17651) | ~5 |
| 02 | `02_ape.py` | Reverse-engineer the instruction from examples, score candidates, keep the winner. Uses the paper's actual "I gave a friend an instruction" template. | [APE, 2022](https://arxiv.org/abs/2211.01910) | ~13 |
| 03 | `03_opro.py` | The scored history of past instructions becomes the next prompt. How "Take a deep breath" was found. | [OPRO, 2023](https://arxiv.org/abs/2309.03409) | ~16 |
| 04 | `04_conductor.py "your question"` | One conductor writes instructions for fresh expert instances of itself, then synthesizes. Claude Code subagents are this in production. | [Meta-Prompting, 2024](https://arxiv.org/abs/2401.12954) | ~5 |
| 05 | `05_criterion.py` | Your judgment as a versioned, cached prompt. Run it twice: second run is all cache hits. | production pattern (Ray's repo) | 5 then 0 |
| 06 | `06_router.py "your ask"` | 3-tier template router: alias → keyword → LLM. **No model needed.** | production pattern (Ray's repo) | 0 |

## Where to go next / siguientes pasos

- Start with 01 tonight. Esta noche.
- Graduate to [DSPy](https://arxiv.org/abs/2310.03714) or [GEPA](https://arxiv.org/abs/2507.19457) **only when you have a real metric** worth optimizing against.
- Mine your own prompt history: the prompts you keep retyping are templates waiting for a name.

License: MIT. Quote, fork, remix — attribution appreciated.
