Preserve Task Scope
The assistant reads the approved specification before starting and checks each planned action against it. It needs your explicit approval to expand the scope, even when the specification leaves a detail open. Before reporting completion, it checks the finished work and flags any deviations or unresolved scope questions.
- Use when
- Use it for tasks such as a bug fix or refactor where the specification defines which changes are authorized.
- Limits
- This instruction requires an approved specification. For exploratory work, define and approve the scope first.
Use this instruction
A standing instruction is a direction you save so the assistant can use it again in future conversations. You can also try this instruction in a single chat before deciding whether to save it.
(
url='https://www.andyagentlab.com/library/instructions/preserve-task-scope.md'
dest='./CLAUDE.md'
begin='<!-- BEGIN library instruction: preserve-task-scope -->'
tmp="$(mktemp)" || exit 1
rc=0
if curl -fsSL "$url" -o "$tmp" && [ -s "$tmp" ]; then
if [ -f "$dest" ] && grep -qF -- "$begin" "$dest"; then
echo "Already installed: $dest"
else
{
if [ -s "$dest" ]; then
if [ -n "$(tail -c 1 "$dest")" ]; then echo; fi
echo
fi
printf '%s\n' "$begin"
cat "$tmp"
if [ -n "$(tail -c 1 "$tmp")" ]; then echo; fi
printf '%s\n' '<!-- END library instruction: preserve-task-scope -->'
} >> "$dest" && echo "Installed in: $dest" || rc=1
fi
else
echo "Download failed: nothing was changed." >&2
rc=1
fi
rm -f "$tmp"
exit "$rc"
)
(
url='https://www.andyagentlab.com/library/instructions/preserve-task-scope.md'
dest='.claude/rules/preserve-task-scope.md'
tmp="$(mktemp)" || exit 1
rc=0
if curl -fsSL "$url" -o "$tmp" && [ -s "$tmp" ]; then
if [ -e "$dest" ]; then
if cmp -s "$tmp" "$dest"; then
echo "Already installed: $dest"
else
echo "Kept your version: $dest differs from the download and was not changed."
fi
else
mkdir -p "$(dirname "$dest")" && cat "$tmp" > "$dest" && echo "Installed: $dest" || rc=1
fi
else
echo "Download failed: nothing was changed." >&2
rc=1
fi
rm -f "$tmp"
exit "$rc"
)
(
url='https://www.andyagentlab.com/library/instructions/preserve-task-scope.md'
dest="$HOME/.claude/CLAUDE.md"
begin='<!-- BEGIN library instruction: preserve-task-scope -->'
tmp="$(mktemp)" || exit 1
rc=0
if curl -fsSL "$url" -o "$tmp" && [ -s "$tmp" ]; then
if [ -f "$dest" ] && grep -qF -- "$begin" "$dest"; then
echo "Already installed: $dest"
else
mkdir -p "$HOME/.claude" && {
if [ -s "$dest" ]; then
if [ -n "$(tail -c 1 "$dest")" ]; then echo; fi
echo
fi
printf '%s\n' "$begin"
cat "$tmp"
if [ -n "$(tail -c 1 "$tmp")" ]; then echo; fi
printf '%s\n' '<!-- END library instruction: preserve-task-scope -->'
} >> "$dest" && echo "Installed in: $dest" || rc=1
fi
else
echo "Download failed: nothing was changed." >&2
rc=1
fi
rm -f "$tmp"
exit "$rc"
)
(
url='https://www.andyagentlab.com/library/instructions/preserve-task-scope.md'
dest="$HOME/.claude/rules/preserve-task-scope.md"
tmp="$(mktemp)" || exit 1
rc=0
if curl -fsSL "$url" -o "$tmp" && [ -s "$tmp" ]; then
if [ -e "$dest" ]; then
if cmp -s "$tmp" "$dest"; then
echo "Already installed: $dest"
else
echo "Kept your version: $dest differs from the download and was not changed."
fi
else
mkdir -p "$(dirname "$dest")" && cat "$tmp" > "$dest" && echo "Installed: $dest" || rc=1
fi
else
echo "Download failed: nothing was changed." >&2
rc=1
fi
rm -f "$tmp"
exit "$rc"
)
(
url='https://www.andyagentlab.com/library/instructions/preserve-task-scope.md'
dest='AGENTS.md'
if [ -s AGENTS.override.md ]; then dest='AGENTS.override.md'; fi
begin='<!-- BEGIN library instruction: preserve-task-scope -->'
tmp="$(mktemp)" || exit 1
rc=0
if curl -fsSL "$url" -o "$tmp" && [ -s "$tmp" ]; then
if [ -f "$dest" ] && grep -qF -- "$begin" "$dest"; then
echo "Already installed: $dest"
else
{
if [ -s "$dest" ]; then
if [ -n "$(tail -c 1 "$dest")" ]; then echo; fi
echo
fi
printf '%s\n' "$begin"
cat "$tmp"
if [ -n "$(tail -c 1 "$tmp")" ]; then echo; fi
printf '%s\n' '<!-- END library instruction: preserve-task-scope -->'
} >> "$dest" && echo "Installed in: $dest" || rc=1
fi
else
echo "Download failed: nothing was changed." >&2
rc=1
fi
rm -f "$tmp"
exit "$rc"
)
(
url='https://www.andyagentlab.com/library/instructions/preserve-task-scope.md'
home="${CODEX_HOME:-$HOME/.codex}"
dest="$home/AGENTS.md"
if [ -s "$home/AGENTS.override.md" ]; then dest="$home/AGENTS.override.md"; fi
begin='<!-- BEGIN library instruction: preserve-task-scope -->'
tmp="$(mktemp)" || exit 1
rc=0
if curl -fsSL "$url" -o "$tmp" && [ -s "$tmp" ]; then
if [ -f "$dest" ] && grep -qF -- "$begin" "$dest"; then
echo "Already installed: $dest"
else
mkdir -p "$home" && {
if [ -s "$dest" ]; then
if [ -n "$(tail -c 1 "$dest")" ]; then echo; fi
echo
fi
printf '%s\n' "$begin"
cat "$tmp"
if [ -n "$(tail -c 1 "$tmp")" ]; then echo; fi
printf '%s\n' '<!-- END library instruction: preserve-task-scope -->'
} >> "$dest" && echo "Installed in: $dest" || rc=1
fi
else
echo "Download failed: nothing was changed." >&2
rc=1
fi
rm -f "$tmp"
exit "$rc"
)
SPEC SCOPE — MANDATORY
Identify and read the governing spec before starting work. Treat its approved objectives, boundaries, exclusions, and constraints as binding throughout the task.
RULES
- Check every planned action and change against the approved scope before proceeding.
- Keep planning, implementation, refactoring, testing, and corrections within that scope.
- Do not introduce additional features, cleanup, architectural changes, or unrelated improvements unless they are within the approved scope.
- Do not treat missing detail or silence in the spec as permission to expand scope.
- Do not modify or reinterpret the spec to justify an out-of-scope action.
- Proceed beyond the existing scope only after the user explicitly authorizes the specific scope change.
VERIFICATION
Before reporting completion, verify that all performed work conforms to the approved spec and any explicitly authorized scope changes. Report deviations or unresolved scope questions; do not claim compliance without evidence.
Claude Code · Project · CLAUDE.md
- Destination
./CLAUDE.md- Run in
- Your project's root folder
- Select Copy install command.
- Open a terminal (macOS, Linux or WSL, with
curl) in your project's root folder, paste the command and run it. - Start a new Claude Code session in the project. Claude Code reads
CLAUDE.mdwhen a session starts.
The command downloads the same file as Download .md and adds it to the end of ./CLAUDE.md, between two marker comments, creating the file if there is none. It keeps everything already in the file, adds nothing if the instruction is already there and changes nothing if the download fails.
Claude Code removes block-level HTML comments, such as the markers, before it gives the file to Claude.
Claude Code · Project · Rule file
- Destination
.claude/rules/preserve-task-scope.md- Run in
- Your project's root folder
- Select Copy install command.
- Open a terminal (macOS, Linux or WSL, with
curl) in your project's root folder, paste the command and run it. - Start a new Claude Code session in the project. Claude Code loads its rules when a session starts.
The command downloads the same file as Download .md. It never replaces an existing file and changes nothing if the download fails.
Claude Code · Global · CLAUDE.md
- Destination
~/.claude/CLAUDE.md- Run in
- Any folder
- Select Copy install command.
- Open a terminal (macOS, Linux or WSL, with
curl) in any folder, paste the command and run it. - Start a new Claude Code session. Claude Code reads
~/.claude/CLAUDE.mdin every project on this computer.
The command downloads the same file as Download .md and adds it to the end of ~/.claude/CLAUDE.md, between two marker comments, creating the file if there is none. It keeps everything already in the file, adds nothing if the instruction is already there and changes nothing if the download fails.
Claude Code removes block-level HTML comments, such as the markers, before it gives the file to Claude.
Claude Code · Global · Rule file
- Destination
~/.claude/rules/preserve-task-scope.md- Run in
- Any folder
- Select Copy install command.
- Open a terminal (macOS, Linux or WSL, with
curl) in any folder, paste the command and run it. - Start a new Claude Code session. Claude Code loads this rule in every project on this computer.
The command downloads the same file as Download .md. It never replaces an existing file and changes nothing if the download fails.
Codex · Project
- Destination
AGENTS.md- Run in
- Your project's root folder
- Select Copy install command.
- Open a terminal (macOS, Linux or WSL, with
curl) in your project's root folder, paste the command and run it. - Start a new Codex run or session. Codex reads
AGENTS.mdwhen it starts.
If the folder has a non-empty AGENTS.override.md, Codex reads that file instead of AGENTS.md, so the command adds the instruction there.
The command keeps everything already in the file and marks the added text, so running it again adds nothing. Codex .rules files are not for instructions: they control which commands Codex may run.
Codex · Global
- Destination
~/.codex/AGENTS.md- Run in
- Any folder
- Select Copy install command.
- Open a terminal (macOS, Linux or WSL, with
curl) in any folder, paste the command and run it. - Start a new Codex run or session. Codex reads this file in every project.
If CODEX_HOME is set, Codex reads its home folder from there, so the command writes $CODEX_HOME/AGENTS.md instead. If that folder has a non-empty AGENTS.override.md, Codex reads that file instead, so the command adds the instruction there.
The command keeps everything already in the file and marks the added text, so running it again adds nothing. Codex .rules files are not for instructions: they control which commands Codex may run.
Claude chat · Use in one chat
- Select Copy instruction.
- Paste it into your message in Claude, above your request. It applies to that conversation only.
Claude chat · Save to a project
- Select Copy instruction.
- Open the project in Claude and select Set project instructions.
- Paste the text and select Save instructions. Claude uses it in every chat in that project.
Claude chat · Save to my account
- Select Copy instruction.
- Click your initials in the lower left corner, then open Settings → Your Claude (in the older settings layout: Account).
- Paste the text under Instructions (older layout: Instructions for Claude). Claude applies it to all your conversations.
ChatGPT · Use in one chat
- Select Copy instruction.
- Paste it into your message in ChatGPT, above your request. It applies to that conversation only.
ChatGPT · Save to a project
- Select Copy instruction.
- Open the project in ChatGPT, select the more options menu (•••) in the upper-right corner, then Project settings.
- Paste the text into Instructions. It applies only in that project and overrides your custom instructions there.
ChatGPT · Save to my account
- Select Copy instruction.
- On the web or in the desktop app, open Settings → Personalization. In the iOS or Android app, open Settings → Customize ChatGPT.
- Turn on Enable customization and paste the text into Custom Instructions. It applies to all your chats.
This instruction has 1,014 characters. Custom Instructions holds up to 1,500 characters on the Free and Go plans and up to 5,000 on Plus, Pro, Business, Enterprise and Education, together with anything already in the field.