ulc-loop

ulc-loop is a skill for Claude Code, Codex from Kastalien-Research/thoughtbox. It costs 35 tokens per session (788 once invoked), scanned A, original, MIT.

An autonomous improvement loop for working through a software backlog, using the Ralph Wiggum plugin and a method called QD to explore ideas when no task is waiting. It checks the project before starting and keeps track of iterations and spending.

In plain words
What is it for?
Use it to process backlog items, dispatch agents, explore possible work when idle, and limit the run by a budget or maximum number of iterations.
Why use it?
It helps continue making progress across multiple improvement cycles without manually starting each one.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/kastalien-research/thoughtbox/ulc-loop
Any agent
npx skills add Kastalien-Research/thoughtbox --skill ulc-loop
Clone the repo
git clone --depth 1 https://github.com/Kastalien-Research/thoughtbox

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ulc-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/kastalien-research/thoughtbox/ulc-loop.svg)](https://agentmods.dev/skills/kastalien-research/thoughtbox/ulc-loop)
Your own site
<a href="https://agentmods.dev/skills/kastalien-research/thoughtbox/ulc-loop"><img src="https://agentmods.dev/badge/skills/kastalien-research/thoughtbox/ulc-loop.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 788 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00035 $0.00788
Opus 5 $0.00017 $0.00394
Sonnet 5 $0.00007 $0.00158
Haiku 4.5 $0.00003 $0.00079

Measured 4d ago against content hash 6a8325b765b9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ulc-loop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/ulc-loop/SKILL.md · 113 lines

How it starts

The opening of the file, as written. The whole thing — 113 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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:

    ls .Codex/plugins/cache/Codex-plugins/ralph-wiggum/ 2>/dev/null || echo "NOT INSTALLED"
    

    If not installed, tell the user to run: Codex plugin install ralph-wiggum@Codex-plugins

  2. Check for existing Ralph loop:

    cat .Codex/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:

    git status --porcelain
    

    If dirty, warn and suggest committing first.

Step 2: Read the ULC Prompt

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

Step 3: Initialize ULC State

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

cat > .Codex/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 .Codex/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: .Codex/ulc-state.local.json
Ralph state: .Codex/ralph-loop.local.md

Starting first OODA cycle...

Read the full file on GitHub · 113 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 113 lines · 35 tokens per session scan A 6a8325b765b9

Subscribe to this mod's changes

ulc-loop is a skill published in the GitHub repository Kastalien-Research/thoughtbox (64 stars, last pushed 1mo ago), licensed MIT. It adds 35 tokens to every session and 788 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

report-issue

File a bug or feature request against this repository (cyanheads/git-mcp-server) using the gh CLI. Use for tool logic bugs, git provider misbehavior, transport issues, auth/config problems, or new feature proposals.

cyanheads/git-mcp-server · 51 tokens

approval-workflows

Configure ServiceNow approval rules and sysapprovalapprover records — manager/group/script approvers, multi-level routing, delegation via sysuserdelegate, and parent-record state rollup.

serac-labs/serac · 40 tokens

change-management

Create and transition ServiceNow change requests (normal/standard/emergency), change tasks, affected CIs, approval routing, CAB scheduling, and conflict detection across maintenance windows.

serac-labs/serac · 37 tokens

hr-service-delivery

Build ServiceNow HR Service Delivery — snhrcorecase from Employee Center or HR catalog, snhrlelifecycleevent onboarding/offboarding with templated activities, and HR document generation.

serac-labs/serac · 42 tokens

incident-management

Manage ServiceNow incidents — creation with impact/urgency priority calc, auto-assignment by category, reassignment tracking, major incident declaration with bridge calls, time-based escalation, MTTR metrics.

serac-labs/serac · 42 tokens

problem-management

Manage ServiceNow problems — create from linked incidents, proactive pattern detection, RCA with 5-Whys, knownerror workarounds (KEDB), KEDB search by CI/category/keywords, and permanent-fix linkage to changes.

serac-labs/serac · 53 tokens