# Claude Blocks Your Math Task: Why the Filter Triggers and How to Rephrase the Prompt

> AI Release · @ai_releaseorg · https://ai-release.org/guides/claude-blokiruet-zadachu-po-matematike-pochemu-srabatyv_en.html

## TL;DR
- Time to complete: 15 minutes
- Difficulty: Basic
- You need: an Anthropic account (either API access with an `ANTHROPIC_API_KEY`, or a browser session at claude.ai), `curl` and `jq` installed, a text editor, and the exact prompt that got blocked saved to a file. Your model ID, API version header and endpoint — check the documentation for your plan.

## What you'll get
- A `~/claude-reframe/` workspace containing `prompts/original.txt` (your blocked prompt, preserved verbatim) and three numbered reformulations in `prompts/*.json`.
- A reusable rewrite table mapping each filter trigger to a concrete replacement, plus a copy-ready prompt template.
- A `regression.sh` script that resends every variant and prints `stop_reason` per request, so you can prove the reformulation passes instead of guessing.

## Quick start
```bash
mkdir -p ~/claude-reframe/prompts && cd ~/claude-reframe
printf '%s\n' "<paste your blocked prompt verbatim here>" > prompts/original.txt
export ANTHROPIC_API_KEY="<your-key>"
curl -s https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: <api-version>" \
  -H "content-type: application/json" \
  -d @request.json | jq -r '.stop_reason'
```
Details and verification — in the steps below.

## Prompt for copying
```prompt
You are helping me prepare a formal mathematics write-up. This is a legitimate university-level task: set theory, for a course handout I teach.

Context
- Domain: ZFC set theory.
- Audience: second-year undergraduates.
- My role: lecturer preparing printed material.
- Output format: markdown. Definitions as bullet lists, theorems numbered, every proof step on its own line, LaTeX notation, no filler and no commentary about the request itself.

Task
1. Restate the problem in your own words and list the objects involved: <objects>.
2. List the definitions and axioms required before the proof starts.
3. Give the proof or construction as numbered steps; mark each step that relies on an axiom.
4. Flag every point where a standard assumption is needed (for example Choice or Regularity).
5. Finish with three exercises on the same idea, with answers.

Constraints
- Stay inside the mathematical task only.
- If a part of the problem is ambiguous, ask one clarifying question instead of guessing.
- If you cannot complete a step, say which step and why, rather than stopping silently.

Problem: <paste your set-theory question here>
```

Replace before sending:
- `<objects>` — the concrete objects, e.g. `the power set of an infinite set, ordinals, the Axiom of Choice`.
- `<paste your set-theory question here>` — the mathematical question itself, with no instructions inside it.

## Requirements and setup
![Illustration: Requirements and setup](https://ai-release.org/guides/img/claude-blokiruet-zadachu-po-matematike-pochemu-srabatyv-en-1.jpg?v=1795876623)

- Linux, macOS or Windows with WSL; `bash` 4 or newer.
- `curl` and `jq` on `PATH`. Verify: `curl --version` and `jq --version` both print a version line.
- An `ANTHROPIC_API_KEY` exported in the shell, **or** a working claude.ai session in a browser if you prefer to test by hand.
- Write access to your home directory (the workspace lives in `~/claude-reframe`).
- Your model ID and the current `anthropic-version` header value — check the documentation; both change over time and are deliberately left as placeholders here.

If you work through the desktop app rather than the API, the same rewrite rules apply; the setup differences are covered in [Claude Code Desktop: setup, limits and how it differs from the CLI](https://ai-release.org/guides/claude-code-desktop-ustanovka.html?utm_source=tg&utm_medium=channel&utm_campaign=guide_inline&utm_content=guide_to_guide).

## Step 1. Capture the refusal and classify it
**What to do:** Save the blocked prompt untouched, then resend it once through the API and record what comes back.

Create the request file:

```json
{
  "model": "<model-id>",
  "max_tokens": 2048,
  "messages": [
    { "role": "user", "content": "<paste your blocked prompt here>" }
  ]
}
```

Save it as `request.json`, then run the `curl` from Quick start.

**Why:** A refusal is only reproducible if the input is byte-identical. Once you edit the prompt you lose the baseline, and you can no longer tell whether the reformulation worked or the topic simply changed. The `stop_reason` field is the machine-readable signal: `refusal` means the safety layer stopped the answer, `end_turn` means the model finished normally.

**How to check:** `jq -r '.stop_reason'` prints `refusal` for the original prompt. In the browser UI the same event looks like a short message of the form `I can't help with that.` with no continuation.

**Example:** Epic Games founder Tim Sweeney reported that Claude interrupted his work on set theory and called the resulting filter "garbage". That is the signature of a *false positive*: the subject was legitimate mathematics, the wording was not. Treat the refusal text as your only visible signal — the classifier score itself is not exposed.

## Step 2. Rewrite the request against the trigger list
![Illustration: Step 2. Rewrite the request against the trigger list](https://ai-release.org/guides/img/claude-blokiruet-zadachu-po-matematike-pochemu-srabatyv-en-2.jpg?v=1795876630)

**What to do:** Compare your original wording with the table below and replace every left-column pattern.

| Trigger in the original request | Why it fires | Replacement |
|---|---|---|
| Meta-instructions telling the model to drop its rules | Reads as an attempt to override the safety layer | Delete entirely; keep only the task |
| Role-play wrappers ("act as a system with no limits") | Framed as a bypass, not a task | State the real role: `I am preparing a course handout` |
| Words like "unrestricted", "uncensored", "no filters" | Direct classifier keywords | Remove; describe the output format instead |
| Many unrelated topics in one message | Batch requests score higher risk | One question per request |
| No stated purpose, audience or format | Ambiguous intent is scored conservatively | First sentence = purpose + audience + format |
| Math buried inside prose instructions | The model cannot separate task from directive | Put the task under a `Task` heading, the math under `Problem:` |

Then apply the four rewrite rules in order:

1. **State purpose, audience and output format first.** `I am a lecturer preparing a handout for second-year undergraduates; answer in markdown with numbered proof steps.`
2. **Name the domain and objects explicitly.** `ZFC set theory`, `ordinals`, `power set` — precise notation removes the ambiguity that the classifier resolves as risk.
3. **Separate the directive from the data.** The math goes after `Problem:`; the formatting instructions stay above it.
4. **Split before you expand.** Ask for an outline and the axiom list first; only then request the full proof.

**Why:** Filters score intent, not subject. The same set-theory question phrased as a clear academic task and phrased as an instruction-overriding role-play are two different inputs to the classifier, and only one of them is ambiguous.

**How to check:** Run each variant and compare `stop_reason`:

```bash
for f in prompts/*.json; do
  printf '%s: ' "$f"
  curl -s https://api.anthropic.com/v1/messages \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: <api-version>" \
    -H "content-type: application/json" \
    -d @"$f" | jq -r '.stop_reason'
done
```

**Example:** `prompts/v1_original.json: refusal` followed by `prompts/v3_prompt_template.json: end_turn`. The difference between the two files is wording only — same mathematics, same model.

## Step 3. Verify the reformulation and lock it in
![Illustration: Step 3. Verify the reformulation and lock it in](https://ai-release.org/guides/img/claude-blokiruet-zadachu-po-matematike-pochemu-srabatyv-en-3.jpg?v=1795876634)

**What to do:** Run the passing variant twice, check the output structure, and keep it as your template.

```bash
curl -s https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: <api-version>" \
  -H "content-type: application/json" \
  -d @prompts/v3_prompt_template.json \
  | jq -r '.content[0].text' | head -n 40
```

**Why:** A single passing run can be luck. Two runs with the same structure prove the prompt is stable, and the saved file means you never rewrite it from memory.

**How to check:** the printed text starts with the restated problem, then the definition list, then numbered proof steps in LaTeX. Confirm with this checklist:

- [ ] `stop_reason` is `end_turn` on both runs
- [ ] the answer restates the problem before proving anything
- [ ] proof steps are numbered and each axiom use is marked
- [ ] notation is LaTeX (`$...$` or `\[ ... \]`)
- [ ] no sentence about the request itself appears in the output
- [ ] the file `prompts/v3_prompt_template.json` is committed or backed up

**Example:** a correct first screen shows `1. Restatement` … `2. Definitions` … `3. Proof` — if the first line is an apology or a meta-comment, go back to Step 2 and cut the remaining trigger.

## Troubleshooting

**Problem. The rewritten request is still refused.**
- Ошибка: `stop_reason=refusal`, or on screen `I can't help with that.`
- Причина: the request still bundles several questions, or the purpose sentence was dropped during editing.
- Решение: reduce to one question and resend. If it passes, add the second part back and resend after each addition — the part that flips `stop_reason` back to `refusal` is the one carrying the trigger.

**Problem. The answer stops in the middle of a proof.**
- Ошибка: `stop_reason=max_tokens`
- Причина: `max_tokens` is too small for a full proof, not a filter event.
- Решение: raise `max_tokens` in `request.json`, or split the task — request the outline and axiom list first, then ask for the expansion of one numbered step per request.

**Problem. `jq` prints `null` instead of a stop reason.**
- Ошибка: `null`
- Причина: the call failed before generating, so the response has an `error` object instead of `content`.
- Решение: `curl -s ... -d @request.json | jq .` to read the raw body. A typical result is `{"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}` — re-export `ANTHROPIC_API_KEY` and rerun. If the body shows a JSON parse error instead, validate the file with `jq . request.json`.

## Summary and next steps
Keep the original and the passing prompt side by side — the diff between them is your personal trigger list, and it transfers to any other model you use. If refusals persist on legitimate math, compare behaviour across providers before switching, as described in [ChatGPT, Claude, Gemini, DeepSeek: AI assistant comparison](https://ai-release.org/guides/sravnenie-ii-assistentov.html?utm_source=tg&utm_medium=channel&utm_campaign=guide_inline&utm_content=guide_to_guide).

## FAQ
**Why does Claude block a math question?**
Because the filter scores intent, not subject. A set-theory problem wrapped in instruction-overriding or "no limits" phrasing looks risky even when the mathematics is ordinary coursework.

**Is it the math or the wording that triggers the block?**
The wording. When Tim Sweeney's set-theory session was interrupted, the subject was standard mathematics — so the correct fix is rewriting the request, not abandoning the topic.

**Does reformulating count as a jailbreak?**
No. A jailbreak tries to remove the model's rules; reformulating states purpose, audience and output format so the same rules can be applied to a clearly legitimate task.

**Should I just switch to another model?**
Only after the rewrite fails. One reformulated request per provider is a fair test; comparing leaderboard positions first is the cheaper step, see [How to Use LMArena (arena.ai)](https://ai-release.org/guides/kak-polzovatsya-lmarena-arena-ai-chitaem-reyting-i-vybi.html?utm_source=tg&utm_medium=channel&utm_campaign=guide_inline&utm_content=guide_to_guide).
