SPEC / AI AGENT DISCIPLINE / REV 3.12.3

Claude Code that gets sharper every session

continuous-improvement makes the agent research before it edits, prove every completion before it reports done, and turn each fix into an instinct it reuses next time. Seven laws run the loop; the Mulahazah engine compounds what it learns.

install npx continuous-improvement install

No Node setup, zero runtime dependencies. Read the quickstart

01 · The seven laws

Intelligence, written as clauses.

Each law has one check to pass and one red flag to catch. The runtime keeps them automatic, so the agent reasons at a higher level instead of relying on memory.

01

Research Before Executing

CheckDid I search for existing solutions before writing anything new?
Red flagI'll just quickly...
02

Plan Is Sacred

CheckDid I state WILL, WILL NOT, and VERIFY before touching code?
Red flagLet me also add...
03

One Thing at a Time

CheckAm I finishing the current change before starting the next one?
Red flagWhile I'm here...
04

Verify Before Reporting

CheckDid I check the actual output, not the output I assumed?
Red flagThis should work...
05

Reflect After Sessions

CheckDid I note what worked and what failed before moving on?
Red flagI'll remember...
06

Iterate One Change

CheckAm I changing one thing at a time and verifying each step?
Red flagAnd also...
07

Learn From Every Session

CheckDid I capture this lesson as an instinct the next session can use?
Red flagNext time I'll...
The loop / one pass, every change
Research Plan Execute Verify Reflect Learn Iterate

Execute moves one thing at a time. A failure never carries forward into the next task: it loops back to research.

02 · Enforcement

Built into the runtime, not suggested in a doc.

Hooks sit between the agent and your files — they force grounding before an edit and proof before completion, acting at the boundary instead of just reminding.

Hook · PreToolUse

Gateguard

Blocks Edit, Write, and destructive Bash until the agent presents a fact-list investigation. No mutating a file before naming what imports it.

Ladder · pre-done

Verification Loop

A per-project ladder of checks. Nothing is marked done until the rungs pass on the actual output.

Hook · Stop

Goal-Drift Gate

Fires a goal check when the agent tries to stop, and refuses a "Done" that has drifted from the stated goal.

Memory · cross-session

Mulahazah Instinct Engine

Captures what worked and what failed as instincts. The same mistake does not return next session.

Hook · UserPromptSubmit

Recall Briefing

On the first prompt of a session it searches this project's past work and surfaces the most relevant prior fix — so the agent reuses it instead of re-deriving it. Opt-in; an amplifier, never a gate.

Make your agent sharper every session.

Install in under a minute. Two slash commands inside Claude Code, no setup.

install npx continuous-improvement install