Working Contract banner
Pyure-ai Pyure-ai

Working Contract

Development community

Description

29 working rules injected into every Claude Code session by one hook file. It prints a budget gauge each turn and refuses a turn that ends without asking you a question it owes you. Node 20.11+, no dependencies, no network. See the README to install via .claude/settings.json, or just append RULES.md to your CLAUDE.md.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

working-contract

Working rules, injected into every Claude Code session. **Two files do the work.**

File What it is
`plugins/working-contract/RULES.md` The rules — 29 imperatives, no reasoning, no checks
`plugins/working-contract/hooks/wc.mjs` The only code. One file on three hook events
Event It does
SessionStart prints the rules, the session name, the live items, the gauge, the start-mode card
UserPromptSubmit prints a three-row budget gauge
Stop refuses a turn that ends without a card while a question is OPEN

**That refusal is the only one.** Everything else is stated and unenforced. The whole hook is wrapped in one `try`/`catch`: any failure exits 0 and prints what went dark, so a broken hook never blocks a session.

Install

Add the marketplace and enable the plugin in a repository's `.claude/settings.json`:

{
  "extraKnownMarketplaces": {
    "working-contract": { "source": { "source": "github", "repo": "Pyure-ai/working-contract" } }
  },
  "enabledPlugins": { "working-contract@working-contract": true }
}

Then, once per machine:

claude plugin install working-contract@working-contract

To move a repository to a newer version, from inside that repository:

claude plugin update working-contract@working-contract --scope project

`--scope` defaults to `user`. A repository carrying its own `.claude/settings.json` resolves through its `project` record, so only `--scope project` moves what that repository reads. A Claude Code restart applies it.

The record it expects

Two paths, created on first use:

docs/log.md          settled decisions, one line each, append-only
docs/items/.md   one file per question and per work item

Front matter: `id`, `kind` (`question` or `work`), `status`, `title`. A question is `OPEN`, `DEFERRED` or `ANSWERED`; work is `UNSPECIFIE