{"_id":"@dartchuk-s/cc-discipline","_rev":"2-539aebcf031ccaa856419bc67e03af93","name":"@dartchuk-s/cc-discipline","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@dartchuk-s/cc-discipline","version":"0.1.0","author":{"url":"https://github.com/sergeymanson","name":"sergeymanson","email":"manson047@gmail.com"},"license":"MIT","_id":"@dartchuk-s/cc-discipline@0.1.0","maintainers":[{"name":"dartchuk-s","email":"manson047@gmail.com"}],"homepage":"https://github.com/sergeymanson/cc-discipline#readme","bugs":{"url":"https://github.com/sergeymanson/cc-discipline/issues"},"bin":{"cc-discipline":"dist/index.js"},"dist":{"shasum":"5b09e51bb5a9b1c65987976093065da61d00f0e5","tarball":"https://registry.npmjs.org/@dartchuk-s/cc-discipline/-/cc-discipline-0.1.0.tgz","fileCount":11,"integrity":"sha512-mSgObwvcsc1tmMmnsTDxh4SR4HamXwX9pl9m0WTpphKOyRuLnnzfob6dKTFFWUVICxPCTd9UqDCLPXT8X6FGTA==","signatures":[{"sig":"MEYCIQDEJQEX+sXNBW0U6XCSYK5JQtEPyTnLP/4YSeDFOd2BngIhAK+a++ai36GyMYMwYpXrngyWPnmrS7NfixizrP4yKkF8","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16579},"engines":{"node":">=24"},"gitHead":"bce5fc915354b4ed5e88cc7305b36345d76fcde6","scripts":{"test":"npm run build && node --test","build":"tsc","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"dartchuk-s","email":"manson047@gmail.com"},"repository":{"url":"git+https://github.com/sergeymanson/cc-discipline.git","type":"git"},"_npmVersion":"11.12.1","description":"Claude Code SessionStart hook that enforces terse caveman-speak prose and strict coding discipline to cut wasted output tokens","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0","@types/node":"^24.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cc-discipline_0.1.0_1783073903043_0.23240537395206662","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@dartchuk-s/cc-discipline","version":"0.1.1","description":"Claude Code SessionStart hook that enforces terse caveman-speak prose and strict coding discipline to cut wasted output tokens","author":{"name":"sergeymanson","email":"manson047@gmail.com","url":"https://github.com/sergeymanson"},"repository":{"type":"git","url":"git+https://github.com/sergeymanson/cc-discipline.git"},"scripts":{"build":"tsc","typecheck":"tsc --noEmit","test":"npm run build && node --test","prepublishOnly":"npm run build"},"homepage":"https://github.com/sergeymanson/cc-discipline#readme","bugs":{"url":"https://github.com/sergeymanson/cc-discipline/issues"},"bin":{"cc-discipline":"dist/index.js"},"engines":{"node":">=24"},"publishConfig":{"access":"public"},"license":"MIT","devDependencies":{"@types/node":"^24.0.0","typescript":"^5.4.0"},"gitHead":"536a8902a17cec02106fcbab87ea74944920f0c4","_id":"@dartchuk-s/cc-discipline@0.1.1","_nodeVersion":"24.18.0","_npmVersion":"11.18.0","dist":{"integrity":"sha512-Iau3pgInZhu8qwtp6okFDiFYvmbJA+PkoH28ggX1JKAc1rMytxQTy5v8Th43PsbcrqkbBp0sBAP8Mt+xiryAWA==","shasum":"1c7b1ea4eababb1aeb24f29c9c1fb38698ade37b","tarball":"https://registry.npmjs.org/@dartchuk-s/cc-discipline/-/cc-discipline-0.1.1.tgz","fileCount":11,"unpackedSize":16579,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dartchuk-s%2fcc-discipline@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDMVipJeE1hGMrANVTge87vQnvcfEvGZFoUY6OlQXc8SAIgZLxpbdD2fV/Ri/6B0REFPjNX/X697vAQ/5Sik5mnZ7s="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f817ad30-557d-4b18-be79-acf5bcf0d3ac"}},"directories":{},"maintainers":[{"name":"dartchuk-s","email":"manson047@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cc-discipline_0.1.1_1783074673703_0.8718281523484301"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-03T10:18:22.847Z","modified":"2026-07-03T10:31:14.169Z","0.1.0":"2026-07-03T10:18:23.175Z","0.1.1":"2026-07-03T10:31:13.852Z"},"bugs":{"url":"https://github.com/sergeymanson/cc-discipline/issues"},"author":{"name":"sergeymanson","email":"manson047@gmail.com","url":"https://github.com/sergeymanson"},"license":"MIT","homepage":"https://github.com/sergeymanson/cc-discipline#readme","repository":{"type":"git","url":"git+https://github.com/sergeymanson/cc-discipline.git"},"description":"Claude Code SessionStart hook that enforces terse caveman-speak prose and strict coding discipline to cut wasted output tokens","maintainers":[{"name":"dartchuk-s","email":"manson047@gmail.com"}],"readme":"# cc-discipline\n\n[![npm](https://img.shields.io/npm/v/@dartchuk-s/cc-discipline)](https://www.npmjs.com/package/@dartchuk-s/cc-discipline)\n[![downloads](https://img.shields.io/npm/dm/@dartchuk-s/cc-discipline)](https://www.npmjs.com/package/@dartchuk-s/cc-discipline)\n[![license](https://img.shields.io/npm/l/@dartchuk-s/cc-discipline)](./LICENSE)\n[![node](https://img.shields.io/node/v/@dartchuk-s/cc-discipline)](https://nodejs.org)\n[![install size](https://packagephobia.com/badge?p=@dartchuk-s/cc-discipline)](https://packagephobia.com/result?p=@dartchuk-s/cc-discipline)\n\nA minimal, zero-config [Claude Code](https://claude.com/claude-code) `SessionStart` hook that sets\ntwo disciplines at the start of every session, so you stop repeating \"be brief\" and \"keep it minimal\"\nin every prompt:\n\n- **Speech** — terse **caveman speak**: telegraphic, function-word-free prose instead of filler,\n  preambles and recaps.\n- **Code** — strict coding discipline: boundary-only validation, signal-based logging, minimal\n  task-focused diffs, no speculative abstraction.\n\n> \"I have fixed the bug on line 4; let me know if you need anything else\" → \"fixed bug, line 4.\"\n\nEach dimension is a `strict`/`normal` flag (see [Levels](#levels)).\n\nPublished on npm: [`@dartchuk-s/cc-discipline`](https://www.npmjs.com/package/@dartchuk-s/cc-discipline).\n\nThe hook reads Claude Code's session JSON on stdin and prints a single JSON object that adds the\nrules to the session context:\n\n```json\n{\n  \"hookSpecificOutput\": {\n    \"hookEventName\": \"SessionStart\",\n    \"additionalContext\": \"Output discipline.\\n\\nSpeech — caveman speak (strict): ...\\n- Speak telegraphic caveman style: drop articles ...\\n\\nCode — laconic (strict): ...\\n- Write the minimal code that fully and correctly solves the task ...\"\n  }\n}\n```\n\n## What it enforces\n\nCompression applies to prose only, never to technical content — code, commands, paths, error\nstrings and URLs are always preserved verbatim, and correctness is never traded for brevity.\n\n**Speech (caveman speak):**\n\n- Telegraphic style: drop articles, linking/auxiliary verbs and subject pronouns where meaning stays clear.\n- Content words only — nouns, verbs, key adjectives, numbers; fragments over full sentences.\n- No \"Great question\" / \"Sure\" preambles, no closing summaries or \"let me know if…\" sign-offs.\n- State the result, skip narrating how you got there.\n\n**Code (strict discipline):**\n\n- Validate untrusted data only at boundaries; trust internal typed contracts afterwards.\n- Log diagnostic signal only — failures, retries, fallbacks, external calls, state changes — not the happy path.\n- Minimal, task-focused diffs; no speculative abstractions, wrappers or broad refactors.\n- Preserve existing style and architecture unless the task requires changing them.\n\n## Configure Claude Code\n\nAdd a `SessionStart` hook to `~/.claude/settings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"SessionStart\": [\n      {\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"npx -y @dartchuk-s/cc-discipline@latest\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n`npx` fetches and caches the package on first run; `@latest` keeps it up to date. The hook fires\nonce per session and its output is merged into the session context.\n\n## Levels\n\nTwo independent dimensions are tuned by CLI flags on the hook command, each defaulting to `strict`:\n\n- `--speech <strict|normal>` — prose mode.\n- `--code <strict|normal>` — coding-discipline mode.\n\nBoth accept `--flag value` and `--flag=value` forms; unknown values fall back to the default.\n\n**Speech** — how terse prose gets:\n\n| Mode | Behaviour |\n|---|---|\n| `strict` | Caveman speak: telegraphic, content words only, minimum tokens, often one line. |\n| `normal` | Ordinary concise prose in full sentences, just trimmed of filler and preamble. |\n\n**Code** — how disciplined generated code is:\n\n| Mode | Behaviour |\n|---|---|\n| `strict` | Boundary-only validation, signal-based logging, minimal task-focused diffs, no speculative abstraction. |\n| `normal` | Ordinary coding: follow repo style and the request, no strict minimal-patch/boundary/logging rules unless asked. |\n\nSet the levels right in the hook command:\n\n```json\n{\n  \"type\": \"command\",\n  \"command\": \"npx -y @dartchuk-s/cc-discipline@latest --speech strict --code normal\"\n}\n```\n\nOmit a flag to keep its default (`strict`). Set `CC_DISCIPLINE=0` (or `false` / `off`) to disable\nthe hook without removing it from settings — it emits nothing and the session runs untouched.\n\n```json\n{\n  \"hooks\": {\n    \"SessionStart\": [\n      {\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"npx -y @dartchuk-s/cc-discipline@latest --speech strict --code strict\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n## Requirements\n\n- Node.js >= 24\n\n## Development\n\n```bash\nnpm install\nnpm run build        # tsc -> dist/\n\n# smoke test\necho '{\"hook_event_name\":\"SessionStart\",\"source\":\"startup\"}' | node dist/index.js --speech strict --code normal\n```\n\n## License\n\n[MIT](./LICENSE)\n","readmeFilename":"README.md"}