βββββββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββ
ββββββββ βββ ββββββ βββ βββββββ ββββββ ββββββ ββββββββ
ββββββββ βββ ββββββ βββ βββββββ ββββββ ββββββ βββββββ
ββββββββ βββ ββββββββ βββ βββ ββββββββββββββββββββββ
ββββββββ βββ ββββββββ βββ βββ ββββββββββββββββββββββ
Stop Claude from "helpfully" refactoring your intentional code.
npx stetkeep installThis is the one-command minimal install: protocols, subagents, slash commands, path-scoped rules. Next session of claude, type /brain-scan and you're working.
For full mechanical enforcement (hooks + permissions deny-lists), the Install section below has a two-step recommended flow: one extra cp command.
Full walkthrough: BOOTSTRAP_GUIDE.md.
Two things other Claude Code projects don't ship:
Prose prompts ("be careful when refactoring, prefer readability over cleverness...") don't survive 20K-token contexts. XML-tagged directives do. Anthropic's own prompting guide recommends XML tags explicitly as a way for Claude to parse prompts more accurately. We built three protocols around it:
- BRAIN.md β
<routing>/<mode>/<inhibit>β decides where a command goes - CRAFT.md β
<anti_patterns>/<safety_net>/<false_positives>β structural refactor discipline - PERF.md β
<pre_check>/<perf_budget>/<measurement_gate>β measurement-first performance work
~1β2K tokens each (BRAIN ~1K Β· CRAFT ~1.5K Β· PERF ~1.8K). Claude's attention lands on XML-delimited sections more reliably than on Markdown prose headers.
The 16-entry registry of "patterns Claude will mistakenly flag as problems." Examples:
| What Claude sees | What Claude will say | What it actually is |
|---|---|---|
| 1000-line config / data file | "God File (A1). Split it." | A data table. Splitting loses context. |
Deliberate inline for loop |
"Duplication (A3). Extract." | Profiled hot path. 10Γ faster than reduce. |
Plain <img> element |
"Use next/image." |
Below-fold. Not the LCP element. |
Array.map().map().map() |
"Collapse into reduce." |
V8 optimizes this; readability wins. |
When Claude matches one of these, the Safety Net flags it π΄ Low confidence and asks before editing. Catalog is under <false_positives> in CRAFT.md and PERF.md.
No competitor ships this.
On top of the XML framework, stetkeep ships a five-layer defense:
- Layer A β
permissions.denyhard-blocks edits tolegacy/,generated/,vendor/(deterministic) - Layer B β PreToolUse hook runs out-of-process; returns
deny/ask/allowJSON (deterministic) - Layer C β Subagent tool scoping β
craft-specialist/perf-specialistcan't create new files; edits to existing files require explicit user approval (structural) - Layer D β Path-scoped rules auto-load CRAFT/PERF on
src/**file access (heuristic) - Layer E β XML protocols + false-positive catalog (heuristic)
Layers A / B / C fire regardless of model attention. Layers D / E bias behavior. Honest breakdown in ARCHITECTURE.md Β§1.
This part is not novel β TDD-Guard, claude-guardrails, and others already ship hook-based enforcement. stetkeep's wedge is the XML framework + FP catalog above; hooks are just the vehicle.
ββββββββββββββββββββββββββββ
user command ββΆβ Claude Code β
β (reads CLAUDE.md auto) β
βββββββββββββ¬βββββββββββββββ
β
βββββββββββββββ΄ββββββββββββββ
βΌ βΌ
ββββββββββββββββββββββ ββββββββββββββββββββββββ
β Subagents β β Path-scoped rules β
β agents/ β β .claude/rules/ β
β β tool-scoped β β β auto-load on read β
ββββββββββββ¬ββββββββββ ββββββββββββ¬ββββββββββββ
β β
ββββββββββββββββ¬ββββββββββββ
βΌ
ββββββββββββββββββββββββ
β Edit / Write tool β
ββββββββββββ¬ββββββββββββ
β
βββββββββββββΌβββββββββββββ
β PreToolUse HOOK β βββ mechanical, out-of-process
β hooks/safety-net.sh β can deny / ask / allow
β path / ignore / marker β path, ignore, marker-driven
βββββββββββββ¬βββββββββββββ
β
allowβdeny/ask
βΌ
ββββββββββββββββ
β file edit β
ββββββββββββββββ
cd /path/to/your-project
npx stetkeep installGets you the XML protocols, subagents, slash commands, and path-scoped rules (Layers C/D/E). Enforcement is prompt-level only: the model biases toward the Safety Net but cannot be mechanically blocked.
After npx stetkeep install:
cp .claude/settings.example.json .claude/settings.jsonIf you already have
.claude/settings.json(from other tooling or a previous install):cpwill overwrite it. Runls .claude/settings.jsonfirst; if it exists, merge thepermissionsandhooks.PreToolUseblocks fromsettings.example.jsonmanually instead of overwriting.
This wires up the remaining two layers:
- Layer A (permissions deny-list): hard-blocks edits to
legacy/,generated/,vendor/ - Layer B (PreToolUse hook): out-of-process Safety Net enforcement on every Edit / Write / Bash
Without this step, legacy/ protection is a prompt suggestion rather than a deterministic block. You keep the same protection surface the project was designed around by completing it.
claudeInside Claude Code:
/brain-scan
--mode coexist(default): preserve everything, append 3-line bootstrap to CLAUDE.md--mode merge: same + add a Protocols reference section--mode fresh: empty-project install (requires--forceif anything exists)--dry-run: preview without writing
stetkeep distributes a plugin catalog directly from GitHub β no Anthropic review required, works today:
# In Claude Code
/plugin marketplace add chanjoongx/stetkeep
/plugin install stetkeep
Auto-loads subagents, commands, and the hook with no file copying into your project. Tradeoff: path-scoped rules (Layer D) and root-level protocol MDs cannot be packaged by the plugin spec, so they stay user-level. For the full experience use npx stetkeep install.
stetkeep has been submitted to Anthropic's official Claude Code plugin marketplace and is currently under review. Once approved, installation simplifies to a single command β no marketplace add step needed:
# In Claude Code β available once approved
/plugin install stetkeep
Watch chanjoongx/stetkeep releases for updates.
git clone https://github.com/chanjoongx/stetkeep.git
cd /path/to/your-project
node /path/to/stetkeep/lib/install.jsSame flags as npx stetkeep install (--mode, --force, --dry-run). Use this only if you are modifying stetkeep itself.
After install, three slash commands are available inside Claude Code. Type / to see them:
| Command | What it does |
|---|---|
/brain-scan [path] |
Map your MD ecosystem β classifies all .md files, checks Safety Net wiring, proposes next steps |
/craft-audit [path] |
Read-only structural scan β A1βA20 anti-pattern atlas + false-positive cross-check, returns π’/π‘/π΄ confidence-graded findings |
/perf-audit [scope] |
Measurement-first baseline β guides Lighthouse + bundle analysis, returns Top 5 bottlenecks by Impact Γ User-pain |
Recommended first session:
/brain-scan # map what's in your project, check Safety Net status
/craft-audit src/ # find structural issues β read-only, no edits yet
/perf-audit # baseline measurements β read-only, no edits yet
Both audit commands end with "Proceed? (yes / reorder / cancel)" β nothing is edited without an explicit go-ahead.
- Claude Code 2026+ (hooks, subagents, path-scoped rules, slash commands all require this)
- Node 20+ (bundled with Claude Code β you have it)
- bash on macOS/Linux; Git Bash (recommended) or PowerShell on Windows
- jq (optional β hook falls back to grep if absent)
Windows note: macOS/Linux/Git Bash is the primary test surface. The
safety-net.ps1PowerShell hook ships but has less field data; if hooks misbehave on native PowerShell,npx stetkeep installis the shortest recovery path (bypasses ExecutionPolicy + avoids the WSLbash.exeproxy).
Honest comparison (based on competitive research documented in CHANGELOG v0.3.0):
| stetkeep | TDD-Guard | claude-guardrails | VoltAgent subagents | everything-claude-code | |
|---|---|---|---|---|---|
| Scope | XML protocols + FP catalog | TDD-specific blocking | Security permissions | Subagent library | Kitchen-sink toolkit |
| Stars (Apr 2026) | just launched | 2K | 12 | 17.7K | 160K |
| Hook enforcement | β | β | β | β | β |
| Tool-scoped subagents | β | β | β | β | β |
| XML-structured protocols | β | β | β | β | β |
| False-positive catalog | β | β | β | β | β |
| Plugin marketplace | β | β | β | β | β |
| npm package | β | β | β | β | β |
If you want TDD-specific blocking β TDD-Guard. If you want security policy as code β claude-guardrails. If you want an agent library β VoltAgent. If you want everything at once β everything-claude-code.
If you want a protocol framework with a curated false-positive registry, that's us.
Checks 1-3 assume the
npx stetkeep installflow, which copies files into your project's.claude/. Plugin-marketplace installs register the artifacts from Claude Code's own plugin directory, so.claude/agents/and.claude/hooks/will be empty in your project; in that case skip to check 4.
# 1. Hook runs and returns decisions
echo '{"tool_name":"Edit","tool_input":{"file_path":"legacy/x.ts"}}' \
| bash .claude/hooks/safety-net.sh
# Expected (JSON):
# {"hookSpecificOutput":{"permissionDecision":"ask", ...}}
# 2. Subagents discoverable
ls .claude/agents/
# brain-router.md craft-specialist.md perf-specialist.md
# 3. Slash commands (after restarting Claude Code)
# In Claude Code, type `/` β you should see /brain-scan, /craft-audit, /perf-audit
# 4. Quick diagnostic (works in both install modes)
npx stetkeep scanUse npx stetkeep install β it runs through npm and is not affected by PowerShell's ExecutionPolicy.
Cosmetic only on Korean / CP949 consoles. Run chcp 65001 first, or just ignore β the install is correct.
That's Windows's built-in bash.exe (WSL proxy), not Git Bash. Use npx stetkeep install (no bash dependency) or open Git Bash directly from the Start menu.
Verify the hook returns JSON:
echo '{"tool_name":"Edit","tool_input":{"file_path":"legacy/x.ts"}}' | bash .claude/hooks/safety-net.shIf no output: make sure .claude/settings.json exists (copy from settings.example.json) and the hook is wired under hooks.PreToolUse.
Claude Code 2026+ required. Older versions don't scan .claude/commands/. Check with claude --version.
stetkeep/
βββ agents/ # plugin subagents (canonical, marketplace-distributed)
βββ commands/ # plugin slash commands (canonical)
βββ hooks/
β βββ hooks.json # plugin hook manifest
β βββ safety-net.sh # PreToolUse (bash)
β βββ safety-net.ps1 # PreToolUse (PowerShell)
βββ .claude/ # dogfooding mirrors + user-level files
β βββ agents/ # mirror of ../agents/ (loaded when claude runs inside this repo)
β βββ commands/ # mirror of ../commands/
β βββ hooks/ # mirror of ../hooks/
β βββ rules/ # path-scoped rules (npm-distributed; plugin spec cannot package these)
β βββ settings.example.json # hook wiring template
βββ .claude-plugin/
β βββ plugin.json # Claude Code plugin manifest
β βββ marketplace.json # self-hosted marketplace entry
βββ bin/stetkeep.js # npm CLI entry (ESM, Node 20+, stdlib only)
βββ lib/
β βββ install.js # cross-platform installer
β βββ scan.js # ecosystem diagnostic
β βββ utils.js # log helpers
βββ BRAIN.md # routing protocol
βββ CRAFT.md # refactor protocol + FP catalog
βββ PERF.md # performance protocol + FP catalog
βββ CLAUDE.template.md # user-facing CLAUDE.md template (npm-distributed)
βββ ARCHITECTURE.md # honest enforcement breakdown
βββ BOOTSTRAP_GUIDE.md # first-session walkthrough
βββ PRIVACY.md # privacy policy (zero data collection)
βββ benchmark/SPEC.md # evaluation methodology
βββ docs/releases/ # per-version release notes (source)
βββ validators/ # installation verification (.sh + .ps1)
βββ package.json
βββ CHANGELOG.md
βββ CONTRIBUTING.md
βββ LICENSE
We publish a pre-registered evaluation spec instead of hand-wavy numbers:
π benchmark/SPEC.md β 50 test cases, 3 conditions (vanilla / stetkeep full / stetkeep Safety-Net-only), human rubric grading (Cohen's ΞΊ β₯ 0.75), paired bootstrap statistics.
Results pending. We'll publish data + methodology, not a single percentage.
Layers A (permissions) and B (hook) are out-of-process and deterministic β they block edits before the tool fires, regardless of what Claude decided. Layer C (subagent tool scoping) is enforced at spawn β Write (new file creation) is not in the toolset; Edit of existing files requires explicit user approval. Layers D (path-scoped rules) and E (XML protocols + FP catalog) are heuristic β they bias the model but cannot guarantee behavior. Full breakdown in ARCHITECTURE.md Β§1.
The XML protocols and false-positive catalog are plain Markdown β any AI that reads MD can use them. But the hook system, subagent tool scoping, and path-scoped rules are Claude Code 2026 features. Without them you lose the deterministic layers.
It's a mnemonic β "BRAIN routes, CRAFT refactors, PERF measures" β not a cognitive claim. MD files are documents read by a language model. See ARCHITECTURE.md Β§8.
Yes. coexist mode (default) preserves everything β only appends a 3-line bootstrap reference to your CLAUDE.md. The memory/ folder is detected and left untouched.
- npm install: gets you everything β the root protocols (BRAIN.md / CRAFT.md / PERF.md), path-scoped rules, settings template, plus the plugin components.
- Self-hosted marketplace (
/plugin marketplace add chanjoongx/stetkeep): gets you only the plugin components β subagents, slash commands, hook. Path-scoped rules and root-level protocols can't be packaged as a plugin, so they stay user-level. Works today. - Official Anthropic marketplace (
/plugin install stetkeep): same plugin components as above, single command, nomarketplace addstep. Currently under review.
For the full stetkeep experience, use npm install. For lightweight subagent access, either plugin option works.
stet is the traditional editorial mark from Latin "let it stand" β what editors write over proposed deletions to cancel them and preserve the original text. stetkeep applies the same principle to code: tell Claude to leave your intentional code alone.
Originally launched as mdbrain on 2026-04-19, renamed to stetkeep one day later after a brand conflict with mediaire's medical AI. See CHANGELOG for the full story.
Yes. Designed by CJ Kim in iteration with Claude. The protocol's own Safety Net caught multiple attempts where Claude proposed to "improve" the protocol in self-defeating ways β which is exactly the kind of false-positive editing stetkeep is built to prevent.
- v0.1 β protocol-only draft
- v0.2 β Claude Code 2026 native mechanisms (hooks, subagents, path-scoped rules)
- v0.3 β npm package, plugin manifest, Anthropic marketplace submission (as
mdbrain) - v0.4 β renamed to
stetkeep(brand disambiguation), post-launch audit fixes, OIDC trusted publishing + Sigstore provenance - v0.5 β benchmark results (
benchmark/SPEC.mdβ real numbers) +npx stetkeep initinteractive - v0.6 β per-language variants (
CRAFT.python.md,CRAFT.rust.md) - v1.0 β stable API, typed plugin configs
See CONTRIBUTING.md. Highest-value contributions:
- New false-positive entries β patterns Claude commonly mis-flags (with a minimal reproducer)
- New anti-pattern entries (A21+, P21+) β with corresponding FP counterexamples
- Hook improvements β edge cases, better path matching, platform fixes
- Benchmark corpus cases β see benchmark/SPEC.md Β§3
- Published to npm via OIDC Trusted Publisher (no long-lived
NPM_TOKEN) - Every release carries a Sigstore provenance attestation (SLSA v1) bound to its source commit
- Zero runtime dependencies (stdlib-only)
- No network calls at install or hook time β see
PRIVACY.md - GitHub Actions pinned by commit SHA to prevent silent upstream changes
Report vulnerabilities privately via SECURITY.md.
MIT. Use it, fork it, ship it.
Built by CJ Kim Β· Stress-tested with Claude Β· Launched 2026-04-19
The model is eager. The Safety Net is skeptical. The XML protocol is structured.