{"id":38073145,"url":"https://github.com/shuntaka9576/blocc","last_synced_at":"2026-01-16T20:40:32.952Z","repository":{"id":303891337,"uuid":"1017056097","full_name":"shuntaka9576/blocc","owner":"shuntaka9576","description":"Execute multiple commands and block Claude Code Hooks by returning exit 2 with stderr on failures 🛡️","archived":false,"fork":false,"pushed_at":"2025-08-05T05:37:59.000Z","size":419,"stargazers_count":11,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-13T03:42:40.678Z","etag":null,"topics":["claude","claudecode","hooks"],"latest_commit_sha":null,"homepage":"","language":"Go","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/shuntaka9576.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-07-10T00:49:16.000Z","updated_at":"2025-10-24T21:33:24.000Z","dependencies_parsed_at":"2025-07-10T10:04:05.048Z","dependency_job_id":"91669e2b-1f5c-4168-af99-149953d56506","html_url":"https://github.com/shuntaka9576/blocc","commit_stats":null,"previous_names":["shuntaka9576/blocc"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/shuntaka9576/blocc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuntaka9576%2Fblocc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuntaka9576%2Fblocc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuntaka9576%2Fblocc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuntaka9576%2Fblocc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shuntaka9576","download_url":"https://codeload.github.com/shuntaka9576/blocc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuntaka9576%2Fblocc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28482274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"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":["claude","claudecode","hooks"],"created_at":"2026-01-16T20:40:32.825Z","updated_at":"2026-01-16T20:40:32.922Z","avatar_url":"https://github.com/shuntaka9576.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# blocc\n\n`blocc` is a CLI tool that executes multiple commands and blocks Claude Code hooks by returning exit code 2 when any command fails.\n\n1. blocc executed from Hooks caught errors from the specified command, consolidated output to stderr, and returned exit code 2 to provide feedback to Claude Code.\n2. Claude Code automatically fixed the clippy warnings by updating the println! syntax to the modern format. ✨\n\n![img](./docs/blocc-behavior.png)\n\n## Installation\n\n```bash\nbrew install shuntaka9576/tap/blocc\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eGo install\u003c/summary\u003e\n\n```bash\ngo install github.com/shuntaka9576/blocc/cmd/blocc@latest\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eFrom source\u003c/summary\u003e\n\n```bash\ngit clone https://github.com/shuntaka9576/blocc.git\ncd blocc\nmake install\n```\n\u003c/details\u003e\n\n## QuickStart\n\nInitialize Claude Code hooks configuration with blocc.\n\n```bash\n# Initialize with interactive setup\n$ blocc --init\nInclude stdout in error output? (y/N): y\nAdd stdout filter? (y/N): n\nAdd stderr filter? (y/N): n\nExclude stderr from error output? (y/N): n\nEnter commands to run (one per line, empty line to finish):\nmake lint\nmake test\n\nSuccessfully created .claude/settings.local.json\n```\n\nThis creates `./.claude/settings.local.json`.\n\n\u003e **Note**: It's recommended to configure hooks to trigger on `Stop` events. Using `PostToolUse` hooks may cause the AI model to become distracted or consume extra context unnecessarily.\n\n```json\n{\n  \"hooks\": {\n    \"Stop\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"blocc --stdout 'make lint' 'make test'\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n## Usage\n\n```bash\n$ blocc --help\nUsage: main [\u003ccommands\u003e ...] [flags]\n\nArguments:\n  [\u003ccommands\u003e ...]    Commands to execute\n\nFlags:\n  -h, --help                    Show context-sensitive help.\n  -v, --version                 Show version information\n  -p, --parallel                Execute commands in parallel\n  -m, --message=STRING          Custom error message\n  -i, --init                    Initialize settings.local.json\n  -s, --stdout                  Include stdout in error output\n  -o, --stdout-filter=STRING    Filter command for stdout\n  -e, --stderr-filter=STRING    Filter command for stderr\n  -n, --no-stderr               Exclude stderr from error output\n\n# Execute commands sequentially (default).\n$ blocc \"npm run lint\" \"npm run test\"\n{\n  \"message\": \"2 command(s) failed\",\n  \"results\": [\n    {\n      \"command\": \"npm run lint\",\n      \"exitCode\": 1,\n      \"stderr\": \"Linting errors found...\"\n    },\n    {\n      \"command\": \"npm run test\",\n      \"exitCode\": 1,\n      \"stderr\": \"Test failures...\"\n    }\n  ]\n}\n\n# Execute commands in parallel(-p).\n$ blocc --parallel \"npm run lint\" \"npm run test\" \"npm run spell-check\"\n\n# Custom error message(-m).\n$ blocc --message \"Hook execution completed with errors. Please address the following issues\" \"npm run lint\" \"npm run test\"\n\n# Include stdout in error output(-s).\n$ blocc --stdout \"npm run lint\" \"npm run test\"\n\n# Filter output for context engineering(-o/-e).\n$ blocc -n -s \"cspell lint . --cache --gitignore\" -o \"perl -nle 'print \\$1 if /Unknown word \\((\\w+)\\)/' | sort | uniq\"\n{\n  \"message\": \"1 command(s) failed\",\n  \"results\": [\n    {\n      \"command\": \"cspell lint . --cache --gitignore\",\n      \"exitCode\": 1,\n      \"stdout\": \"alecthomas\\nBINPATH\\nblocc\\nBlocc\\nclippy\\nDISTPATH\\ngofmt\\ngolangci\\nGOPATH\\ngoreleaser\\ngotextdiff\\nhexops\\nnonexistentcommand\\nnosec\\noicd\\nprintln\\nrepr\\nshuntaka\\nvxeg\\n\"\n    }\n  ]\n}\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuntaka9576%2Fblocc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshuntaka9576%2Fblocc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuntaka9576%2Fblocc/lists"}