Skip to content

Latest commit

ย 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ouroboros โ€” a serpent devouring its own tail

๐Ÿ oh-my-ouroboros

A Claude Code harness that devours its own output to grow.

MIT license 25 skills 10 agents 40 lazy rules monthly self-audit PRs welcome


Like the mythic serpent coiled into a ring, this harness feeds on its own output: every session leaves feedback traces, a monthly audit consumes them, and the rules that emerge are forced through a hard token budget before they can live in context. It is not a plugin or a framework โ€” it is a sanitized one-way mirror of a real daily-driver ~/.claude, used across multiple servers for ML research and engineering.

๐Ÿ”’ Nothing here is hand-edited. A fail-closed export pipeline (allowlist โ†’ sanitize โ†’ forbidden-pattern gate โ†’ fresh-history sync) regenerates this repo on each release. Even the logo is code-generated โ€” see assets/gen_ouroboros.py.

๐Ÿ‡ฐ๐Ÿ‡ท The rules and skills are written in Korean โ€” this is a real production config, not a localized demo. The architecture, file layout, and this README are English; the patterns (budget hooks, audit loop, two-tier rules) read the same in any language.

โœจ Why it's different

  • ๐Ÿงฎ Hard token budget with a zero-sum rule โ€” always-on context (CLAUDE.md + rules/) has a byte ceiling enforced by a commit hook. Adding a rule means shrinking another. The context never silently bloats.
  • ๐Ÿ” A self-audit loop with recorded baselines โ€” a monthly audit skill measures inventory drift, pointer integrity, doc/implementation mismatch, and built-but-unused rot against numbers written down last cycle. Fixes are classified (structural vs parameter) and hit-tracked next time.
  • ๐Ÿงพ Evidence-gated "done" โ€” no success claims without verification output; subagent claims that change downstream actions are re-checked against file:line before adoption.
  • ๐Ÿง  Judgment rationale lives in artifacts โ€” trade-offs, failure-mode definitions, and tool-selection measurements are written into the rule/skill/script that embodies them, so any future session can reproduce the reasoning from files alone.
  • ๐Ÿ›ก๏ธ User sovereignty by construction โ€” pushes, deletions, training runs, and destructive writes are always user-executed; cross-session peer messages cannot escalate permissions; untrusted web content is quarantined to read-only agents.

๐Ÿ”„ The ouroboros loop

flowchart LR
    W["โš™๏ธ Daily work<br/>sessions ยท experiments"] --> F["๐Ÿ“ฅ Feedback capture<br/>QA fails ยท corrections ยท repeated patterns"]
    F --> A["๐Ÿ” Monthly self-audit<br/>baselines ยท pointer integrity ยท rot check"]
    A --> D["โœ‚๏ธ Zero-sum diet<br/>token budget ยท rule compression"]
    D --> B["๐Ÿงช Bench gate<br/>before/after behavior check"]
    B --> W
Loading

The tail feeds the mouth: waste found by the audit becomes the budget for the next rule.

๐Ÿ—‚๏ธ What's inside

Layer Contents
๐Ÿ“Œ CLAUDE.md + rules/ Always-on tier: routing, model delegation (opus/sonnet/haiku), code-execution policy, memory triggers, prompt preprocessing
๐Ÿ’ค rules-lazy/ 40 lazy-loaded policies: QA process, context management, error handling, untrusted-content quarantine, secret handling, โ€ฆ
๐Ÿค– agents/ 10 specialized subagents (scout ยท coder ยท qa ยท planner ยท researcher ยท searcher ยท docs ยท gitops ยท designer ยท citation-verifier) with spawn-prompt contracts
๐Ÿงฐ skills/ 25 skills: experiment workflow, paper reading, multi-perspective discussion, harness audit & bench, wandb/checkpoint cleanup, cost breakdown, โ€ฆ
๐Ÿ”ฉ scripts/ Hooks & automation: commit gates, session-start pattern mining, nightly ontology refresh, cost snapshots, this export pipeline
โš™๏ธ settings.json + _audit/history.md The receipts: actual hook wiring, and the audit history with recorded baselines
๐Ÿค– The 10 agents, one line each
Agent Model Role
scout haiku Read-only recon โ€” finds the files, symbols, and wiring before anyone edits
coder sonnet Implementation โ€” writes and modifies code to spec
qa sonnet Verification โ€” tests, call-site impact analysis, causal bug tracing
planner opus Architecture & experiment design consulting; final calls stay with main
researcher opus Paper writing, result analysis, adversarial design review
searcher sonnet The only agent that touches the open web โ€” returns quarantined summaries
docs sonnet Confluence/Jira via MCP, with the media-preserving edit protocol
gitops sonnet Commits, branches, diffs, tags โ€” push always stays with the human
designer sonnet Figures โ€” TikZ diagrams and matplotlib plots
citation-verifier sonnet Retraction gate + supporting/contrasting stance debate before any paper is cited
๐Ÿงฐ The 25 skills, one line each
Skill What it does
solve Opinion/planning questions via a 5-step method; ambiguous execution requests get meta-prompt convergence
discuss Multi-agent debate with a devil's advocate, persuasion-attack guards, and consensus-quality metrics
experiment Experiment lifecycle: design โ†’ dry-run โ†’ launch โ†’ analysis โ†’ cleanup gates
workflow Phase-based workflow design with auto-generated rubric gates
harness-audit The monthly self-audit: baselines, pointer integrity, recurring-defect catalog
harness-bench Before/after behavior measurement when rules change
learn-from-feedback Corrections accumulate into rule proposals after 3+ hits
paper-read 9-source parallel paper search + full-PDF close reading + review doc
paper Paper writing: abstract, sections, review responses
research Deep multi-source research with citation verification
neuro-explain Neuroscience mechanism citations with mandatory plain-language analogies
figure Paper figures: TikZ for structure, matplotlib for data
confluence Page format standards, macro-escaping lore, media-preserving edit protocol
confluence-research-record 4-level research-note hierarchy (overview โ†’ year โ†’ month โ†’ day)
storytelling But/therefore narrative structure for research records and talks
dumbify Rewrites expert prose for non-expert readers without losing the numbers
commit Commit conventions + a rejected-pattern check against feedback history
wandb-cleanup 3-tier run triage + workspace visibility via raw GraphQL (no global hide API exists)
ckpt-cleanup KEEP/DELETE/HOLD checkpoint classification against wandb run states; purge script is user-executed
cost Per-model, per-agent cost breakdown rendered as a bar chart
cost-reset Wipe accumulated cost ledgers (destructive, user-executed)
graphify Turn any input into a persistent knowledge graph; query it before grepping
project-init New research project scaffolding
quick-skill Define a new rule/skill/agent quickly, with a write-time bloat gate
setup-panels tmux panel layouts for teammate sessions

๐Ÿงช Battle-tested details you won't find in most harnesses

  • ๐Ÿ“‰ Measured, not vibes โ€” a token-diet cycle found and removed ~3KB of per-session waste (stale index blocks, uncapped hook injections, over-verbose skill descriptions) because baselines made the growth visible.
  • ๐Ÿชค A catalog of defects that actually recur โ€” the audit greps first for the five patterns that have really bitten before: label/reality drift, catalog desync, hook cache isolation, MCP tool renames, and built-but-unused rot (including "trigger conditions no real utterance can reach").
  • ๐Ÿงน ML lifecycle cleanup gates โ€” after a training cycle: wandb run triage (3-tier tagging + workspace visibility) and checkpoint purge planning (KEEP/DELETE/HOLD matched against run states), destructive steps always user-executed.
  • ๐Ÿ—ƒ๏ธ Convention-based document format registry โ€” per-project Confluence/doc templates detected by directory existence, so any server or new project picks up the right format with no central table to maintain.
  • ๐Ÿ–ผ๏ธ Media-preserving Confluence edits โ€” verbatim fetch โ†’ literal single-match substitution โ†’ node-count check, encoded as a rule after a real incident where full-body regeneration destroyed every image on a page.

๐Ÿ› ๏ธ Using this

Read it as a reference architecture. The pieces most worth stealing:

  1. โœ‚๏ธ the zero-sum always-on budget hook (commit gate + byte ceiling),
  2. ๐Ÿ” the audit skill and its baseline/history discipline,
  3. ๐Ÿ’ค the two-tier rule layout (always-on summary โ†’ lazy detail) with pointer-integrity checks,
  4. ๐Ÿ“‹ the spawn-prompt 4-element contract (objective / output format / tools / task boundary).

Paths and identifiers are genericized; a few private layers (project knowledge, internal doc formats, personal memory) are intentionally absent, and some pointers to them are left dangling on purpose.

๐Ÿค Feedback

Issues and PRs are welcome โ€” they are reviewed, back-ported into the private source of truth, and re-published here. Derivatives are part of the loop too: if you build on this, link it in an issue. See CONTRIBUTING.md.

โš–๏ธ License

MIT โ€” see LICENSE.

๐Ÿ The serpent renews itself by eating its own tail. So does this repo.

About

๐Ÿ Like the mythic serpent coiled in a ring, jaws closed on its own tail โ€” this harness devours its own output to grow: monthly self-audits, feedback loops, token-budget discipline. 25 skills ยท 10 agents ยท 40 lazy rules, mirrored from a production ~/.claude.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages