Ralph Wiggumのロゴ

Ralph Wiggum

コミュニティ
jkitchin
ralph-wiggum

Autonomous AI coding loop for unattended development - lets Claude work continuously on tasks while you sleep, with mandatory sandbox enforcement for safety

概要

公開者jkitchin
リポジトリknowhow
スキル名ralph-wiggum
スター
45
フォーク
9
同梱ファイル
19
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 19個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    jkitchinがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Ralph Wiggum」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/jkitchin/knowhow/tree/main/skills/development/ralph-wiggum
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/jkitchin/knowhow.git /tmp/knowhow
mkdir -p .claude/skills
cp -r /tmp/knowhow/skills/development/ralph-wiggum .claude/skills/ralph-wiggum
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでRalph Wiggumを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にRalph Wiggumを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Ralph Wiggumは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Ralph Wiggum Mode

"Me fail English? That's unpossible!" - Ralph Wiggum

Ralph Wiggum Mode is an autonomous AI coding loop that enables Claude Code to work continuously on tasks without human intervention. Named after the persistently optimistic Simpsons character, this technique lets Claude work "overnight shifts" while you sleep.

Key Principle

Progress persists in files and git, not in the LLM's context window.

When context fills up, the loop restarts Claude with fresh context. The new instance picks up from the filesystem state (your code, git history, and task tracking files).

When to Use This Skill

Use Ralph Wiggum mode for:

  • Overnight feature development
  • Bug bashes (fixing multiple issues)
  • Test coverage improvement
  • Refactoring large codebases
  • Documentation generation
  • Any multi-step task you'd like completed while away

Security Model

CRITICAL: Ralph requires a sandboxed environment.

Ralph uses --dangerously-skip-permissions which can:

  • Delete files without confirmation
  • Read credentials (~/.ssh, ~/.aws)
  • Make network requests
  • Run arbitrary commands

Ralph will REFUSE to start unless it detects:

  • Container environment (Docker/Kubernetes)
  • Network isolation (cannot reach internet)
  • Non-root user
  • No access to sensitive paths

Quick Start

1. Initialize Ralph in Your Project

bash
# Run the init script to scaffold Ralph files
./ralph-init.sh

This creates:

  • RALPH_PROMPT.md - The prompt fed to Claude each iteration
  • IMPLEMENTATION_PLAN.md - Task tracking file
  • ralph.sh - The main loop script
  • ralph-sandbox.sh - Docker wrapper
  • Dockerfile.ralph - Sandbox container definition

2. Define Your Work

bash
# Create specs directory for requirements
mkdir -p specs

# Write your requirements
cat > specs/my-feature.md << 'EOF'
## Feature: User Dashboard

### Requirements
- Show user's recent activity
- Display usage statistics
- Allow date range filtering
EOF

# Update the implementation plan
cat > IMPLEMENTATION_PLAN.md << 'EOF'
## Tasks

- [ ] Create Dashboard component
- [ ] Add activity feed API endpoint
- [ ] Implement date range picker
- [ ] Write tests for dashboard
EOF

3. Run Ralph (In Sandbox)

bash
# Recommended: Use the Docker wrapper
./ralph-sandbox.sh

# With iteration limit
./ralph-sandbox.sh . 20

# Check progress from another terminal
tail -f ralph.log
git log --oneline -10

4. Review Results

bash
# See what Ralph did
git log --oneline

# Check task completion
cat IMPLEMENTATION_PLAN.md

# Verify tests pass
pytest

How It Works

┌─────────────────────────────────────────────────────────────────┐
│                    EXTERNAL BASH LOOP                            │
│                                                                  │
│   while :; do                                                    │
│       ┌─────────────────────────────────────────────────┐       │
│       │           CLAUDE SESSION                         │       │
│       │                                                  │       │
│       │  1. Read RALPH_PROMPT.md                        │       │
│       │  2. Check IMPLEMENTATION_PLAN.md                │       │
│       │  3. Pick a task, implement it                   │       │
│       │  4. Run tests, commit changes                   │       │
│       │  5. Context fills → Session ends                │       │
│       └─────────────────────────────────────────────────┘       │
│                           ↓                                      │
│       Git commit saves progress                                  │
│       Loop restarts with fresh context                           │
│   done                                                           │
└─────────────────────────────────────────────────────────────────┘

Files Reference

RALPH_PROMPT.md

The prompt loaded each iteration. Customize this for your use case:

markdown
# Ralph Mode Instructions

You are operating in autonomous Ralph mode.

## Each Iteration
1. Read IMPLEMENTATION_PLAN.md and git log
2. Pick ONE pending task, mark it in-progress
3. Implement fully with tests
4. Mark complete, commit changes

## Rules
- Never skip tests
- Commit after each meaningful change
- If blocked, document why and continue

IMPLEMENTATION_PLAN.md

Persistent task tracking (survives context resets):

markdown
## Tasks

- [x] Task 1 (completed in iteration 1)
- [x] Task 2 (completed in iteration 2)
- [ ] Task 3 (in progress)
- [ ] Task 4 (pending)

ralph.sh

The main loop with sandbox enforcement. Key features:

  • Refuses to run outside sandbox
  • Configurable iteration limits
  • Git commits after each iteration
  • Graceful shutdown handling

ralph-sandbox.sh

Docker wrapper that:

  • Builds sandbox image if needed
  • Mounts only project directory
  • Disables network (--network none)
  • Sets resource limits (memory, CPU, PIDs)
  • Drops all capabilities

Configuration

Environment Variables

VariableDefaultDescription
RALPH_MAX_ITERATIONS0 (unlimited)Stop after N iterations
RALPH_MODELopusClaude model to use
RALPH_COST_LIMIT50.00Max spend in USD (with cost monitor hook)
ANTHROPIC_API_KEYoptionalAPI key (not needed with Claude Code subscription)

Sandbox Override (Dangerous)

Only for custom sandbox environments you've verified:

bash
RALPH_I_KNOW_WHAT_IM_DOING=sandboxed ./ralph.sh

Best Practices

Prompt Engineering

  1. Be specific - Tell Claude exactly what to do each iteration
  2. Single task focus - "Pick ONE task" prevents context bloat
  3. Require tests - Include testing in the prompt
  4. Track progress - Use IMPLEMENTATION_PLAN.md as shared state

Task Decomposition

Break large tasks into small, atomic pieces:

markdown
## Bad
- [ ] Implement user authentication

## Good
- [ ] Create User model with email, password_hash
- [ ] Add POST /api/register endpoint
- [ ] Add POST /api/login endpoint
- [ ] Add password reset flow
- [ ] Add JWT middleware
- [ ] Write auth tests

Monitoring

bash
# Watch iterations in real-time
tail -f ralph.log

# Check commits
watch -n 5 'git log --oneline -10'

# Monitor resource usage
docker stats

Safety Hooks (Recommended)

Install these hooks for additional safety:

bash
# Block dangerous operations
knowhow hooks install ralph-safety-check

# Track API costs
knowhow hooks install ralph-cost-monitor

Troubleshooting

Ralph won't start

Check sandbox detection output. You need at least 3 checks passing:

  • Container detected
  • Network isolated
  • Non-root user
  • No sensitive path access

Ralph gets stuck on a task

  1. Check ralph.log for errors
  2. Update IMPLEMENTATION_PLAN.md to unblock
  3. Add clarifying notes to RALPH_PROMPT.md

Runaway iterations

Set MAX_ITERATIONS or use the cost monitor hook:

bash
./ralph-sandbox.sh . 20  # Stop after 20 iterations

References

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Ralph Wiggum」では何ができますか?

Autonomous AI coding loop for unattended development - lets Claude work continuously on tasks while you sleep, with mandatory sandbox enforcement for safety

TypingMindでRalph Wiggumを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Ralph Wiggumはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにRalph Wiggumをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/jkitchin/knowhow/tree/main/skills/development/ralph-wiggumを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Ralph Wiggumを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Ralph Wiggumで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもRalph Wiggumを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Ralph Wiggum」は無料ですか?

はい。jkitchinがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇