npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dartchuk-s/cc-discipline

v0.1.1

Published

Claude Code SessionStart hook that enforces terse caveman-speak prose and strict coding discipline to cut wasted output tokens

Downloads

268

Readme

cc-discipline

npm downloads license node install size

A minimal, zero-config Claude Code SessionStart hook that sets two disciplines at the start of every session, so you stop repeating "be brief" and "keep it minimal" in every prompt:

  • Speech — terse caveman speak: telegraphic, function-word-free prose instead of filler, preambles and recaps.
  • Code — strict coding discipline: boundary-only validation, signal-based logging, minimal task-focused diffs, no speculative abstraction.

"I have fixed the bug on line 4; let me know if you need anything else" → "fixed bug, line 4."

Each dimension is a strict/normal flag (see Levels).

Published on npm: @dartchuk-s/cc-discipline.

The hook reads Claude Code's session JSON on stdin and prints a single JSON object that adds the rules to the session context:

{
  "hookSpecificOutput": {
    "hookEventName": "SessionStart",
    "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 ..."
  }
}

What it enforces

Compression applies to prose only, never to technical content — code, commands, paths, error strings and URLs are always preserved verbatim, and correctness is never traded for brevity.

Speech (caveman speak):

  • Telegraphic style: drop articles, linking/auxiliary verbs and subject pronouns where meaning stays clear.
  • Content words only — nouns, verbs, key adjectives, numbers; fragments over full sentences.
  • No "Great question" / "Sure" preambles, no closing summaries or "let me know if…" sign-offs.
  • State the result, skip narrating how you got there.

Code (strict discipline):

  • Validate untrusted data only at boundaries; trust internal typed contracts afterwards.
  • Log diagnostic signal only — failures, retries, fallbacks, external calls, state changes — not the happy path.
  • Minimal, task-focused diffs; no speculative abstractions, wrappers or broad refactors.
  • Preserve existing style and architecture unless the task requires changing them.

Configure Claude Code

Add a SessionStart hook to ~/.claude/settings.json:

{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "npx -y @dartchuk-s/cc-discipline@latest"
          }
        ]
      }
    ]
  }
}

npx fetches and caches the package on first run; @latest keeps it up to date. The hook fires once per session and its output is merged into the session context.

Levels

Two independent dimensions are tuned by CLI flags on the hook command, each defaulting to strict:

  • --speech <strict|normal> — prose mode.
  • --code <strict|normal> — coding-discipline mode.

Both accept --flag value and --flag=value forms; unknown values fall back to the default.

Speech — how terse prose gets:

| Mode | Behaviour | |---|---| | strict | Caveman speak: telegraphic, content words only, minimum tokens, often one line. | | normal | Ordinary concise prose in full sentences, just trimmed of filler and preamble. |

Code — how disciplined generated code is:

| Mode | Behaviour | |---|---| | strict | Boundary-only validation, signal-based logging, minimal task-focused diffs, no speculative abstraction. | | normal | Ordinary coding: follow repo style and the request, no strict minimal-patch/boundary/logging rules unless asked. |

Set the levels right in the hook command:

{
  "type": "command",
  "command": "npx -y @dartchuk-s/cc-discipline@latest --speech strict --code normal"
}

Omit a flag to keep its default (strict). Set CC_DISCIPLINE=0 (or false / off) to disable the hook without removing it from settings — it emits nothing and the session runs untouched.

{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "npx -y @dartchuk-s/cc-discipline@latest --speech strict --code strict"
          }
        ]
      }
    ]
  }
}

Requirements

  • Node.js >= 24

Development

npm install
npm run build        # tsc -> dist/

# smoke test
echo '{"hook_event_name":"SessionStart","source":"startup"}' | node dist/index.js --speech strict --code normal

License

MIT