{"_id":"@agent-mokugyo/hooks","name":"@agent-mokugyo/hooks","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@agent-mokugyo/hooks","version":"0.1.0","description":"Auto-knock the mokugyo when Claude Code / Codex completes a meaningful task","type":"module","bin":{"mokugyo-hooks":"bin/mokugyo-hooks.mjs"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/agent-mokugyo/agent-mokugyo-hooks.git"},"keywords":["claude-code","codex","hooks","mokugyo","agent","completion-signal"],"license":"MIT","gitHead":"5f89f6392d1a21da0af8ca529071af21a016993e","_id":"@agent-mokugyo/hooks@0.1.0","bugs":{"url":"https://github.com/agent-mokugyo/agent-mokugyo-hooks/issues"},"homepage":"https://github.com/agent-mokugyo/agent-mokugyo-hooks#readme","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-CxkgIjT4+O4dIpXdcXa/T6NraqQFL4lyyn7Mh9onQKAdfIlrCFOFmekYS3e7LkTlXl/2Z6j9fA4e0l9bCzs5KA==","shasum":"7550cd6bd79cedab62331699eda2f2f41a73fc23","tarball":"https://registry.npmjs.org/@agent-mokugyo/hooks/-/hooks-0.1.0.tgz","fileCount":4,"unpackedSize":8668,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICslJyai0/WiJEnegNGePOXAKG4/kN6I1a0BSJe0vjHpAiEAocZYzf3XvgOhTfO/12OOG7W2ZNLicwXVqRbZbalnB3c="}]},"_npmUser":{"name":"coze_plt","email":"penglongteng@bytedance.com"},"directories":{},"maintainers":[{"name":"coze_plt","email":"penglongteng@bytedance.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/hooks_0.1.0_1783007451550_0.09314677245732605"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-02T15:50:51.313Z","0.1.0":"2026-07-02T15:50:51.697Z","modified":"2026-07-02T15:50:52.025Z"},"maintainers":[{"name":"coze_plt","email":"penglongteng@bytedance.com"}],"description":"Auto-knock the mokugyo when Claude Code / Codex completes a meaningful task","homepage":"https://github.com/agent-mokugyo/agent-mokugyo-hooks#readme","keywords":["claude-code","codex","hooks","mokugyo","agent","completion-signal"],"repository":{"type":"git","url":"git+https://github.com/agent-mokugyo/agent-mokugyo-hooks.git"},"bugs":{"url":"https://github.com/agent-mokugyo/agent-mokugyo-hooks/issues"},"license":"MIT","readme":"# @agent-mokugyo/hooks\n\n> Auto-knock the mokugyo desk companion when Claude Code / Codex finishes meaningful work.\n\nOne command installs a [Stop hook](https://docs.anthropic.com/en/docs/claude-code/hooks) into your Claude Code / Codex settings. When the Agent completes a task that involved real tool use (file edits, code execution, etc.), the hook automatically sends a knock to the Mokugyo backend — driving the physical desk-cat device or simulator.\n\nPure chat responses (no tool use) are silently ignored.\n\n## Install\n\n```bash\nnpx @agent-mokugyo/hooks install\n```\n\nThis injects a Stop hook entry into `~/.claude/settings.json`.\n\n## Uninstall\n\n```bash\nnpx @agent-mokugyo/hooks uninstall\n```\n\n## Configuration\n\nSet these environment variables (all optional):\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `MOKUGYO_BACKEND_URL` | `http://localhost:8080` | Mokugyo backend HTTP address |\n| `MOKUGYO_DEVICE_ID` | `desk-cat-001` | Target device ID |\n| `MOKUGYO_TOKEN` | — | Bearer token if backend requires auth |\n\n## How It Works\n\n1. Claude Code finishes responding → fires the **Stop** hook\n2. `on-stop.mjs` reads the hook context (stdin JSON with `transcript_path`)\n3. Parses the JSONL transcript to find the last assistant turn\n4. Counts `tool_use` blocks — if > 0, the Agent did meaningful work\n5. POSTs a knock to the backend (count scales with tool uses, max 8)\n6. If backend is unreachable, silently exits (never blocks Claude)\n\n## Knock Behavior\n\n| Tool uses | Count | Pattern | Intensity |\n|-----------|-------|---------|-----------|\n| 1–2 | 1–2 | single | normal |\n| 3–4 | 3–4 | short-short-long | normal |\n| 5–8 | 5–8 | short-short-long | strong |\n\n## Requirements\n\n- Node.js 18+ (for native `fetch`)\n- Claude Code or Codex (provides the hooks infrastructure)\n- Mokugyo backend running at `MOKUGYO_BACKEND_URL` (see [agent-mokugyo](https://github.com/agent-mokugyo) for setup)\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-50d39a78806c6f86079a7993f3ee0ddc"}