How do I use Ward with Claude Code?
Updated
Run ward integrate claude-code in your project. Ward then checks each file Claude Code edits, and again when Claude finishes its turn, and gives Claude the exact failure to fix.
What does the integration install?
Ward creates or updates .claude/settings.json and the executable .claude/hooks/ward-edit-write. It registers the same hook for two Claude Code events:
| Event | When | What Ward does |
|---|---|---|
PostToolUse (Edit, Write, MultiEdit) |
After each file edit | Runs a partial check of the edit profile |
Stop |
When Claude finishes its turn | Runs the full default check |
Keep ward on your PATH.
What does Claude see when a check fails?
After an edit, the failure goes to stderr with exit code 2, and Claude Code shows it to Claude, which can fix it right away. At the end of a turn, Ward blocks the stop once with the findings. If findings remain after that, Ward lets the turn end and shows them to you. A problem Claude cannot fix therefore cannot trap it in a loop.
How do I install it, and how do I remove it?
ward integrate claude-code
ward integrate claude-code --remove
Or set everything up at once: ward init --preset standard --integration claude-code --quality-hooks. Ward merges into an existing .claude/settings.json and keeps your other settings. Removal deletes only Ward’s own entries.
Can I stop Claude from editing approved specs?
Yes, with the opt-in guard: ward integrate claude-code --guard-approved-specs. It denies edits under openspec/specs/ and openspec/changes/archive/. The docs call its shell filtering a heuristic, not a security boundary.
Is it tested?
The generated hook files are tested against Claude Code’s hook contract. A live run against a real Claude Code has not been recorded yet. Ward is in alpha, so the CLI and the configuration may change before 1.0.
Where do I go next?
Ready to try it? Install Ward and run ward init in your project.