From 612bcb298dd9f5ca99625ce582733b4363d327d2 Mon Sep 17 00:00:00 2001 From: sneg55 Date: Wed, 1 Jul 2026 17:09:16 -0400 Subject: [PATCH 1/4] feat(hooks): add loop/goal instruction-review hook New UserPromptSubmit hook suggest-loop-improvements.sh. When the user runs /loop or /goal, it injects an instruction so Claude proposes 2-3 improved, drop-in replacements for the command and presents them via AskUserQuestion (A/B/C plus "Run original unchanged") - the user picks one, no copy-paste, and only the selected command runs. The hook does no LLM work and spawns no nested session: it only injects context, so the running model generates the variants. Fast, no API key, non-blocking (exit 0) - a silent no-op for every other prompt, for already- precise commands, and in headless sessions. Wired into hooks.json (plugin) and install.sh (jq-merge), documented in hooks/README.md. Co-Authored-By: Claude Opus 4.8 --- hooks/README.md | 23 +++++++++++++++ hooks/hooks.json | 12 ++++++++ hooks/suggest-loop-improvements.sh | 45 ++++++++++++++++++++++++++++++ install.sh | 1 + 4 files changed, 81 insertions(+) create mode 100755 hooks/suggest-loop-improvements.sh diff --git a/hooks/README.md b/hooks/README.md index 2d25792..e4b04b4 100644 --- a/hooks/README.md +++ b/hooks/README.md @@ -158,6 +158,29 @@ Add to `settings.json`: } ``` +### suggest-loop-improvements.sh +**Event:** UserPromptSubmit +**What it does:** When you run `/loop` or `/goal`, injects an instruction that has Claude propose 2-3 improved, drop-in replacements for the command before it runs, then present them with the `AskUserQuestion` tool so you pick one interactively (A / B / C, plus "Run original unchanged") - no copy-paste. Claude runs only the option you select. + +- The hook does **no LLM work and spawns no nested session** - it only injects context, so the already-running model generates the variants. Fast (<50ms), needs no API key. +- Filters by prompt text (`UserPromptSubmit` has no matcher), so it is a silent no-op for every other prompt. +- Each replacement adds only the missing precision - explicit success criteria, a stop condition, bounded scope, a verification step - while preserving your interval and args. +- Non-blocking (exit 0): if the command is already solid, or the session is headless (no interactive prompt), the original runs unchanged. + +Add to `settings.json`: + +```json +{ + "UserPromptSubmit": [ + { + "hooks": [ + { "type": "command", "command": "~/.claude/hooks/suggest-loop-improvements.sh", "timeout": 10, "statusMessage": "Reviewing loop/goal instructions..." } + ] + } + ] +} +``` + ## Exit Code Behavior - **Exit 0** - success, proceed normally - **Exit 2** - BLOCK the action, stderr shown to Claude as error diff --git a/hooks/hooks.json b/hooks/hooks.json index fcc1f64..520ca68 100644 --- a/hooks/hooks.json +++ b/hooks/hooks.json @@ -60,6 +60,18 @@ } ] } + ], + "UserPromptSubmit": [ + { + "hooks": [ + { + "type": "command", + "command": "${CLAUDE_PLUGIN_ROOT}/hooks/suggest-loop-improvements.sh", + "timeout": 10, + "statusMessage": "Reviewing loop/goal instructions..." + } + ] + } ] } } diff --git a/hooks/suggest-loop-improvements.sh b/hooks/suggest-loop-improvements.sh new file mode 100755 index 0000000..a8e74f1 --- /dev/null +++ b/hooks/suggest-loop-improvements.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +# UserPromptSubmit hook: when the user runs /loop or /goal, inject an instruction +# telling Claude to first propose improved, drop-in replacements for the command +# and let the user pick one interactively via AskUserQuestion (no copy-paste), +# then run only the chosen command. +# +# The hook itself does no LLM work and spawns no nested session - it only injects +# context, so the already-running model generates the variants. That keeps it +# fast (<50ms), needs no API key, and no matcher (UserPromptSubmit has none), so +# it filters to /loop and /goal by prompt text. Non-blocking: every other prompt, +# and any parse failure, passes through untouched (exit 0). +set -euo pipefail + +input="$(cat)" +prompt="$(printf '%s' "$input" | jq -r '.prompt // empty')" + +# Only act on /loop and /goal invocations; everything else passes through. +case "$prompt" in + /loop*|/goal*) ;; + *) exit 0 ;; +esac + +cat < +The user is about to run this command: $prompt + +Before executing it, do this first: +1. Generate 2-3 improved, drop-in replacements for the command. Keep each faithful + to the original intent (preserve the interval and args); only add the missing + precision - explicit success criteria, an explicit stop condition, bounded + scope, and a verification step. +2. Call the AskUserQuestion tool (header "Improve loop?") with: + - one option per replacement, lettered in order: label "A - ", + "B - ", ... and put the full rewritten command plus a one-line + "Why:" in each option's description. + - a final option: label "Run original unchanged", description = the original command. +3. Run ONLY the command the user selects, verbatim. For the last option, run the + original command as-is. + +If the command already has clear success criteria, a stop condition, bounded scope, +and a verification step, skip the question and run it unchanged. If you cannot show +an interactive prompt (headless/non-interactive session), run the original unchanged. + +EOF +exit 0 diff --git a/install.sh b/install.sh index 047dd91..52c5b4e 100755 --- a/install.sh +++ b/install.sh @@ -72,6 +72,7 @@ jq --arg h "$H" --argjson guard "$READ_GUARD" ' | add("PostToolUse"; entry("Write|Edit"; $h + "/check-silent-errors.sh"; 5; "Checking error handling...")) | add("PreToolUse"; entry("Bash"; $h + "/block-dangerous-commands.sh"; 3; "Checking command safety...")) | add("SessionStart"; {hooks: [{type: "command", command: ($h + "/check-codebase-health.sh ."), timeout: 15, statusMessage: "Checking codebase health..."}]}) + | add("UserPromptSubmit"; {hooks: [{type: "command", command: ($h + "/suggest-loop-improvements.sh"), timeout: 10, statusMessage: "Reviewing loop/goal instructions..."}]}) | (if $guard == 1 then add("PostToolUse"; entry("Read"; $h + "/track-reads.sh"; 3; "Tracking reads...")) | add("PreToolUse"; entry("Edit|Write"; $h + "/require-read-before-edit.sh"; 3; "Checking read log...")) From 05b6c0c51e307e4439d2d0cddfe475f79d552678 Mon Sep 17 00:00:00 2001 From: sneg55 Date: Wed, 1 Jul 2026 17:22:16 -0400 Subject: [PATCH 2/4] docs(hooks): clarify loop/goal hook gates only model-driven commands The suggest-loop-improvements README claimed the interactive picker works for both /loop and /goal. It does not: /goal is a client-side local command whose effect runs at submit time, before Claude's turn, so an advisory (exit 0) injection cannot intercept it. Document the model-driven vs client-side distinction so the behavior is not misrepresented. Co-Authored-By: Claude Opus 4.8 --- hooks/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hooks/README.md b/hooks/README.md index e4b04b4..5486dcd 100644 --- a/hooks/README.md +++ b/hooks/README.md @@ -160,13 +160,15 @@ Add to `settings.json`: ### suggest-loop-improvements.sh **Event:** UserPromptSubmit -**What it does:** When you run `/loop` or `/goal`, injects an instruction that has Claude propose 2-3 improved, drop-in replacements for the command before it runs, then present them with the `AskUserQuestion` tool so you pick one interactively (A / B / C, plus "Run original unchanged") - no copy-paste. Claude runs only the option you select. +**What it does:** When you run `/loop`, injects an instruction that has Claude propose 2-3 improved, drop-in replacements for the command before it runs, then present them with the `AskUserQuestion` tool so you pick one interactively (A / B / C, plus "Run original unchanged") - no copy-paste. Claude runs only the option you select. - The hook does **no LLM work and spawns no nested session** - it only injects context, so the already-running model generates the variants. Fast (<50ms), needs no API key. - Filters by prompt text (`UserPromptSubmit` has no matcher), so it is a silent no-op for every other prompt. - Each replacement adds only the missing precision - explicit success criteria, a stop condition, bounded scope, a verification step - while preserving your interval and args. - Non-blocking (exit 0): if the command is already solid, or the session is headless (no interactive prompt), the original runs unchanged. +**Interactive gating only works for model-driven commands.** `/loop` hands control to Claude to interpret and act, so the injected "ask first" instruction lands *before* any action and the picker can render. Client-side local commands like `/goal` execute their effect at submit time (the CLI sets the goal and arms its Stop hook before Claude's turn even starts), so an advisory (exit 0) injection cannot intercept them - the picker will not fire, and `/goal` also explicitly tells Claude not to pause and ask. The hook still matches `/goal*` text, but treat the review there as advisory only. For a true gate you would need a client-side command that defers its effect to the model turn. + Add to `settings.json`: ```json From 2c42d36f17d1c91382b5b9fdaa00f9b525e0f188 Mon Sep 17 00:00:00 2001 From: sneg55 Date: Wed, 1 Jul 2026 17:39:49 -0400 Subject: [PATCH 3/4] docs: reference loop-review hook in enumerations; bump to 0.4.4 Add suggest-loop-improvements.sh to the hook lists in AGENT.md, skills/new-project/SKILL.md, and the README wiring summary, and to the manual settings.json example in TEAM.md. Bump VERSION and both plugin manifests 0.4.3 -> 0.4.4 for the new hook. Co-Authored-By: Claude Opus 4.8 --- .claude-plugin/marketplace.json | 4 ++-- .claude-plugin/plugin.json | 2 +- AGENT.md | 1 + README.md | 2 +- TEAM.md | 3 ++- VERSION | 2 +- skills/new-project/SKILL.md | 1 + 7 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index dad506d..edeea29 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -6,14 +6,14 @@ }, "metadata": { "description": "Toolkit of skills, hooks, templates, and guides for bootstrapping AI-agent-friendly projects.", - "version": "0.4.3" + "version": "0.4.4" }, "plugins": [ { "name": "agent-starter", "source": "./", "description": "Skills, hooks, templates, and engineering guides for bootstrapping AI-agent-friendly projects, with a per-project self-improvement loop. Bundles the /new-project and /adopt-project scaffolding skills plus commit, simplify, reflect, remember, and dream.", - "version": "0.4.3", + "version": "0.4.4", "author": { "name": "Nick Sawinyh" }, diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index eba6b15..8b5ccf9 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/claude-code-plugin.json", "name": "agent-starter", - "version": "0.4.3", + "version": "0.4.4", "description": "Skills, hooks, templates, and engineering guides for bootstrapping AI-agent-friendly projects, with a per-project self-improvement loop.", "author": { "name": "Nick Sawinyh" diff --git a/AGENT.md b/AGENT.md index 9ad88f8..986fa04 100644 --- a/AGENT.md +++ b/AGENT.md @@ -158,6 +158,7 @@ Hooks wired by default: - `lint-on-edit.sh` - Biome + ESLint on save; ruff check + format for Python (PostToolUse:Write|Edit) - `check-silent-errors.sh` - block swallowed exceptions (PostToolUse:Write|Edit) - `block-dangerous-commands.sh` - block force-push, `reset --hard`, recursive rm on `/`/`~` (PreToolUse:Bash) +- `suggest-loop-improvements.sh` - on `/loop`, offer tighter drop-in rewrites via an interactive picker before it runs (UserPromptSubmit) Optional: add `--with-read-guard` to also wire `track-reads.sh` + `require-read-before-edit.sh` (force Read before Edit). Recent Claude Code diff --git a/README.md b/README.md index f22be1a..5245907 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Install everything at once as a **Claude Code plugin** - this repo doubles as a /plugin install agent-starter@agent-starter ``` -That loads all the skills (`/new-project`, `/adopt-project`, `/commit`, `/commit-push-pr`, `/simplify`, `/reflect`, `/remember`, `/dream`) **and** wires the enforcement hooks (file-size, lint-on-edit, silent-error, dangerous-command, codebase-health) from `hooks/hooks.json`. This is the simplest path and the one to recommend. +That loads all the skills (`/new-project`, `/adopt-project`, `/commit`, `/commit-push-pr`, `/simplify`, `/reflect`, `/remember`, `/dream`) **and** wires the enforcement hooks (file-size, lint-on-edit, silent-error, dangerous-command, codebase-health) plus a `/loop` instruction-review hook from `hooks/hooks.json`. This is the simplest path and the one to recommend. The read-before-edit guard pair is left out of the plugin on purpose (recent Claude Code enforces read-before-edit natively); opt into it via `install.sh --with-read-guard` below. diff --git a/TEAM.md b/TEAM.md index 5cc88cf..cc73bd9 100644 --- a/TEAM.md +++ b/TEAM.md @@ -61,7 +61,8 @@ Instead: { "matcher": "Write|Edit", "hooks": [{ "type": "command", "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/check-silent-errors.sh", "timeout": 5, "statusMessage": "Checking error handling..." }] } ], "PreToolUse": [{ "matcher": "Bash", "hooks": [{ "type": "command", "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/block-dangerous-commands.sh", "timeout": 3, "statusMessage": "Checking command safety..." }] }], - "SessionStart":[{ "hooks": [{ "type": "command", "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/check-codebase-health.sh .", "timeout": 15, "statusMessage": "Checking codebase health..." }] }] + "SessionStart":[{ "hooks": [{ "type": "command", "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/check-codebase-health.sh .", "timeout": 15, "statusMessage": "Checking codebase health..." }] }], + "UserPromptSubmit":[{ "hooks": [{ "type": "command", "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/suggest-loop-improvements.sh", "timeout": 10, "statusMessage": "Reviewing loop/goal instructions..." }] }] } } ``` diff --git a/VERSION b/VERSION index 17b2ccd..6f2743d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.3 +0.4.4 diff --git a/skills/new-project/SKILL.md b/skills/new-project/SKILL.md index ebf509c..a2b5a22 100644 --- a/skills/new-project/SKILL.md +++ b/skills/new-project/SKILL.md @@ -204,6 +204,7 @@ Hook behavior (wired by default): - `check-silent-errors.sh` - blocks writes that introduce swallowed exceptions. - `block-dangerous-commands.sh` - blocks force-push, `git reset --hard`, recursive rm on `/`/`~`, before they run. - `check-codebase-health.sh` - runs at session start. Reports files over 500 lines that need splitting. Silent when healthy. +- `suggest-loop-improvements.sh` - when you run `/loop`, proposes 2-3 tighter drop-in rewrites (explicit success criteria, stop condition, scope, verification) and lets you pick one via an interactive menu. Advisory only for client-side commands like `/goal`. Optional: `--with-read-guard` also wires `track-reads.sh` + `require-read-before-edit.sh`. Recent Claude Code versions enforce read-before-edit natively, so only add it for older versions. From 177eebd39de20a2eb98b50276544eb9d4013682a Mon Sep 17 00:00:00 2001 From: sneg55 Date: Wed, 1 Jul 2026 17:41:56 -0400 Subject: [PATCH 4/4] feat(hooks): scope loop-review hook to /loop only /goal is a client-side local command whose effect runs at submit time, before Claude's turn, so an advisory injection can't gate it (as observed in practice). Drop /goal from the matcher, rename the injected tag to , and align statusMessages and docs to /loop only. Co-Authored-By: Claude Opus 4.8 --- TEAM.md | 2 +- hooks/README.md | 4 ++-- hooks/hooks.json | 2 +- hooks/suggest-loop-improvements.sh | 20 +++++++++++--------- install.sh | 2 +- skills/new-project/SKILL.md | 2 +- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/TEAM.md b/TEAM.md index cc73bd9..25befda 100644 --- a/TEAM.md +++ b/TEAM.md @@ -62,7 +62,7 @@ Instead: ], "PreToolUse": [{ "matcher": "Bash", "hooks": [{ "type": "command", "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/block-dangerous-commands.sh", "timeout": 3, "statusMessage": "Checking command safety..." }] }], "SessionStart":[{ "hooks": [{ "type": "command", "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/check-codebase-health.sh .", "timeout": 15, "statusMessage": "Checking codebase health..." }] }], - "UserPromptSubmit":[{ "hooks": [{ "type": "command", "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/suggest-loop-improvements.sh", "timeout": 10, "statusMessage": "Reviewing loop/goal instructions..." }] }] + "UserPromptSubmit":[{ "hooks": [{ "type": "command", "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/suggest-loop-improvements.sh", "timeout": 10, "statusMessage": "Reviewing loop instructions..." }] }] } } ``` diff --git a/hooks/README.md b/hooks/README.md index 5486dcd..b553fdd 100644 --- a/hooks/README.md +++ b/hooks/README.md @@ -167,7 +167,7 @@ Add to `settings.json`: - Each replacement adds only the missing precision - explicit success criteria, a stop condition, bounded scope, a verification step - while preserving your interval and args. - Non-blocking (exit 0): if the command is already solid, or the session is headless (no interactive prompt), the original runs unchanged. -**Interactive gating only works for model-driven commands.** `/loop` hands control to Claude to interpret and act, so the injected "ask first" instruction lands *before* any action and the picker can render. Client-side local commands like `/goal` execute their effect at submit time (the CLI sets the goal and arms its Stop hook before Claude's turn even starts), so an advisory (exit 0) injection cannot intercept them - the picker will not fire, and `/goal` also explicitly tells Claude not to pause and ask. The hook still matches `/goal*` text, but treat the review there as advisory only. For a true gate you would need a client-side command that defers its effect to the model turn. +**Scoped to `/loop` only, on purpose.** `/loop` hands control to Claude to interpret and act, so the injected "ask first" instruction lands *before* any action and the picker can render. Client-side local commands like `/goal` execute their effect at submit time (the CLI sets the goal and arms its Stop hook before Claude's turn even starts), so an advisory (exit 0) injection cannot intercept them, and `/goal` also explicitly tells Claude not to pause and ask. The hook therefore matches only `/loop*` and ignores `/goal`. Interactive gating like this works only for commands whose effect Claude performs on its turn, not for client-side commands. Add to `settings.json`: @@ -176,7 +176,7 @@ Add to `settings.json`: "UserPromptSubmit": [ { "hooks": [ - { "type": "command", "command": "~/.claude/hooks/suggest-loop-improvements.sh", "timeout": 10, "statusMessage": "Reviewing loop/goal instructions..." } + { "type": "command", "command": "~/.claude/hooks/suggest-loop-improvements.sh", "timeout": 10, "statusMessage": "Reviewing loop instructions..." } ] } ] diff --git a/hooks/hooks.json b/hooks/hooks.json index 520ca68..5f072f1 100644 --- a/hooks/hooks.json +++ b/hooks/hooks.json @@ -68,7 +68,7 @@ "type": "command", "command": "${CLAUDE_PLUGIN_ROOT}/hooks/suggest-loop-improvements.sh", "timeout": 10, - "statusMessage": "Reviewing loop/goal instructions..." + "statusMessage": "Reviewing loop instructions..." } ] } diff --git a/hooks/suggest-loop-improvements.sh b/hooks/suggest-loop-improvements.sh index a8e74f1..b8aa24c 100755 --- a/hooks/suggest-loop-improvements.sh +++ b/hooks/suggest-loop-improvements.sh @@ -1,27 +1,29 @@ #!/usr/bin/env bash -# UserPromptSubmit hook: when the user runs /loop or /goal, inject an instruction -# telling Claude to first propose improved, drop-in replacements for the command -# and let the user pick one interactively via AskUserQuestion (no copy-paste), -# then run only the chosen command. +# UserPromptSubmit hook: when the user runs /loop, inject an instruction telling +# Claude to first propose improved, drop-in replacements for the command and let +# the user pick one interactively via AskUserQuestion (no copy-paste), then run +# only the chosen command. # # The hook itself does no LLM work and spawns no nested session - it only injects # context, so the already-running model generates the variants. That keeps it # fast (<50ms), needs no API key, and no matcher (UserPromptSubmit has none), so -# it filters to /loop and /goal by prompt text. Non-blocking: every other prompt, +# it filters to /loop by prompt text. Scoped to /loop only: client-side local +# commands like /goal execute their effect at submit time, before Claude's turn, +# so an advisory injection cannot gate them. Non-blocking: every other prompt, # and any parse failure, passes through untouched (exit 0). set -euo pipefail input="$(cat)" prompt="$(printf '%s' "$input" | jq -r '.prompt // empty')" -# Only act on /loop and /goal invocations; everything else passes through. +# Only act on /loop invocations; everything else passes through. case "$prompt" in - /loop*|/goal*) ;; + /loop*) ;; *) exit 0 ;; esac cat < + The user is about to run this command: $prompt Before executing it, do this first: @@ -40,6 +42,6 @@ Before executing it, do this first: If the command already has clear success criteria, a stop condition, bounded scope, and a verification step, skip the question and run it unchanged. If you cannot show an interactive prompt (headless/non-interactive session), run the original unchanged. - + EOF exit 0 diff --git a/install.sh b/install.sh index 52c5b4e..5fca5dc 100755 --- a/install.sh +++ b/install.sh @@ -72,7 +72,7 @@ jq --arg h "$H" --argjson guard "$READ_GUARD" ' | add("PostToolUse"; entry("Write|Edit"; $h + "/check-silent-errors.sh"; 5; "Checking error handling...")) | add("PreToolUse"; entry("Bash"; $h + "/block-dangerous-commands.sh"; 3; "Checking command safety...")) | add("SessionStart"; {hooks: [{type: "command", command: ($h + "/check-codebase-health.sh ."), timeout: 15, statusMessage: "Checking codebase health..."}]}) - | add("UserPromptSubmit"; {hooks: [{type: "command", command: ($h + "/suggest-loop-improvements.sh"), timeout: 10, statusMessage: "Reviewing loop/goal instructions..."}]}) + | add("UserPromptSubmit"; {hooks: [{type: "command", command: ($h + "/suggest-loop-improvements.sh"), timeout: 10, statusMessage: "Reviewing loop instructions..."}]}) | (if $guard == 1 then add("PostToolUse"; entry("Read"; $h + "/track-reads.sh"; 3; "Tracking reads...")) | add("PreToolUse"; entry("Edit|Write"; $h + "/require-read-before-edit.sh"; 3; "Checking read log...")) diff --git a/skills/new-project/SKILL.md b/skills/new-project/SKILL.md index a2b5a22..68681fb 100644 --- a/skills/new-project/SKILL.md +++ b/skills/new-project/SKILL.md @@ -204,7 +204,7 @@ Hook behavior (wired by default): - `check-silent-errors.sh` - blocks writes that introduce swallowed exceptions. - `block-dangerous-commands.sh` - blocks force-push, `git reset --hard`, recursive rm on `/`/`~`, before they run. - `check-codebase-health.sh` - runs at session start. Reports files over 500 lines that need splitting. Silent when healthy. -- `suggest-loop-improvements.sh` - when you run `/loop`, proposes 2-3 tighter drop-in rewrites (explicit success criteria, stop condition, scope, verification) and lets you pick one via an interactive menu. Advisory only for client-side commands like `/goal`. +- `suggest-loop-improvements.sh` - when you run `/loop`, proposes 2-3 tighter drop-in rewrites (explicit success criteria, stop condition, scope, verification) and lets you pick one via an interactive menu. Scoped to `/loop` only (client-side commands like `/goal` run before Claude's turn, so they can't be gated). Optional: `--with-read-guard` also wires `track-reads.sh` + `require-read-before-edit.sh`. Recent Claude Code versions enforce read-before-edit natively, so only add it for older versions.