Skip to the 7 Laws
SPEC / AI AGENT DISCIPLINE / REV 3.13.0

# 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

The standard 7 clauses

1. 01 Research Before Executing
2. 02 Plan Is Sacred
3. 03 One Thing at a Time
4. 04 Verify Before Reporting
5. 05 Reflect After Sessions
6. 06 Iterate One Change
7. 07 Learn From Every Session

- 25 Bundled skills
- 7 Laws in force
- 0 Runtime deps
- MIT License
- v3.13.0 Current rev

01 · The seven laws

## The standard, written as clauses.

Each law has one check to pass and one red flag to catch. The runtime keeps them automatic, so the discipline holds on every task instead of depending on the agent to remember it.

01

### Research Before Executing

Check Did I search for existing solutions before writing anything new?
Red flag I'll just quickly...
02

### Plan Is Sacred

Check Did I state WILL, WILL NOT, and VERIFY before touching code?
Red flag Let me also add...
03

### One Thing at a Time

Check Am I finishing the current change before starting the next one?
Red flag While I'm here...
04

### Verify Before Reporting

Check Did I check the actual output, not the output I assumed?
Red flag This should work...
05

### Reflect After Sessions

Check Did I note what worked and what failed before moving on?
Red flag I'll remember...
06

### Iterate One Change

Check Am I changing one thing at a time and verifying each step?
Red flag And also...
07

### Learn From Every Session

Check Did I capture this lesson as an instinct the next session can use?
Red flag Next 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.

tool: Write → blocked
reason: list imports, surface, instruction
facts presented → allow
Ladder · pre-done

### Verification Loop

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

typecheck
test
build → done
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.

goal-check → ON GOAL
status: DRIFT → refuse done
status: NO DATA → ask
Memory · cross-session

### Mulahazah Instinct Engine

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

observe
instinct → confidence++
reinforce
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.

prompt → BM25 recall
inject: prior fix
opt-in → amplify, never block

## Make your agent sharper every session.

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

install `$npx continuous-improvement install`
Install from npm Read the quickstart