All skills
simota avatar

/hone

@c805268
by shingo imotasimota/agent-skills85 stars
15

Auditing AI CLI configs and designing, configuring, or debugging Claude Code hooks. Use for Codex/agy/Claude Code config reviews, hook lifecycle automation, quality gates, or MCP governance.

Use this Skill: https://skilld.dev/gh/simota/agent-skills/hone

This session only. Nothing lands on disk.

referencehooksloop-automation-context.md

≈1.3k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Hooks in Loop Engineering — Automation Context

Where Claude Code hooks sit inside the loop engineering pattern. Hooks are one of the heartbeat/automation primitives a loop is built from — useful framing when a user wants "a hook that runs X on a schedule / at lifecycle points" as part of an autonomous loop. For the loop concept and primitives map see nexus/reference/loop-engineering-primitives.md and .claude/skills/orbit/reference/loop-engineering.md.

Snapshot date: 2026-06-11. Fast-moving topic; verify feature versions against code.claude.com/docs before quoting.

The loop = parts, hooks are one heartbeat option

A loop engineering setup combines: scheduled execution + isolated workspaces + maker/checker verification + persistent memory. Claude Code offers several ways to drive the scheduled/automation part:

Automation primitive What it is When to reach for it
/loop Re-runs a prompt/command on a cron cadence (v2.1.72+) Whole-session recurring task on a timer
/goal Runs until a verifiable condition holds; fresh fast model checks completion each turn Bounded autonomous run with a stop condition
hooks (Hone's domain) Shell/prompt/http/agent commands fired at lifecycle events (PreToolUse, PostToolUse, Stop, SessionStart, …) Per-event reactions inside the loop — gates, logging, context injection, completion enforcement
GitHub Actions Push the loop to CI so it survives the laptop closing Long-running unattended loops

Hooks are not the timer — they are the per-event glue that makes each loop iteration behave: a Stop/SubagentStop hook can enforce a quality gate before "done", a PreToolUse hook can block reward-hacking edits (e.g. mutating tests/ mid-loop), a SessionStart hook can re-inject the loop's memory/state, and a Notification hook can route findings to the triage inbox.

How this informs Hone hook design

  • Completion enforcement (Stop/SubagentStop, recipe Q*): in a maker/checker loop, a blocking Stop hook is a deterministic, model-independent complement to /goal's fresh-model checker — exit-2 if verification evidence is absent. Don't trust verify-PASS alone.
  • Loop integrity guards (PreToolUse deny, see security-guard-hook.md): unattended loops are exactly where reward-hacking and goal-drift happen. A PreToolUse hook that denies writes to sha256-pinned loop artifacts (tests/, verify.sh, goal.md, .claude/settings*.json) hardens a loop against AP-13/AP-16/AP-20 (Orbit failure classes).
  • Memory re-injection (SessionStart, see sessionstart-hook.md): "the agent forgets, the repo doesn't" — a SessionStart hook can load state.env/progress.md so each loop iteration resumes with its persistent memory.
  • Findings routing (Notification, see notification-hook.md): surface loop discoveries to a human/triage channel so an unattended loop stays auditable.
  • Cost/governance (ConfigChange, PreToolUse): unmonitored loops have escalated cost dramatically (documented runaways). Hooks can audit config changes and flag burn-rate-relevant actions.

Evaluator & cost guards as hooks (Osmani/HuaShu framing, 2026-06)

The Orange Book (Loop Engineering: The Anthropic Playbook, HuaShu IEEE reformatting) names three loop disciplines that hooks can enforce deterministically — a model-independent complement to /goal's fresh-model checker:

  • Evaluator must act, not read (Rajasekaran, Anthropic): a Stop/SubagentStop hook can require execution evidence (test output pasted, screenshot captured) before allowing "done", and default to assume-broken (exit-2 unless proof is present). The maker praises its own work; the hook is the skeptic that can't be talked out of it.
  • Cap before you ship (token-blowout guard): a PreToolUse/ConfigChange hook audits budget-relevant actions so an idle bug can't burn a night's quota — the cap converts open-ended risk into a bounded one.
  • Keep one door open (cognitive-surrender guard): a Notification hook routes uncertain findings to a human/triage inbox rather than auto-merging — the structural pause that keeps a human able to say "no".

Of the five anti-patterns (one per skipped move — see .claude/skills/orbit/reference/loop-engineering.md), hooks directly harden three: Nodding (verification-gate Stop hook), Token blowout (cap PreToolUse hook), and Tangled (a PreToolUse deny on cross-worktree writes). Scheduling (the Manual anti-pattern) is not a hook's job — that's /loop/Cloud Routines/GHA.

Boundary

Hone owns the hook primitive only. The loop's cadence/contract/recovery belongs to Orbit; multi-engine orchestration to Nexus. When a request is "build me the whole loop," route the loop design to Orbit/Nexus and supply the hooks they need.

Caveat

No public verifiable ROI study for loop engineering exists yet — propose hooks for correctness/safety/auditability, not on a promise of efficiency gains.

Source: SKILL.md on GitHub

1 warning13d4 checks · Risk SAFE
  • Gen Agent Trust Hub13d

    The skill is a security-focused configuration auditor and automation tool for AI CLI environments. It includes extensive features for detecting hardcoded secrets, blocking dangerous shell commands, and managing environment security through best practices. No malicious patterns were detected.

  • Socket13d

    No alerts

  • Snyk13d

    Risk: LOW · No issues

  • ZeroLeaks5mo

    1 finding · Score: 78/100

Signed by skilld at c805268. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 2 weeks ago

README badge

README badge for simota/agent-skills/hone