loop-init

A setup helper that creates project-local state files for an automated development loop and detects the project's test, lint, and build commands.

In plain words
What is it for?
Use it to initialize loop state and create a loop configuration for projects using package.json, pyproject.toml, Makefile, Cargo.toml, or go.mod.
Why use it?
It gives the loop a place to record its configuration and makes its checks match the tools used by the project.

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/hhamja/claude-code-harness/loop-init
Any agent
npx skills add hhamja/claude-code-harness --skill loop-init
Clone the repo
git clone --depth 1 https://github.com/hhamja/claude-code-harness

Made for: Claude Code, Codex.

Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 694 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.00022 $0.00694
Opus 5 $0.00011 $0.00347
Sonnet 5 $0.00004 $0.00139
Haiku 4.5 $0.00002 $0.00069

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

Security

Grade A, and why

loop-init 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 2d 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.

skills/loop-init/SKILL.md · 30 lines

How it starts

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

loop-init — scaffold project-local loop state

Create the mutable loop state under .claude/loop/ in the current project. The plugin itself is immutable; everything the loop learns or tracks lives in these files.

Idempotency: if .claude/loop/ already exists, list its files and stop. Never overwrite existing loop state.

Steps

Scaffold first, questions last: you often cannot tell whether anyone can answer you (headless -p sessions look identical to interactive ones). Creating the files NEVER waits on user input.

  1. Detect stack commands for loop.config.md. Check ecosystem manifests in this order and extract test / lint / build commands:

    • package.jsonscripts.test / scripts.lint / scripts.build (prefix with the package manager detected from the lockfile: npm / pnpm / yarn / bun)
    • pyproject.toml → pytest / ruff / mypy etc. from tool sections or dev dependencies
    • Makefiletest / lint / build targets
    • Cargo.tomlcargo test / cargo clippy / cargo build
    • go.modgo test ./... / go vet ./... / go build ./...

    For anything missing or ambiguous, use TODO: <fill in manually> — do not stop to ask.

  2. Detect the implementer: run codex --version via Bash. Exit 0 → write implementer: codex; anything else → implementer: claude. Never ask — this is a mechanical check. Leave codex_args empty either way.

  3. Create the files from the templates in references/templates.md immediately, using detected values and TODOs. Goal: use the command arguments if given, else TODO: define the goal; derive branch: from it (<type>/<slug>, see templates.md). Print one warning line per TODO written.

  4. Gitignore: ensure the project .gitignore contains the line .claude/loop/.* (create .gitignore if missing; skip if the line already exists). Non-hidden loop files are MEANT to be committed (team sharing, session recovery).

  5. Interactive refinement (optional): only AFTER the files exist, and only if this session is clearly interactive (a human typed the command and can reply), you may ask ONE question to fill the remaining TODOs, then update the files. If in doubt, skip — TODOs are the designed outcome. Never end the turn with questions instead of created files.

  6. Report: created paths + remaining TODOs + the detected implementer + next steps — try /loopy:loop-run --verify-only first (grade only), then /loopy:loop-run. If implementer: claude because no Codex CLI was found, note: install the Codex CLI and run codex login, then set implementer: codex in loop.config.md to enable the cross-model maker/checker split.

Read the full file on GitHub · 30 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. 2d ago First seen · 30 lines · 22 tokens per session scan A 0e2e5df09704

Subscribe to this mod's changes

loop-init is a skill published in the GitHub repository hhamja/claude-code-harness (1 stars, last pushed 1mo ago), licensed MIT. It adds 22 tokens to every session and 694 once invoked, about $0.0001 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-31.

Related

Other skills, from other repositories