agentleFS
Kit4SomeKit4Some/Oh-my-ClaudeClaw/CLAUDE.md

Oh-my-ClaudeClaw

CLAUDE.md4 starsChanged 8 months agoMITView on GitHub

These rules are NOT optional. They execute automatically on every user message, not just when skills are invoked. On EVERY user message, BEFORE doing anything else: When the user gives a task (not a question), automatically: During task execution: After EVERY completed task: Without being asked:

  • Deletes or force-pushes

The file

Show its rules and text

We split this CLAUDE.md into the rules it gives an agent

13 rules. About 0 are common, 11 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When the user gives a task (not a question), automatically:

    line 20
  2. Distinctive:

    Use LSP/AST tools: when navigating code (not just grep):

    line 44
  3. Distinctive:

    Run tests if they exist

    line 50
  4. Very specific:

    Run lsp_diagnostics on changed files

    line 51
  5. Distinctive:

    If 3 attempts fail, STOP and escalate to user (3-strike rule)

    line 53
  6. Distinctive:

    Never write code AND approve it in the same pass

    line 56
  7. Distinctive:

    After EVERY completed task:

    line 61
  8. Distinctive:

    Suggest relevant skills: when detecting user intent (unless proactive is disabled)

    line 85
  9. Very specific:

    Fetch API docs automatically: when coding against external APIs: chub_search → chub_get

    line 87
  10. Distinctive:

    Flag stale memories: if retrieved context is >30 days old

    line 88
  11. Distinctive:

    Default language follows user preference.

    line 109
  12. Distinctive:

    When a task matches these patterns, activate the corresponding skill/agent AUTOMATICALLY (don't ask, just do it):

    line 195
  13. Distinctive:

    All OMC agents must leverage OpenClaw-CC's persistent memory:

    line 292

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

OpenClaw-CC v2 — Autonomous AI Harness

MANDATORY BEHAVIOR — Execute on EVERY interaction

These rules are NOT optional. They execute automatically on every user message, not just when skills are invoked.

Phase 0: Context Injection (BEFORE responding)

On EVERY user message, BEFORE doing anything else:

  1. Search memory for relevant context:
    memory_search(query: "{user's request keywords}", associative: true, limit: 5)
  2. If related memories found: Silently incorporate them into your understanding. Do NOT list them unless the user asks.
  3. Check for active work: state_get_status() — if there's unfinished work from a previous session, mention it briefly.

Phase 1: Automatic Task Analysis

When the user gives a task (not a question), automatically:

  1. Classify the task type:
    • Coding: implementation, refactoring, feature, fix → Route to executor/debugger agents
    • Debugging: error, broken, not working → Activate /investigate protocol automatically
    • Review: review, check, audit → Activate /code-review protocol
    • Release: ship, deploy, PR, merge → Activate /ship protocol
    • Research: find out, look up, what is → Use WebSearch + memory_search + chub
    • Design: brainstorm, idea, plan → Activate /office-hours or planner agent
  2. Assess complexity:
    • Simple (1-2 files, clear scope): Execute directly
    • Medium (3-5 files, some ambiguity): Use single OMC agent delegation
    • Complex (5+ files, cross-cutting): Use OMC team pipeline (plan→exec→verify)
  3. Select agent tier:
    • Quick lookups → haiku agents (explore, writer)
    • Standard implementation → sonnet agents (executor, debugger, test-engineer)
    • Architecture/deep analysis → opus agents (architect, critic, code-reviewer)

Phase 2: Execution with Quality Gates

During task execution:

  1. Use LSP/AST tools when navigating code (not just grep):
    • lsp_goto_definition for tracing, lsp_find_references for impact analysis
    • ast_grep_search for structural pattern matching
    • lsp_diagnostics after code changes
  2. Verify before claiming done:
    • Run tests if they exist
    • Run lsp_diagnostics on changed files
    • "Should work" is NOT acceptable — run it and prove it
    • If 3 attempts fail, STOP and escalate to user (3-strike rule)
  3. Separate authoring from review:
    • Never write code AND approve it in the same pass
    • For significant changes: delegate review to code-reviewer agent

Phase 3: Result Persistence (AFTER completing)

After EVERY completed task:

  1. Store significant results:
    memory_store(category: "{appropriate}", title: "{what was done}",
      tags: ["{task-type}", "{project}"], importance: {6-8})
  2. Log to daily log:
    memory_daily_log(type: "done", entry: "{brief summary}")
  3. Link to related memories:
    memory_link(source: "{new_id}", target: "{related_id}", relation: "related")
  4. Notify if significant (10+ min task, importance ≥ 8, or error):
    messenger_send(platform: "telegram", message: "✅ {summary}")

Phase 4: Proactive Intelligence

Without being asked:

  1. Suggest relevant skills when detecting user intent (unless proactive is disabled)
  2. Warn about risks: destructive commands, large blast radius, missing tests
  3. Fetch API docs automatically when coding against external APIs: chub_search → chub_get
  4. Flag stale memories if retrieved context is >30 days old
  5. Annotate discoveries: chub_annotate when finding API quirks or workarounds

User Context

  • Name: Evan Lee (이학성)
  • Role: Rutile Corp CEO, Sapiens Development Lead
  • Key Projects: Sapiens (Web3 security audit AI), NEXUS (OSINT), ARCHITECT (code generation)
  • Interests: Web3 security, AI agents, startup business

3-Tier Memory Model

LayerCategoryTTLPromotion Condition
Episodicdaily-logs, captures30d → monthly summaryaccess_count > 5 AND age > 7d
Workinginbox, tasks, sessions30d TTLimportance ≥ 7 OR access_count > 10
Long-termknowledge, people, projectsPermanent (importance ≥ 7)—

Communication Rules

  • Send important results as messenger notifications (Discord/Telegram)
  • Default language follows user preference; use English for English-language content
  • Critical alerts → all platforms; Normal → telegram only; Low → skip

MCP Servers (5 servers, 31 tools)

memory-manager (9 tools)

Persistent memory CRUD. File tree + SQLite FTS5 index + associative search.

  • memory_store — store a memory
  • memory_search — search (FTS, tags, category, associative mode)
  • memory_get — retrieve a single memory
  • memory_list — browse tree
  • memory_update — modify (append/replace/metadata)
  • memory_delete — delete
  • memory_daily_log — append to daily log
  • memory_search_date — search by date range
  • memory_stats — statistics

Associative search (v2): memory_search(associative: true, context: { tags, related_id, date }) Composite ranking across 5 signals: FTS, tags, graph, time, access frequency.

knowledge-engine (6 tools)

Knowledge graph, similarity search, refinement pipeline, archive.

  • memory_link — manage relationships between memories (related, derived, supersedes, blocks, contradicts, refines)
  • memory_graph — BFS knowledge graph traversal (depth 1–4)
  • memory_similar — trigram cosine similarity search
  • memory_refine — refine memories (normalize, consolidate, upgrade)
  • memory_archive — archive old memories (supports dry_run)
  • memory_reindex_trigrams — rebuild similarity index

messenger-bot (4 tools)

Bidirectional Discord/Telegram messaging.

  • messenger_send — send message (platform: discord|telegram|all)
  • messenger_read — read recent messages
  • messenger_poll — poll for new messages
  • messenger_status — check connection status

task-scheduler (7 tools)

Cron-based task scheduling. JSON storage + claude CLI execution.

  • task_create — create a scheduled task
  • task_list — list tasks
  • task_update — update a task
  • task_delete — delete a task
  • task_run_now — run immediately
  • task_history — execution history
  • task_generate_crontab — generate crontab file

context-hub (5 tools)

Curated API/SDK documentation registry with BM25 search, annotations, and feedback. 4,400+ libraries.

  • chub_search — search docs/skills by query, tags, language
  • chub_get — fetch doc content by ID with language/version selection
  • chub_list — list all available entries
  • chub_annotate — manage persistent local annotations (workarounds, quirks)
  • chub_feedback — rate doc quality (up/down with labels: accurate, outdated, incomplete, etc.)

Documentation Workflow (for any agent needing API/SDK docs):

  1. memory_search(tag: "api-docs", query: "{library}") — check cached
  2. chub_search(query: "{library}") — find in registry
  3. chub_get(id: "{id}", lang: "{lang}") — fetch content
  4. memory_store(category: "knowledge", tags: ["api-docs"]) — persist
  5. chub_annotate(id: "{id}", note: "{discovery}") — annotate for future sessions
  6. memory_link(source: doc_id, target: project_id) — connect to project graph

OMC Tools (via oh-my-claudecode plugin)

Code intelligence, state management, and analysis tools provided by the OMC orchestration layer:

  • LSP (9 tools): lsp_hover, lsp_goto_definition, lsp_find_references, lsp_diagnostics, lsp_diagnostics_directory, lsp_document_symbols, lsp_workspace_symbols, lsp_rename, lsp_code_actions
  • AST (2 tools): ast_grep_search, ast_grep_replace — structural code search/replace with meta-variables
  • State (5 tools): state_read, state_write, state_clear, state_list_active, state_get_status
  • Notepad (4 tools): notepad_read, notepad_write_priority, notepad_write_working, notepad_write_manual
  • Python REPL (1 tool): python_repl — persistent REPL for data analysis and computation
  • Trace (2 tools): trace_summary, trace_timeline — evidence-driven causal tracing

Automated Tasks (3)

TaskcronDescription
nightly-refinement0 3 * * *Detect and merge duplicates, archive stale memories, re-index trigrams
weekly-decay0 4 * * 0Apply importance decay, process layer promotion candidates
monthly-summary0 5 1 * *Generate monthly memory summary, archive old daily-logs
weekly-self-optimize0 2 * * 1Every Monday 02:00 — run self-optimization cycle

Builder Ethos (see docs/ETHOS.md)

5 principles: Boil the Lake (complete implementation) | Search Before Building (4-tier knowledge) | Build for Yourself | Memory is Cheap (always persist) | Delegate or Die (delegate to the right agent)

Auto-Routing Table

When a task matches these patterns, activate the corresponding skill/agent AUTOMATICALLY (don't ask, just do it):

SituationRecommended Skill
Brainstorming / idea exploration/office-hours
Debugging / error analysis/investigate
Testing / QA/qa
Code review/code-review
Deployment / PR creation/ship
Retrospective / review/retro
Production / live system work/careful
Restrict edit scope/freeze
Maximum safety mode/guard
Memory management/memory-ops
Daily routine/daily-routine
Web research/web-researcher
Knowledge cleanup/knowledge-refiner
Complex multi-file refactor/oh-my-claudecode:autopilot or /oh-my-claudecode:ultrawork
Need consensus on approach/oh-my-claudecode:ralplan
Persistent loop until done/oh-my-claudecode:ralph
UI/UX design workOMC designer agent
Data analysis / computationOMC scientist agent + python_repl
Code cleanup / anti-slop/oh-my-claudecode:ai-slop-cleaner
Deep requirements interview/oh-my-claudecode:deep-interview

Proactive toggle: state_write("occ-proactive", "false") — disable when the user says "stop suggesting"

Skill Template System

Skills are auto-generated from SKILL.md.tmpl templates. Do not edit SKILL.md files directly.

node scripts/gen-skill-docs.mjs           # regenerate all skills
node scripts/gen-skill-docs.mjs ship       # regenerate a specific skill
node scripts/skill-check.mjs              # health check

Shared blocks (scripts/template-blocks/): {{OCC_PREAMBLE}} {{OCC_MEMORY_INIT}} {{OCC_MEMORY_PERSIST}} {{OCC_MESSENGER_NOTIFY}} {{OCC_OMC_DELEGATION}} {{OCC_BASE_BRANCH_DETECT}} {{OCC_COMPLETION_STATUS}} {{OCC_ETHOS}} {{OCC_TEST_BOOTSTRAP}} {{OCC_ASK_FORMAT}}

Skills (21)

v1 Core Skills

SkillTriggersDescription
/task-analyzer"분석해", "작업 계획", "이거 해줘" / "analyze", "task plan", "do this"Autonomous task analysis, decomposition, and execution
/memory-ops"기억해", "저장해", "메모리" / "remember", "save", "memory"Unified memory store/search/cleanup
/research-collector"조사해", "리서치", "찾아봐" / "research", "look it up"Web research → structured output → store
/daily-routine"오늘 할일", "브리핑", "주간 회고" / "today's tasks", "briefing", "weekly review"Morning briefing, evening review, weekly retrospective

v2 Workflow Skills

SkillTriggersDescription
/knowledge-refiner"메모리 정리", "중복 제거", "refine" / "clean memory", "remove duplicates"Detect and merge duplicates, archive, promote layers
/doc-fetcher"API 문서", "docs for X" / "API docs"chub MCP + web-fallback doc lookup + annotations + feedback + knowledge graph
/session-tracker"마지막 세션", "어디까지 했지" / "last session", "where were we"Cross-session context continuity
/code-review"코드 리뷰", "리뷰해줘" / "code review", "review this"Scope drift detection + Fix-First multi-pass review + WTF-likelihood
/ship"배포", "ship it", "PR 만들어" / "deploy", "create PR"8.5-step automated release (test→coverage→review→commit→PR)
/investigate"디버깅", "버그 찾아", "왜 안 돼" / "debug", "find the bug", "why is this broken"6-step systematic debugging (Iron Law + reproduce + scope lock + 3-strike)
/web-researcher"웹에서 찾아", "최신 정보" / "search the web", "latest info"Multi-angle web search → structured output → memory store + graph link

v3 Safety Skills (gstack adaptation)

SkillTriggersDescription
/freeze"freeze", "편집 제한", "이 폴더만" / "restrict edits", "this folder only"Hook-based edit scope restriction (blocks Edit/Write)
/careful"careful", "조심", "안전 모드" / "be careful", "safe mode"Warn on dangerous commands (rm -rf, DROP, force-push, etc.)
/guard"guard", "가드", "최대 안전" / "maximum safety"Combined freeze + careful safety mode
/unfreeze"unfreeze", "잠금 해제" / "unlock edits"Release freeze edit restrictions

v3 Workflow Skills (gstack adaptation)

SkillTriggersDescription
/qa"QA", "테스트", "버그 찾아서 고쳐" / "test", "find and fix bugs"Test→Fix→Verify cycle + WTF-likelihood self-regulation
/office-hours"브레인스토밍", "아이디어", "사업 아이디어" / "brainstorm", "idea", "business idea"6 forced questions + design document generation
/retro"회고", "retro", "이번 주 리뷰" / "retrospective", "this week's review"git+memory combined engineering retrospective + trend tracking

Refinement Pipeline

DETECT → ANALYZE → REFINE → STORE
  │         │         │        │
  │ 30d     │ tri-    │ merge  │ version save
  │ no-     │ gram    │ upgrade│ link create
  │ access  │ simi-   │ archive│ FTS re-index
  │ low-imp │ larity  │ decay  │ report
  • detector.js: detects stale (30d), unused (7d), low-importance (< 4, 14d)
  • analyzer.js: similarity clustering, contradiction detection, promotion eligibility check
  • refiner.js: executes merge/upgrade/archive/decay, preserves versions

OMC Integration (oh-my-claudecode × OpenClaw-CC)

Agent → Memory Routing

All OMC agents must leverage OpenClaw-CC's persistent memory:

On task start: memory_search(associative: true) — auto-load relevant past context On task completion: memory_store — persist key results, decisions, and findings

OMC AgentStart SearchCompletion StoreCategory
executormemory_search(query: "{task}")Implementation result + changed file listprojects
debuggermemory_search(tag: "bug")Root cause + fix detailsknowledge/debugging
tracermemory_search(query: "{symptom}")Trace path + evidenceknowledge/debugging
code-reviewermemory_search(tag: "code-review")Review result + issues foundprojects
security-reviewermemory_search(tag: "security")Vulnerabilities + remediationknowledge/security
architectmemory_search(tag: "architecture")Design decisions + tradeoffsprojects
verifiermemory_search(query: "{verification}")Verification evidence + test resultsprojects
test-engineermemory_search(tag: "test")Test strategy + coverageprojects
plannermemory_search(query: "{plan}")Execution plan + dependenciesprojects
scientistmemory_search(query: "{research}")Analysis results + dataknowledge
designermemory_search(tag: "design")UI/UX decisions + component specsprojects
qa-testermemory_search(tag: "qa")Test results + verification evidenceprojects
code-simplifiermemory_search(tag: "refactor")Simplification results + before/afterprojects
git-mastermemory_search(tag: "release")Commit strategy + release notesprojects
criticmemory_search(tag: "review")Critical analysis + risk assessmentprojects
writermemory_search(tag: "docs")Documentation artifactsknowledge
product-managermemory_search(tag: "product")PRD + requirements + personasprojects
document-specialistmemory_search(tag: "api-docs")External doc references + chub annotationsknowledge
explore(none — read-only)(none — read-only)—

Messenger Notification Rules

Automatically call messenger_send(platform: "telegram") in the following situations:

  • OMC team pipeline completes (team-verify passes)
  • Verification fails (verifier returns BLOCKED)
  • Long-running task completes (10+ minutes)
  • cron task execution results
  • Memory with importance ≥ 8 is created

Team Decision Persistence

Auto-store the result of each OMC team pipeline stage:

team-plan  → memory_store(category: "projects", tags: ["team-plan", "{project}"])
team-prd   → memory_store(category: "projects", tags: ["prd", "{project}"])
team-exec  → memory_daily_log(type: "done", entry: "{summary}")
team-verify → memory_store(category: "projects", tags: ["verification", "{project}"])
team-fix   → memory_link(relation: "refines", source: fix_id, target: original_id)

Project-Local Agents

OpenClaw-CC dedicated agents defined in .claude/agents/:

  • memory-specialist (sonnet) — expert in 15 memory + knowledge-engine tools
  • comms-agent (haiku) — expert in 4 messenger tools + 7 scheduler tools
  • research-agent (sonnet) — web research + memory deduplication + graph linking
  • session-manager (haiku) — OMC state ↔ OpenClaw-CC memory bridge

v3 OMC Integration Skills

SkillTriggersDescription
/autonomous-ops"자율 모드", "24/7" / "autonomous mode"Messenger receive → team execute → memory store → report loop
/knowledge-sync"지식 동기화", "sync" / "knowledge sync"Bidirectional sync: OMC project-memory ↔ OpenClaw-CC memory
/deep-research"심층 조사", "deep research"3×research-agent parallel → analyst synthesis → knowledge graph expansion

Directory Structure

openclaw-cc/
├── CLAUDE.md                  ← this file
├── .mcp.json                  ← MCP server config (4 servers)
├── .claude/
│   ├── agents/                ← project-local agents (v3)
│   │   ├── memory-specialist.md
│   │   ├── comms-agent.md
│   │   ├── research-agent.md
│   │   └── session-manager.md
│   └── settings.local.json   ← includes hooks config
├── docs/
│   └── ETHOS.md               ← builder philosophy (5 principles)
├── mcp-servers/
│   ├── memory-manager/        ← memory MCP (9 tools)
│   ├── knowledge-engine/      ← knowledge engine MCP (6 tools)
│   │   └── src/refinement/    ← refinement pipeline (detector/analyzer/refiner)
│   ├── messenger-bot/         ← Discord/Telegram MCP (4 tools)
│   └── task-scheduler/        ← task scheduler MCP (7 tools)
├── skills/                    ← 21 skills (v1:4 + v2:7 + v3-safety:4 + v3-workflow:3 + v3-omc:3)
│   ├── task-analyzer/         ← task analysis (OMC team delegation)
│   ├── memory-ops/            ← memory management
│   ├── research-collector/    ← research collection
│   ├── daily-routine/         ← daily routine
│   ├── knowledge-refiner/     ← knowledge refinement (v2)
│   ├── doc-fetcher/           ← documentation lookup (v2)
│   ├── session-tracker/       ← session tracking (v2)
│   ├── code-review/           ← multi-pass review + scope drift (v2, enhanced)
│   ├── ship/                  ← 8.5-step release automation (v2, enhanced)
│   ├── investigate/           ← 6-step systematic debugging + scope lock (v2, enhanced)
│   ├── web-researcher/        ← web research (v2)
│   ├── freeze/                ← hook-based edit scope restriction (v3, gstack)
│   ├── careful/               ← dangerous command warnings (v3, gstack)
│   ├── guard/                 ← freeze+careful combined (v3, gstack)
│   ├── unfreeze/              ← release freeze (v3, gstack)
│   ├── qa/                    ← Test→Fix→Verify QA (v3, gstack)
│   ├── office-hours/          ← idea validation + design doc (v3, gstack)
│   ├── retro/                 ← engineering retrospective (v3, gstack)
│   ├── autonomous-ops/        ← 24/7 autonomous operations (v3)
│   ├── knowledge-sync/        ← OMC↔CC memory sync (v3)
│   └── deep-research/         ← multi-agent deep research (v3)
├── memory-store/              ← persistent memory storage
│   ├── inbox/
│   ├── projects/
│   ├── people/
│   ├── knowledge/
│   ├── daily-logs/
│   └── tasks/
├── scheduler-data/            ← task scheduler data (3 cron jobs registered)
├── docs/
│   └── ETHOS.md               ← builder philosophy (5 principles)
├── package.json               ← skill build scripts
└── scripts/                   ← utility scripts
    ├── gen-skill-docs.mjs     ← SKILL.md.tmpl → SKILL.md generator
    ├── skill-check.mjs        ← skill health check
    ├── template-blocks/       ← shared template blocks (10)
    ├── setup.sh
    ├── webhook-bridge.js
    ├── daemon.sh
    ├── openclaw-cc@.service
    ├── hud-extension.mjs      ← HUD extension (v3)
    └── hooks/                 ← project hooks (v3)
        ├── session-start.mjs
        ├── pre-compact.mjs
        ├── post-memory-store.mjs
        ├── subagent-stop.mjs
        └── session-end.mjs

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.