How It Works
Ralph workflow idea
Ralph runs with --dangerously-skip-permissions (or similar), which means it has full access to whatever credentials are available inside the container. The Dev Container setup limits blast radius by:
The Dev Container acts as a hard boundary. VS Code credential-forwarding is neutralized by apostStarthook before Ralph runs. The only credential Ralph ever sees is a fine-grained PAT you mount from your host — scoped to one repo.
VSCode dev container is well integrated with VSCode IDE which makes it convenient to quickly reopens project in container anytime.
ralph-workflow provide convenience for you to scaffolds those things up
postStart script clears VS Code's credential-forwarding env vars (GIT_ASKPASS, VSCODE_GIT_*, SSH_AUTH_SOCK, GITHUB_TOKEN) before Ralph ever runs.The Ralph Loop
Ralph is a bash loop that drives an AI CLI through your task list until every story is marked done.
- 01
Read prd.yaml
prd.yamlEach iteration Ralph reads prd.yaml and picks the highest-priority story where passes: false.
- 02
Load codebase context
progress.txtprogress.txt is read for accumulated patterns and gotchas from previous iterations, giving Ralph growing institutional knowledge.
- 03
Pipe prompt to AI CLI
ralph.shralph.sh pipes prompt.md through the chosen AI CLI (claude, codex, gemini, or opencode) with --dangerously-skip-permissions so it can read, write, and run commands autonomously.
- 04
Implement & test
prompt.mdThe agent implements the story, runs typecheck and tests. If they fail, it fixes and retries within the same iteration.
- 05
Commit the change
ralph.shOn passing checks the agent commits with the message format feat: [ID] - [Title], creating a clean, traceable history.
- 06
Mark done & log learnings
progress.txtprd.yaml is updated to passes: true and new patterns are appended to progress.txt for future iterations.
- 07
Check completion
ralph.shIf all stories pass, the agent outputs <promise>COMPLETE</promise> and ralph.sh exits successfully. Otherwise the loop repeats.
Key Files
ralph.shThe iteration loop. Pipes prompt.md into the AI CLI and checks for the COMPLETE marker.
prompt.mdPer-iteration instructions. Tells the agent which story to pick, how to commit, and when to stop.
prd.yamlYour task list. Stories with passes: false are picked up; Ralph flips them to true when done.
progress.txtAccumulated codebase patterns. Ralph reads this at the start of each iteration and appends new learnings at the end.