{"id":47996590,"url":"https://github.com/yurukusa/claude-code-ops-starter","last_synced_at":"2026-04-04T12:00:51.249Z","repository":{"id":338511279,"uuid":"1158134328","full_name":"yurukusa/claude-code-ops-starter","owner":"yurukusa","description":"16 hooks + 3 tools + 5 templates for autonomous Claude Code operation. Production-ready in 15 minutes.","archived":false,"fork":false,"pushed_at":"2026-03-21T10:27:05.000Z","size":121,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-04T11:59:58.126Z","etag":null,"topics":["ai-agents","anthropic","automation","autonomous-ai","claude","claude-code","cli","developer-tools","devops","hooks","llm","shell-scripts"],"latest_commit_sha":null,"homepage":"https://yurukusa.gumroad.com/l/cc-codex-ops-kit","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yurukusa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"yurukusa","ko_fi":"yurukusa","custom":["https://yurukusa.github.io/cc-ops-kit-landing/"]}},"created_at":"2026-02-14T21:13:55.000Z","updated_at":"2026-03-21T10:56:41.000Z","dependencies_parsed_at":"2026-04-04T12:00:31.645Z","dependency_job_id":null,"html_url":"https://github.com/yurukusa/claude-code-ops-starter","commit_stats":null,"previous_names":["yurukusa/claude-code-ops-starter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yurukusa/claude-code-ops-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yurukusa%2Fclaude-code-ops-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yurukusa%2Fclaude-code-ops-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yurukusa%2Fclaude-code-ops-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yurukusa%2Fclaude-code-ops-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yurukusa","download_url":"https://codeload.github.com/yurukusa/claude-code-ops-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yurukusa%2Fclaude-code-ops-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31398770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","anthropic","automation","autonomous-ai","claude","claude-code","cli","developer-tools","devops","hooks","llm","shell-scripts"],"created_at":"2026-04-04T12:00:28.568Z","updated_at":"2026-04-04T12:00:51.231Z","avatar_url":"https://github.com/yurukusa.png","language":"Shell","readme":"# Claude Code Ops Starter\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n[![Bash](https://img.shields.io/badge/Language-Bash-4EAA25.svg)](https://www.gnu.org/software/bash/)\n[![Claude Code](https://img.shields.io/badge/Claude_Code-Hooks-blueviolet.svg)](https://docs.anthropic.com/en/docs/claude-code)\n\n**Spend less time babysitting your AI.** 16 production-tested hooks + 3 tools + 5 templates that let Claude Code run with less supervision — catching errors, managing context, and making decisions without asking you constantly.\n\n\u003ca href=\"https://github.com/yurukusa/claude-code-ops-starter/blob/main/assets/risk-score-fix-demo.svg\"\u003e\u003cimg src=\"assets/risk-score-fix-demo.svg\" alt=\"risk-score --fix demo: CRITICAL 16/19 → HIGH 7/19 in 30 seconds\" width=\"700\"\u003e\u003c/a\u003e\n\n```bash\n# Try it now (read-only scan, nothing installed)\ncurl -sL https://gist.githubusercontent.com/yurukusa/10c76edee0072e2f08500dd43da30bc3/raw/risk-score.sh | bash\n\n# Auto-fix with free hooks (non-destructive, existing files kept)\ncurl -sL https://gist.githubusercontent.com/yurukusa/10c76edee0072e2f08500dd43da30bc3/raw/risk-score.sh | bash -s -- --fix\n```\n\nExtracted from 160+ hours of real autonomous operation that shipped a [15,000-line game](https://yurukusa.itch.io/azure-flame) without the human writing code themselves.\n\n### Before vs After\n\n| Without hooks | With hooks |\n|--------------|-----------|\n| Claude asks \"should I continue?\" every 5 min | Claude decides and logs uncertainty |\n| Syntax errors found 50 tool calls later | Errors caught immediately after every edit |\n| Session runs out of context without warning | Staged warnings at 80/120/150 tool calls |\n| `rm -rf` executes with no warning | Destructive commands flagged before execution |\n\n## What's Included\n\n### 10 Hooks\n\n| Hook | What it does |\n|------|-------------|\n| `context-monitor.sh` | Tracks context window usage with staged warnings (soft/hard/critical) |\n| `no-ask-human.sh` | Blocks \"should I continue?\" questions — forces autonomous decisions |\n| `syntax-check.sh` | Auto-runs syntax verification after every file edit (Python, Shell, JSON) |\n| `decision-warn.sh` | Flags destructive commands (`rm -rf`, `git reset --hard`) before execution |\n| `activity-logger.sh` | Logs every tool call with timestamps for post-session audit |\n| `branch-guard.sh` | Prevents direct commits to main/master — forces feature branches |\n| `error-gate.sh` | Blocks continuation after 3+ consecutive errors — forces root cause analysis |\n| `cdp-safety-check.sh` | Validates CDP browser targets before automation runs |\n| `proof-log-session.sh` | Auto-generates session proof logs for accountability |\n| `session-start-marker.sh` | Stamps session metadata on startup for tracking |\n\n### 3 Tools\n\n| Tool | What it does |\n|------|-------------|\n| `claude-md-generator.sh` | Interactive CLAUDE.md generator — answer 8 questions, get a tailored config |\n| `risk-score.sh` | Check your autonomous operations safety in 10 seconds — scores 10 items, links to fixes |\n| `cc-solo-watchdog.sh` | Idle detector — monitors your Claude pane and sends a nudge when it goes quiet |\n\n### 6 Templates + 3 Config Examples\n\n| File | What it does |\n|------|-------------|\n| `templates/CLAUDE.md` | Baseline instructions for autonomous operation |\n| `templates/CLAUDE-autonomous.md` | Extended CLAUDE.md for fully autonomous sessions |\n| `templates/LESSONS.md` | Self-improvement tracking template |\n| `templates/dod-checklists.md` | Definition of Done checklists for quality gates |\n| `templates/mission.md` | Mission focus template for session continuity |\n| `templates/task-queue.yaml` | Structured task queue format |\n| `examples/settings.json` | Standard settings with all 16 hooks configured |\n| `examples/settings-autonomous.json` | Settings for fully autonomous sessions |\n| `examples/settings-minimal.json` | Minimal 4-hook config for getting started |\n| `install.sh` | One-command setup — installs hooks, copies templates, prints config |\n\n## Quick Start\n\n```bash\ngit clone https://github.com/yurukusa/claude-code-ops-starter.git\ncd claude-code-ops-starter\nbash install.sh\n```\n\nThen add the hook configuration to your `~/.claude/settings.json` (the installer prints the exact JSON to copy-paste).\n\n## How the Hooks Work\n\n### Context Monitor\nCounts tool calls as a proxy for context window usage. Warns you at 3 thresholds:\n- **Soft (80 calls)**: \"Consider deferring large tasks\"\n- **Hard (120 calls)**: \"Wrap up and prepare to hand off\"\n- **Critical (150 calls)**: Auto-generates a checkpoint file for session handoff\n\n### No-Ask-Human\nBlocks **all** `AskUserQuestion` tool calls during unattended sessions. Instead of stopping to ask \"which approach should I use?\", the AI:\n1. Decides on its own\n2. Logs uncertainty to `~/pending_for_human.md`\n3. Moves to the next task\n\nTo temporarily re-enable questions: `export CC_ALLOW_QUESTIONS=1`\n\n### Syntax Check\nRuns after every `Edit` or `Write` tool call:\n- Python: `python -m py_compile`\n- Shell: `bash -n`\n- JSON: `jq empty`\n\nCatches syntax errors immediately instead of discovering them 50 tool calls later.\n\n### Decision Warn\nScans Bash commands for dangerous patterns (`rm -rf`, `git reset --hard`, `DROP TABLE`, etc.) and prints a warning. Doesn't block by default — uncomment one line in the script to enable hard blocking.\n\n## Dependencies\n\n- **Required**: `bash` (all hooks are shell scripts)\n- **Optional**: `jq` — used by `syntax-check.sh` and `decision-warn.sh` to parse hook input. If missing, these hooks silently skip (no errors, no crashes)\n- **Optional**: `python3` or `python` — used by `syntax-check.sh` for Python file checking. If missing, Python syntax checks are skipped\n\nInstall optional dependencies:\n```bash\n# Debian/Ubuntu\nsudo apt install jq python3\n\n# macOS\nbrew install jq python3\n```\n\n## Uninstall\n\n```bash\nrm ~/.claude/hooks/context-monitor.sh\nrm ~/.claude/hooks/no-ask-human.sh\nrm ~/.claude/hooks/syntax-check.sh\nrm ~/.claude/hooks/decision-warn.sh\n```\n\nThen remove the corresponding `hooks` entries from `~/.claude/settings.json`.\n\n## Generate Your CLAUDE.md\n\nDon't know where to start? The generator asks 8 questions and produces a project-specific `CLAUDE.md` with safety rules built in:\n\n```bash\nbash tools/claude-md-generator.sh\n```\n\nOr use defaults for a quick start:\n\n```bash\nbash tools/claude-md-generator.sh --defaults --output ~/.claude/CLAUDE.md\n```\n\n## Risk Score: How Safe Is Your Setup?\n\nCheck your autonomous operations safety in 10 seconds:\n\n```bash\nbash tools/risk-score.sh\n```\n\nOr run it directly without cloning:\n\n```bash\ncurl -sL https://gist.githubusercontent.com/yurukusa/10c76edee0072e2f08500dd43da30bc3/raw/risk-score.sh | bash\n```\n\nChecks 10 items (CLAUDE.md, hooks, git safety, secrets, etc.) and shows a risk score with links to fixes.\n\n### Auto-fix mode\n\nDiagnose and fix in one command:\n\n```bash\ncurl -sL https://gist.githubusercontent.com/yurukusa/10c76edee0072e2f08500dd43da30bc3/raw/risk-score.sh | bash -s -- --fix\n```\n\nThis runs the scan, installs the free hooks, then re-scans to show your improvement (e.g. CRITICAL 14/19 → MODERATE 5/19). Existing files are never overwritten.\n\n## Autonomous Loop: Keep Claude Moving While You're Away\n\nThe 4 hooks stop bad things from happening. `cc-solo-watchdog` keeps good things happening.\n\nWhen Claude finishes a task and sits idle, the watchdog detects the silence and sends it a nudge — a structured prompt containing your mission focus and task queue. Claude reads the nudge, picks the next task, and continues working. No human required.\n\n```bash\n# Step 1: enable the loop\ntouch ~/cc_loop.enabled\n\n# Step 2: start the watchdog (inside a tmux session)\nbash tools/cc-solo-watchdog.sh --bg\n```\n\nThe nudge message it sends looks like:\n\n```\n[idle 120s detected / 2026-03-01 14:30]\n\n▶ Decision tree — check in order\n1. Any content scheduled for today or earlier?  → publish it\n2. Any finished but unshipped work?             → ship it\n3. Top item in your task queue?                 → work on it\n4. Blocked 3+ times on one thing?              → log it in pending_for_human.md\n\n▶ Next task\n(your task queue output)\n\n▶ Mission focus\n(first items from your ~/ops/mission.md)\n```\n\n**Settings** (configurable at the top of the script):\n\n| Variable | Default | What it controls |\n|----------|---------|-----------------|\n| `IDLE_THRESHOLD` | 120s | How long before a nudge is sent |\n| `NUDGE_COOLDOWN` | 300s | Minimum gap between nudges |\n| `MAX_NUDGES_PER_HOUR` | 4 | Safety cap on nudge rate |\n| `TMUX_SESSION` | `cc` | tmux session name to watch |\n\n**Prerequisites**: tmux, Claude Code running in a tmux session.\n\n**To stop**: `bash tools/cc-solo-watchdog.sh --stop` or `rm ~/cc_loop.enabled`\n\n---\n\n## Self-Check: Is Your Autonomous Setup Safe?\n\nBefore adding hooks, check where your current workflow stands. This 10-item checklist covers the most common failure points from 160+ hours of autonomous operation:\n\n**[Claude Code Ops Self-Check (10 items)](https://gist.github.com/yurukusa/23b172374e2e32bdff7d85d21e0f19a2)** — 5 minutes to read, no signup required.\n\nCovers: context monitoring, dangerous command blocking, session state saving, external send approval, error root cause analysis, and more. Each item includes a real failure example and a fix.\n\n---\n\n## Sleep While Shipping\n\nThe full system — 16 hooks + watchdog + templates + examples — is what enabled **20+ autonomous sessions in a single day** while the human slept.\n\n### Free vs. Ops Kit\n\n| | [Free: claude-code-hooks](https://github.com/yurukusa/claude-code-hooks) | Ops Kit ($19) |\n|---|---|---|\n| Hooks | 16 hooks (copy \u0026 configure yourself) | Same 16 hooks, pre-configured |\n| Templates | 5 templates | 5 templates (+ baseline CLAUDE.md) |\n| Tools | — | 3 tools (watchdog, CLAUDE.md generator, risk-score) |\n| Config examples | — | 3 ready-to-use settings.json variants |\n| install.sh | — | One-command setup |\n| Setup time | ~45 min (read docs, configure each hook) | ~15 min (run install.sh, done) |\n\nThe free repo gives you all the parts. The Ops Kit gives you the assembled, tested, ready-to-run package.\n\n**[Get the Ops Kit — $19](https://yurukusa.github.io/cc-ops-kit-landing/?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=ops-starter\u0026utm_content=sleep-while-shipping)**\n\n## Background\n\nThis toolkit emerged from a real experiment: a non-engineer using Claude Code to build a complete game (15,000+ lines of Python) with minimal human intervention. Every hook in this repo solved a real problem encountered during autonomous operation.\n\nRead more:\n- [4 Hooks That Let Claude Code Run Autonomously](https://dev.to/yurukusa/4-hooks-that-let-claude-code-run-autonomously-with-zero-babysitting-1748) (dev.to) — deep dive into each hook\n- [5 Design Patterns for LLM Agent Teams](https://dev.to/yurukusa/5-design-patterns-for-llm-agent-teams-from-someone-who-learned-them-the-hard-way-5f7n) (dev.to) — the patterns behind these hooks\n- [Agent Teamsのアーキテクチャ：5エージェント並列運用の実践](https://zenn.dev/yurukusa/articles/5ffe1ad48fde58) (Zenn) — multi-agent orchestration\n- [I Made $2: A Non-Engineer's First Game Sale](https://dev.to/yurukusa/i-made-2-a-non-engineers-first-game-sale-built-entirely-with-ai-3i11) (dev.to) — the full story\n\n## License\n\nMIT License. Use it, modify it, share it.\n\n## Contributing\n\nIssues and PRs welcome. If you build a hook that helps your autonomous workflow, please share it.\n\n---\n\n**[@yurukusa_dev](https://x.com/yurukusa_dev)** on X\n","funding_links":["https://github.com/sponsors/yurukusa","https://ko-fi.com/yurukusa","https://yurukusa.github.io/cc-ops-kit-landing/"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyurukusa%2Fclaude-code-ops-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyurukusa%2Fclaude-code-ops-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyurukusa%2Fclaude-code-ops-starter/lists"}