ctrl-alt-pray v2.0.0
The Anti-Doom-Loop Circuit Breaker for AI Agents

When Ctrl+Z Isn't Enough.
Pray.

Stop letting autonomous coding agents burn $25 swapping true and false in a 3:00 AM death spiral. An evidence ledger, 12 canonical falsification rites, and a 15-second terminal executioner.

$ npx ctrl-alt-pray init
What Is This? GitHub Repo Simulator
ctrl-alt-pray-origin-chronicles.png (The 3 AM Doom Loop)
Ctrl Alt Pray - AI Agent Doom Loop Comic Strip

What Is This In 10 Seconds?

No metaphors, no esoteric jargon. Just the zero-BS breakdown for cynical engineers who don't have time for tech-occultism.

1. What It Actually Is

An open-source, local Model Context Protocol (MCP) server + CLI runtime built for Cursor, Claude Code, Cline, and autonomous terminal agents.

Zero runtime dependencies • Pure TypeScript • Local SQLite WAL ledger • Runs 100% offline

2. The Exact Problem It Solves

The 3:00 AM AI Doom Loop. An AI agent fails a test. Instead of investigating, it apologizes, tweaks random lines, reverts, and tweaks again—burning $20 in tokens while the real bug was a deadlocked dev port or a stale dist/ cache.

Empirical data: >96% of 3rd consecutive speculative patches fail without new ground truth.

3. How It Physically Stops It

(1) 2-Strikes Tripwire: Injects a rule into your agent config blocking edits after 2 failures.
(2) Evidence Ledger (pray): Inspects git, diff churn, and ports to give the AI 1 atomic probe.
(3) Process Executioner (pray-run): Auto-kills hung child processes and clears zombie ports after 15s.

Converts 15-turn circular loops into a 30-second single-variable resolution.

4. Why Not Just Write a Prompt?

Prompts have no memory across sessions, cannot check git diff --stat, cannot check whether port 3000 is deadlocked, cannot kill orphaned processes with SIGKILL, and LLMs routinely ignore prompt advice when caught in tunnel vision.

Deterministic TypeScript code enforces hard constraints that LLM prompts cannot.
STEP 1: 10s SETUP

One-Line Arming

Run npx ctrl-alt-pray init. It detects Cursor, Claude, Cline, or Gemini and arms your repo with the 2-strikes tripwire and MCP configuration.

STEP 2: THE TRIPWIRE

Loop Interception

When the AI fails twice on the same check, the tripwire physically bars further code edits. The agent is forced to call the pray() MCP tool.

STEP 3: FALSIFICATION

Ground Truth Probe

The Altar prescribes 1 of 12 canonical falsification rites. The agent tests one isolated variable, confirms reality, and resolves the issue in 1 clean commit.

Why the church & prayer theme? Because every software engineer who has stayed up until 3:00 AM watching an AI agent hallucinate changes through 20 files has tried Ctrl+C, tried Ctrl+Z, and was left with only one desperate move: praying. We turned developer pain into a memorable meme wrapped around a battle-hardened, zero-dependency engineering circuit breaker.

See The Altar Break a Real 3 AM Loop

Experience what happens when blind patching is halted and replaced by an atomic falsification probe.

Agent Transcript Stream Burn: $14.20 (28,400 tokens)
Ctrl Alt Pray Intervention Protocol: MCP 2026

4 Architectural Safeguards

Engineered to interrupt cognitive decline before your credit card is drained.

2-Strikes Circuit Breaker

When 2 consecutive patches fail with identical symptoms, the engine trips. It stops the agent from editing code and forces an explicit falsification check.

Active Terminal Guardian

pray-run wraps commands with a 15-second freeze watchdog. Recursively terminates orphan child subtrees (PID 1 adopters), reclaiming locked ports and git index files.

Zero-Arg Harvester

Calling pray() without arguments inspects git status, dirty diffs, lockfiles, and occupied ports natively across Linux, macOS, and Windows.

Second Opinion Engine

Devil's Advocate critique challenges the proposed experiment before execution. Uses MCP 2026 sampling when available, falling back to instant 0-cost heuristics.

Blind Guesswork vs Ground-Truth Rites

What happens to your development flow when failure states are structured instead of repeated.

Failure Scenario Standard AI Behavior (The Doom Loop) With Ctrl Alt Pray (The Altar)
Stale Build Artifact Edits source file 8 times. Test still fails. Apologizes 6 times. Swaps variable names. Wrong Altar: Injects UUID marker into source. Detects missing stdout. Proves bundler is frozen in 1 step.
Hanging Test Watcher Terminal sits silent for 15 minutes. Context window saturates with pipe timeouts. Terminal Guardian: 15s freeze watchdog triggers. Cascade process-tree killer slays orphan PIDs. Releases dev port.
Swallowed Test Error Tests show green despite defect. Agent assumes bug is in database or network layer. Poison Chalice: Injects deliberate assert(1===2). Exposes that test suite is swallowing errors.
API Hallucination Guesses non-existent method names recursively (getUser()fetchUser()findUser()). API Ground Truth: Runs 1-line script reflection: Object.keys(await import('...')). Reflects true exports.
Cognitive Panic Generates paragraphs of polite apologies while repeating identical failed edits. Anti-Apology Linter: Circuit breaker penalizes placation filler. Demands single falsifiable hypothesis.

12 Canonical Recovery Rites

Battle-tested recovery patterns version-controlled with applicability triggers, probes, and safety guarantees.

One-Click Setup For Every Coding Editor

Instantly equip Cursor, Claude Code, VS Code, Windsurf, Cline, Zed, and JetBrains AI with the 2-Strikes Circuit Breaker and MCP Altar.

UNIVERSAL AUTO-IGNITION

Arm All Editors In One Shot

Scans your workspace, detects active environments, and automatically writes matching .mcp.json, .cursor/mcp.json, .vscode/mcp.json, and guideline tripwires with zero manual typing.

$ npx ctrl-alt-pray init --all

Observable Decisions, Zero Guesswork

Every loop recovery is committed to an ACID SQLite WAL ledger for replay and auditing.

37+
Loops Intercepted
88.1%
Recovery Rate
~314k
Tokens Saved
<5ms
Engine Overhead
http://127.0.0.1:3900 — Visual Recovery Ledger Dashboard
Ctrl Alt Pray - Live Telemetry Dashboard Preview
Copied to clipboard!