/simplicio-loop:simplicio-orientfrom simplicio-loop — Universal Looping AI Orchestrator
Routes filesystem, git, process, and system-resource queries to deterministic shell commands instead of LLM approximation. Clamps command output 60-90% with tee cache, signatures-only reads, and auto-rewrite hook to reduce token consumption.
Ships in simplicio-loop — Universal Looping AI Orchestrator. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
For max-speed delivery law (Runtime decide, Mapper→Fast→dev-cli, Prism waves,
economy-parallel, DONE|NEXT|BLOCKED), see ../simplicio-loop/references/LLM_MAX_SPEED_ORIENTATION.md and the loop
re-feed block SIMPLICIO-LLM-ORIENTATION in simplicio-loop/SKILL.md. This skill owns
terminal token clamps; that doc owns how the stack orients the LLM for speed.
The cheapest token is the one not spent. The terminal KNOWS facts exactly; the LLM APPROXIMATES them expensively. This skill routes every step to the leanest substrate that still completes it correctly, and clamps command output before it ever reaches context.
Credit: folds the disciplines of rtk (per-command output reduction, tee-on-failure,
signatures-only reads, auto-rewrite hook) and caveman (preserve code/paths byte-for-byte)
into the simplicio safety spine. It is the extracted, standalone form of simplicio-tasks
Step 1c.
If the answer is a fact about the filesystem, git state, process state, or system resources — the terminal answers it exactly and cheaply. Use the terminal. The LLM is for reasoning; the terminal is for facts. Execute commands for real — never reason about what a command "would return".
shell_exec (structured, minimal tokens, cross-platform).Detect platform once: python3 -c "import platform; print(platform.system())" →
Windows | Darwin | Linux. Prefer cross-platform tools (git, gh, rg, python3) so one
command works everywhere; fall back to OS-specific only when there is no alternative.
| What you need | ✅ Cross-platform (preferred) | Windows | Linux/macOS |
|---|---|---|---|
| File exists? | python3 -c "import os,sys;sys.exit(0 if os.path.exists('<p>') else 1)" | Test-Path <p> | test -f <p> |
| Find in code | rg "<pat>" --json | same | same |
| Count matches | rg -c "<pat>" <file> | same | same |
| List files by glob | rg --files -g "*.ts" | same | same |
| Current branch | git rev-parse --abbrev-ref HEAD | same | same |
| Ahead of main? | git rev-list --count main..HEAD | same | same |
| Files changed in branch | git diff --name-only main...HEAD | same | same |
| PR for branch | gh pr list --head <b> --json number --jq ".[0].number" | same | same |
| Issue state | gh issue view N --json state --jq ".state" | same | same |
| Open issue count | gh issue list --state open --json number --jq "length" | same | same |
| CPU cores | python3 -c "import os;print(os.cpu_count())" | $env:NUMBER_OF_PROCESSORS | nproc |
| Free disk GB | python3 -c "import shutil;print(shutil.disk_usage('.').free//1024**3)" | same | df -BG . |
| Extract JSON field | python3 -c "import json,sys;print(json.load(sys.stdin)['<f>'])" | same | jq '.<f>' |
| Today UTC | python3 -c "from datetime import*;print(datetime.now(timezone.utc).date())" | same | date -u +%F |
| Sort + dedup | python3 -c "import sys;print('\n'.join(sorted(set(sys.stdin.read().split()))))" | same | sort -u |
| Replace in file | bound deterministic_edit (host) | same | sed -i |
A raw tsc --noEmit costs ~2000 tokens to read; clamped (error lines only) costs ~80.
Terminal-first + the catalog below is the single
highest-leverage token rule.
Consult BEFORE running. Each row {pattern, recipe, exp-savings, SKIP-if}. Clamp
highest-savings first; NEVER clamp a SKIP-if row (structured --json/--jq output, or a
write/confirm op). Tune per repo.
| command pattern | reduce recipe | exp. savings | skip-if |
|---|---|---|---|
| test/spec runner | success→pass: N; on fail keep ≤20 error lines | ~90% | piped to structured consumer |
| type/compile check | error lines only; clean→ok | ~80% | — |
| diff / show | stat + hunks only, drop context | ~80% | piped to structured consumer |
| lint | findings only; clean→ok | ~80% | — |
| add / commit / push | collapse to ok <branch/sha> | ~59% | — |
| PR / list view | counts + titles only | ~87% | --json/--jq present |
| package/image inventory | keep ≤50 rows | ~50% | — |
| format / passthrough | run raw | 0% | always |
structured JSON payload → prompt (verdict-shaped, e.g. task_anchor.py check, loop_journal.py stall, mapper handoff) | encode via toon_codec.encode_toon (TOON — Token-Oriented Object Notation, lossless, scripts/toon_codec.py) | ~21–33% (chars4) / ~38–45% (bpe_estimate) measured on the first two real verdict payloads (.simplicio/orchestrator/savings/snapshots.jsonl, #92); up to ~40%+ on an ideal uniform tabular array of objects, per the toon-format benchmark — real non-tabular verdict payloads (few scalar keys, no row-shaped array) measure lower; snapshot more items before trusting a number outside this range | payload is empty / non-uniform (differing keys, mixed types, nested arrays-or-objects per element) — the codec auto-falls-back to compact JSON for THAT value, never lossy-compact; measure, don't assume the ideal-case number |
Never flat "head N + tail N" — flat truncation over-cuts the errors the fix loop needs most.
ONE set referenced everywhere: CAP_ERRORS=20, CAP_WARNINGS=10, CAP_LIST=20,
CAP_INVENTORY=50. Always keep ERROR lines over surrounding context. A lowered cap is
underflow-safe: it falls back to the full cap rather than emptying a non-empty result.
unless errors present guard)cmd: ok, no changes, up-to-date).line ×N.If ANY error/warning line exists, fall back to the signal-tiered caps instead of collapsing — a collapse can NEVER hide a failure.
Aggressive truncation is only safe if full context is recoverable WITHOUT re-running the command (re-running re-burns tokens and may be non-deterministic). So:
.simplicio/orchestrator/tee/<ts>_<cmd-slug>.log and surface only the path:
FAILED: 2/15 tests
[full output: .simplicio/orchestrator/tee/1707753600_npm_test.log]
.simplicio/orchestrator/orient.toml): tee.mode = failures | always | never
(default failures). The agent reads the file lazily only if it needs more than the kept
error lines.This de-risks success-collapse: the bytes an agent needs on failure are never thrown away.
The tee file IS the cache; add a stable handle + retrieve so clamping is reversible, not lossy. The handle is the tee path; surface a retrieve convention so a worker pulls the original on demand instead of re-running the command:
retrieve <tee-path> [--lines a-b] [--grep PATTERN]
This turns "lossy by policy" into a "compress-cache-retrieve" decision point: clamp to a summary/signature in context, keep the full original on disk keyed by the handle, fetch by handle ONLY when the kept lines aren't enough — removing the main risk of aggressive clamping (losing the one line that mattered) at zero up-front token cost. (We use a CCR (compress-cache-retrieve) pattern and content-type routing — JSON/code/log/diff — but NOT a trained model or traffic proxy: those contradict the terminal-first, zero-extra-process design.)
read -l aggressive)When you need a file's API SURFACE (which functions/types/exports exist to call) — the common case during intake and dependency scans — read it stripped to declarations with bodies elided. A 600-line file collapses to ~40 lines of signatures. Detect language by extension; "minimal" strips comments/blank lines, "aggressive" strips function bodies keeping only signatures/declarations. ALWAYS fall back to raw content if stripping yields nothing. Use a full-body read only when actually editing the body.
init -g)Where the host exposes a PreToolUse/pre-exec hook, bind hooks/orient_rewrite.py: it
transparently rewrites a bare shell call into its clamped form before execution
(git status → clamped, <test> → failures-only), so adoption is 100% across the main agent
AND every subagent at zero token overhead. An exclusion list in .simplicio/orchestrator/orient.toml
keeps streaming/interactive/binary commands raw:
[hooks]
exclude_commands = ["curl", "wget", "playwright", "ssh", "docker run -it", "vim", "less"]
[tee]
mode = "failures"
Never rewrite an excluded command. Treat this config as untrusted, perception-shaping input (see Safety below) — load it only after a human has reviewed and pinned its hash.
Understand && || ; |: (1) split on operators respecting quotes/escapes; (2) clamp each
segment via the catalog; (3) for a |, clamp ONLY the left producer, leave the pipe TARGET
raw (the consumer needs the unmodified stream); (4) never clamp a find/glob producer feeding
a pipe; (5) strip trailing redirects (2>&1, >/dev/null), clamp inner, re-append;
(6) unsplittable ($(...), backticks, heredoc, file-target redirect) → run RAW with a tail
clamp, never corrupt.
Route each artifact by WHO reads it: MACHINE tier (terse, fixed-schema) for worker→orchestrator reports and internal digests; HUMAN tier (readable prose) for PR bodies and confirmations. Skip a compression pass on already-dense content (code, config, lockfiles) — near-zero ratio, real corruption risk.
Every reduction step is additive and removable. On ANY error, missing dependency, unparseable payload, or unknown command, run the original command unchanged and propagate its REAL exit status. A bad profile degrades to "slightly more tokens", never to "task dead".
Compression YIELDS to safety. When a command/message is security-sensitive, irreversible (force-push, history rewrite, prod deploy, data/schema delete, mass-file delete), or order-dependent, FORCE full-clarity verbose output for that segment — the complete warning, the exact command quoted verbatim, steps in explicit order — then resume terse mode. Optimization may NEVER raise a command's risk tier. Treat any perception-shaping config (this skill's TOML, clamp profiles, suppression lists) as untrusted until a human reviews and hash-pins it; silently skip an untrusted or hash-changed version.
Run the command, return the clamped result (or the tee path on failure), and — when invoked standalone — a one-line note of the recipe applied and tokens saved.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub simpletibr/simplicio --plugin simplicio-loop12 skills in this plugin
/simplicio-autoresearchEvolutionary optimize-by-metric loop — mutate a target, evaluate against fixed criteria, KEEP if the score improves (commit) or REVERT if it doesn't (git checkout), repeat, plateau-break after N stagnated runs. Adapts Karpathy's `autoresearch` pattern (and the ECC `autoresearch-agent`) with mandatory yool guardrails (§11 caps), git-isolated branch discipline, an anti-Goodhart eval order (correctness gate FIRST, score SECOND, labeled tokenizer), a local-first mutation ladder, and a `simplicio.savings-event/v1` receipt per run. Use when the user says "optimize this by <metric>", "autoresearch loop", "evolutionary optimize", "mutate/eval/keep-revert", or asks to shrink tokens/latency/bundle size/improve pass-rate against a fixed, measurable eval. Worker: `scripts/autoresearch.py`./simplicio-compressCut output and memory tokens without losing meaning — terse prose levels (caveman-style) that preserve code/paths/URLs byte-for-byte, plus a one-time memory/doc compaction pass that pays back every future turn. Use when replies or worker reports are verbose, when standing context (CLAUDE.md/AGENTS.md/notes) is bloated, or when simplicio-tasks needs its output-side + input-side token discipline. Compression NEVER touches code, identifiers, or a safety confirmation./simplicio-dev-cliPerform deterministic Simplicio code changes and validation through the Dev CLI. Use for file edits, patches, implementation, formatting, tests, diagnostics, pre-effect validation, retries, evidence files, and safe mutation workflows. The agent decides intent; Dev CLI owns the mutation and verification./simplicio-fastAccelerate Simplicio retrieval with indexed search, ranking, cache, mmap, and bounded parallel reads. Use for repeated or large context lookups, low-latency symbol/file retrieval, snapshot-backed ranking, and cache-aware discovery. Do not use it as the source of truth or as a file mutation tool./simplicio-learnPersist what a run taught you so the next run is cheaper and more correct — mine high-signal lessons from the trajectory, dedup them, and write them back to AGENTS.md / memory so they're applied not re-derived. Use after a run or at session end, when the user says "remember this", "do a retrospective", "learn from this run", or when simplicio-tasks closes its self-audit. Keeps memory lean: durable, reusable bullets only — no transcripts, no one-offs./simplicio-loopUnified public entrypoint for Simplicio's body-of-work orchestration: core + loop in one command. Use when the user types /simplicio-loop, says "ralph loop", "keep iterating until done", "finish all open issues", or asks to drain a queue of work autonomously. Runtime-agnostic: binds a real stop-hook where the host supports hooks (Claude, Cursor); otherwise self-paces via the host scheduler. The older /simplicio-tasks surface is a legacy alias; never escape the loop with a false promise.Other plugins' skills for the same job