Open-Source Cook Skill Lets Claude Code Build 4K Scenes Autonomously
A new agent skill called Cook runs long autonomous loops that iterate on visual builds until they match reference images, calibrated by rubrics and critics.
Takeaways
- Cook is an agent skill for Claude Code and Codex that runs long autonomous loops to match reference images.
- Install with
npx skills add Leonxlnx/cook, invoke with/cookor$cook, needs Node 18+ and ffmpeg. - Loop structure: intake once, numeric bar per dimension, build, render stills, fresh context critics, fix weakest part, repeat.
- User calibration counters the known problem of models scoring their own output too generously.
- Reference demo Athenaion used ~45h, 55 subagents, 11M output tokens, and cost roughly $1.8k to $2.3k.
- MIT licensed, mostly Markdown, pairs with the author's unlazy skill for completion discipline.
Cook is a new open-source agent skill for producing visual work that matches reference images or videos. It directs Claude Code or Codex CLI to build a project, render reference shots, score the results, repair the weakest dimension, and repeat the cycle.
The skill targets 3D scenes, short films, games, and interfaces with concrete visual goals. Its mostly Markdown package acts as a persistent operating procedure inside an existing coding agent, while a small Node.js script creates side-by-side comparison images.
Long-running agents can stop early, lose their goals after a context reset, or inflate their own quality scores. Cook addresses those failure modes with a fixed rubric, explicit runtime and usage budgets, fresh critic subagents, persistent state, and a human approval gate.
Inside the render-critique loop
Cook gathers project requirements once, applies defaults to unanswered questions, and then runs without further clarification requests. It converts each visual reference into a required shot and analyzes motion references frame by frame.
- Collect the brief: Record the deliverable, available references, technical constraints, and open questions.
- Map the shots: Turn every reference into a render target with matching framing and, when applicable, motion.
- Define the scorecard: Assign numeric criteria for composition, lighting, color, materials, and motion.
- Set the quality bar: Use the references and the user’s estimate to calibrate the agent’s scores.
- Apply constraints: Forbid imported assets by default, reject common low-quality visual shortcuts, control saturation, and favor offline rendering on lower-powered GPUs.
- Budget the run: Establish a minimum effort level, a hard time limit, and usage pacing that reduces the risk of hitting provider limits.
- Build and repair: Render the required stills, compare them side by side, score each dimension, fix the lowest score, and repeat.
- Log and gate: Save each round, present stills for review, and wait for approval before producing the final render.
The workflow assumes that agents grade their own work too generously. Fresh critic subagents receive the artifacts and rubric without the implementation history, which reduces anchoring on earlier decisions. The user’s quality estimate provides another calibration point.
The agent can continue iterating unattended and expose stills after each round. Final rendering remains gated on human approval, so an overnight run may still require a review step before delivery.
Install, invoke, resume
Installation through the Skills CLI requires one command:
npx skills add Leonxlnx/cook
Manual installation places the package in one of the supported skill directories:
~/.claude/skills/cookfor Claude Code~/.codex/skills/cookfor Codex CLI
Claude Code invokes the skill with /cook, while Codex uses $cook. Trigger phrases include go cook and iterate until it matches. A typical request looks like this:
/cook build this ancient Greek world in three.js, match the 9 attached references
Cook requires Node.js 18 or newer and FFmpeg for its side-by-side comparison script. It stores plans, scores, logs, and other run state in a project-level cook/ directory, allowing work to continue after a context reset or agent handoff.
One demo’s 45-hour bill
The author used Cook to build Athenaion, a Three.js reconstruction of an ancient Greek world based on nine AI-generated references. The reported run illustrates the compute, token, and orchestration costs of extended visual iteration.
| Metric | Reported value |
|---|---|
| Total runtime | About 45 hours |
| Subagents | 55, with up to 12 running in parallel |
| Generated code | About 45,000 lines of JavaScript |
| Output tokens | About 11 million |
| API-equivalent cost | About $1,800 to $2,300 |
| Final render | 4K on an integrated AMD Radeon 780M GPU |
Those figures describe one author-run project. Actual usage will vary with model selection, provider pricing, concurrency, iteration count, and the complexity of each render. The API-equivalent estimate is a comparison figure and may differ from the amount charged under a subscription plan.
Where Cook fits
Projects with specific references, reproducible camera shots, measurable visual criteria, and enough time for repeated rendering align with Cook’s workflow. The operator also needs to review stills and approve the final render.
- Suitable work: Reference-matched 3D scenes, short films, game environments, product visuals, and interface recreations.
- Required inputs: Images or videos that can be converted into shots and scored consistently.
- Operational demands: Long runtimes, substantial token use, local rendering capacity, and monitored provider limits.
- Poor candidates: Quick prototypes, loosely specified visual experiments, small cost-sensitive jobs, and tasks with no stable reference target.
Set limits before the run
An autonomous session can execute commands, modify many files, spawn parallel agents, and consume a large usage budget. Developers should establish technical and financial boundaries before starting a long run.
- Review the skill’s Markdown instructions and Node.js comparison script before installation.
- Run the agent in a dedicated branch, worktree, container, or similarly isolated environment.
- Set explicit limits for runtime, concurrency, token use, and provider spending.
- Restrict access to credentials, production systems, and unrelated project files.
- Commit the starting state and inspect generated changes before merging them.
A pattern beyond graphics
Cook separates an autonomous job into a target, a measurable quality bar, a time budget, and a repeated critic loop. That structure gives developers a compact example of how to keep a long-running agent focused across many iterations and context resets.
The same pattern can support other domains by replacing visual comparisons with test suites, benchmark results, schema checks, or domain-specific evaluations. Teams can preserve the budgeting, logging, critic, and approval stages while changing the scoring system.
The MIT-licensed repository is small enough to inspect and fork. It can also pair with the author’s unlazy skill, which adds effort and completion rules to the target-matching workflow.