Skip to content

Instantly share code, notes, and snippets.

@nichoth
Last active May 17, 2026 16:58
Show Gist options
  • Select an option

  • Save nichoth/f9cf1e8147cd2ada35fa20f8a1e1ec61 to your computer and use it in GitHub Desktop.

Select an option

Save nichoth/f9cf1e8147cd2ada35fa20f8a1e1ec61 to your computer and use it in GitHub Desktop.
artificial productivity

Artificial Productivity

How to use these tihngs.

Like most people, I have had success with splitting things into a planning stage followed by an implementation stage. The implementation phase can be kind of synchronous/interactive, or can be a fully auto Ralph loop.

1. The Plan

Models have a limited context window. You want to use the plan phase to create a written document that another instance can easily follow. You want short, discrete tasks.

See the basic workflow -- brainstorming command and writing-plans command.


specify, plan, tasks, implement, in that order.


See plan-and-execute command.

The plan is where the real 'work' happens. It's where you create your specs. The execution can usually switch to a cheaper model to save tokens.

These plugins are nice because they tend to give you specific instructions about what to do next, ie what to do after the plan phase -- things like /clear the context window, then tell the next machine to read the doc at abc/123.md. Note the chart for the plan-and-execute plugin:

Rough Idea
    │
    ▼
/start-design-plan  ──────► Design Document (committed to git)
    │
    ▼
/start-implementation-plan ──► Implementation Plan (phase files)
    │
    ▼
/execute-implementation-plan ──► Working Code (reviewed & committed)

Each step breaks it into pieces.


Plan Mode

Just type /plan. Instruct it to create a written list of tasks.


The Ralph Loop

image

I highly recommend this video.

The name Ralph Wiggum Loop made me think it was a joke or something, but it's actually a kind of sophisticated protocol for optimizing the "context window". These things perform better with smaller amounts of context. The Ralph loop is about breaking down a problem into many small, atomic tasks that can be completed before the context window fills up too much.

It is a bash loop.

Good old bash.

It creates an agent, the agent aims to complete 1 task, then it kills the agent and starts a fresh one. That way the context never becomes overly saturated.

It has this basic form:

while :; do cat PROMPT.md | claude ; done

Of course there is more to it than that. The video is the best intro imo.

See this gist for a more realistic example of a loop, and also nearestnabors/ralph-wiggum-loop-starter

The Details

Have the agent interview you to determine the PRD document. I have a skill installed in my ~/.claude/skills directory at path ~/.claude/skills/prd/SKILL.md. That's how you install a skill. You just paste some markdown to a specific location in your home directory.

See skills/prd.

2. Further refine the PRD into discrete tasks

I've been using a ralph skill for this.


See Also

Writing

Video

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment