Skip to content
Back to skills

Ulc Loop

ASecurity

Start a Unified Loop Controller session via Ralph Wiggum. Autonomously works through backlog, dispatches agents, and explores via QD when idle.

  • 64 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 27, 2026
data-aibashgit

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned May 27, 2026

npx -y skills add Kastalien-Research/thoughtbox --skill ulc-loop --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ulc Loop?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ulc Loop
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/kastalien-research-ulc-loop/badge)](https://www.skillsdirectory.com/skills/kastalien-research-ulc-loop)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ulc-loop
description: Start a Unified Loop Controller session via Ralph Wiggum. Autonomously works through backlog, dispatches agents, and explores via QD when idle.
argument-hint: "[--budget N] [--max-iterations N]"
user-invocable: true
allowed-tools: Read, Bash, Write
---

# ULC Loop

Start an autonomous improvement loop powered by Ralph Wiggum.

## Setup

Parse arguments from: $ARGUMENTS

Defaults:
- `--budget`: 5 (USD)
- `--max-iterations`: 20

## Workflow

### Step 1: Pre-flight Checks

1. Verify Ralph Wiggum plugin is installed:
   ```bash
   ls .claude/plugins/cache/claude-code-plugins/ralph-wiggum/ 2>/dev/null || echo "NOT INSTALLED"
   ```
   If not installed, tell the user to run: `claude plugin install ralph-wiggum@claude-code-plugins`

2. Check for existing Ralph loop:
   ```bash
   cat .claude/ralph-loop.local.md 2>/dev/null && echo "ACTIVE" || echo "INACTIVE"
   ```
   If ACTIVE, warn: "A Ralph loop is already running. Run `/cancel-ralph` first."

3. Check git state is clean:
   ```bash
   git status --porcelain
   ```
   If dirty, warn and suggest committing first.

### Step 2: Read the ULC Prompt

Read the ULC decision procedure from `.claude/skills/ulc-loop/ulc-prompt.md`.

### Step 3: Initialize ULC State

Create the initial ULC state file if it doesn't exist:

```bash
cat > .claude/ulc-state.local.json << 'EOF'
{
  "iteration": 0,
  "cumulative_cost_usd": 0,
  "budget_usd": <BUDGET>,
  "actions": [],
  "exploration_misses": 0,
  "started_at": "<ISO timestamp>"
}
EOF
```

Replace `<BUDGET>` with the parsed budget value.

### Step 4: Create Ralph State File

Write `.claude/ralph-loop.local.md` with YAML frontmatter and the ULC prompt as the body:

```
---
active: true
iteration: 1
max_iterations: <MAX_ITERATIONS>
completion_promise: "BUDGET EXHAUSTED OR ALL WORK COMPLETE"
started_at: "<ISO timestamp>"
---

<contents of ulc-prompt.md>
```

### Step 5: Confirm and Start

Output:
```
ULC Loop activated via Ralph Wiggum.

Budget: $<budget> USD
Max iterations: <max_iterations>
Completion promise: "BUDGET EXHAUSTED OR ALL WORK COMPLETE"

The loop will:
1. Check backlog for ready work
2. Dispatch sub-agents for substantial tasks
3. Explore via QD when backlog is empty
4. Stop when budget is exhausted or all work is complete

State file: .claude/ulc-state.local.json
Ralph state: .claude/ralph-loop.local.md

Starting first OODA cycle...
```

Then immediately begin executing the ULC prompt — perform the first OODA cycle (Observe → Orient → Decide → Act).

## Notes

- The ULC prompt is re-fed by Ralph's stop hook on each iteration
- Inter-iteration continuity is via `.claude/ulc-state.local.json` and git
- Sub-agents are dispatched via Task tool with `subagent_type: "general-purpose"`
- Cost tracking is approximate — the agent estimates based on model and turns
- The loop does NOT push to remote — human reviews and pushes

Files in this skill

  • SKILL.md2.8 KB
  • ulc-prompt.md5.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.