Skip to content
Agentmart
Submit a tool

diagnose-refusal

Use when a coding-agent session refused, blocked, filtered, or returned HTTP 403/401/429 instead of doing the asked work, and the user needs to know WHICH…

Skill by Tamircohen28

IndexedMIT★ 2
Write a review

Chalk Labs

Need help deploying diagnose-refusal?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/tamircohen28-diagnose-refusal

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when a coding-agent session refused, blocked, filtered, or returned HTTP 403/401/429 instead of doing the asked work, and the user needs to know WHICH LAYER refused — harness policy, project instructions, LiteLLM guardrail/routing, upstream provider filter, model refusal, tool permission, or context contamination. Triggers: 'diagnose refusal', '/diagnose-refusal', 'why did it refuse', 'where did the refusal come from', 'GLM refused', 'LiteLLM blocked', 'provider filter', 'model refused', 'HTTP 403 from the model', 'safety refusal', 'cannot tell if this is the model or the proxy'.

Use cases: agent-building

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/diagnose-refusal

What's inside

Skill name
diagnose-refusal
Description
Use when a coding-agent session refused, blocked, filtered, or returned HTTP 403/401/429 instead of doing the asked work, and the user needs to know WHICH LAYER refused — harness policy, project instructions, LiteLLM guardrail/routing, upstream provider filter, model refusal, tool permission, or context contamination. Triggers: 'diagnose refusal', '/diagnose-refusal', 'why did it refuse', 'where did the refusal come from', 'GLM refused', 'LiteLLM blocked', 'provider filter', 'model refused', 'HTTP 403 from the model', 'safety refusal', 'cannot tell if this is the model or the proxy'.
License
MIT
Metadata
capability: refusal-diagnostics · updated-date: 2026-09-10
Instructions
268 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Agent Skills spec issues

  • allowed-tools: must be a space-separated string

Files (8)

  • SKILL.md
  • evals.json · evals/
  • trigger-evals.json · evals/
  • refusal-classes.md · references/
  • report-template.md · references/
  • collect-environment.sh · scripts/
  • init-bundle.sh · scripts/
  • redact-secrets.py · scripts/

SKILL.md (first lines)

# Diagnose Refusal

**Diagnostics only.** Isolate *where* a refusal originated in the request path. Do not
retry, reinterpret, weaken, jailbreak, or continue the refused task.

## Hard invariants

1. Do **not** retry the refused operation.
2. Do **not** bypass, weaken, reinterpret, jailbreak, or circumvent any safety policy.
3. Do **not** continue the task that triggered the refusal.
4. Do **not** invent invisible instructions — write `Not visible from this session.`
5. Do **not** expose hidden reasoning or private chain-of-thought.
6. Do **not** copy credential files (`.env`, `.env.*`, `credentials.json`, `*.pem`, `*.key`).
7. Do **not** modify application source or configuration.
8. Redact secrets: replace API keys, tokens, cookies, passwords, Authorization headers,
   and private keys with `***REDACTED***`. For env vars, record **names and SET/UNSET
   only** — never values.

If the current model is itself refusing, this skill still does not ask it to continue —
it switches the job entirely to benign inspection of config, routing, and the refusal text.

## Why this skill exists

A refusal sentence alone is almost useless. The same surface text can come from the
harness, a project skill, a LiteLLM guardrail, a mis-route, an upstream provider filter,
or the model. Differential diagnosis needs a sanitized bundle and a reconstructed path.

## Bundle layout (v2)

Create or replace under the repo root (or cwd if not a git repo):

```text
.refusal-debug/
├── report.md          # full diagnosis (sections 1–9)
├── request.json       # sanitized request metadata if available; else {"status":"unavailable"}
├── response.json      # sanitized response/error metadata if available; else {"status":"unavailable"}
├── routing.md         # HARNESS → LITELLM → PROVIDER → MODEL
├── environment.md     # safe env / tool versions
└── manifest.txt       # list of files created
```

Initialize with the bundled script, then fill the files:

```bash
bash skills/debugging/diagnose-refusal/scripts/init-bundle.sh
bash skills/debugging/diagnose-refusal/scripts/collect-environment.sh > .refusal-debug/environment.md
```

Resolve the skill directory from whatever path the harness loaded (plugin root,
checkout, or symlink). Prefer `git rev-parse --show-toplevel` then
`skills/debugging/diagnose-refusal/scripts/…`.

After writing any file that may contain pasted error bodies, run:

```bash
python3 skills/debugging/diagnose-refusal/scripts/redact-secrets.py .refusal-debug/report.md
python3 skills/debugging/diagnose-refusal/scripts/redact-secrets.py .refusal-debug/request.json
python3 skills/debugging/diagnose-refusal/scripts/redact-secrets.py .refusal-debug/response.json
```

Classification taxonomy: [references/refusal-classes.md](references/refusal-classes.md).
Report skeleton: [references/report-template.md](references/report-template.md).

## Workflow

Copy and track:

```text
Diagnose-refusal progress:
- [ ] 0. Init bundle + hard-invariant stance
- [ ] 1. Incident capture
- [ ] 2. Conversation state
- [ ] 3. Active repository instructions
- [ ] 4. LiteLLM / proxy path
- [ ] 5. Environment (script)
- [ ] 6. Refusal classification
- [ ] 7. Request-path reconstruction → routing.md
- [ ] 8. Comparison tests (propose only — do not execute refused task)
- [ ] 9. Final assessment (top of report.md)
- [ ] 10. Bundle manifest + completion reply
```

### 0. Init

```bash
bash skills/debugging/diagnose-refusal/scripts/init-bundle.sh
```

Incorporate any user notes from `$ARGUMENTS` / the slash-command argument into section 1.

### 1. Incident → `report.md`

Record:

- current date/time (UTC)
- active model name if visible
- provider/backend if visible
- agent/harness name and version if available
- the user's immediately preceding request that resulted in refusal
- the complete refusal response (redacted)
- whether the refusal appeared before or after any tool call
- whether an HTTP/API error was visible
- status / error / request IDs if available

Populate `request.json` / `response.json` when structured metadata exists (status code,
request id, model id, error type). Otherwise write `{"status":"unavailable","reason":"…"}`.

### 2. Conversation state

Summarize the relevant conversation immediately before the refusal. Include the exact
relevant user message where possible.

Identify relevant:

- system/project instructions visible to you
- `AGENTS.md` / `CLAUDE.md` instructions
- activated skills
- slash commands
- MCP tools

From Tamircohen28/tamirs-superpowers, MIT.

More from Tamircohen28/tamirs-superpowers

Signals

Stars
2
Forks
0
Open issues
5
Last commit (this folder)
Oct 17, 2026 (13 days ago)
Last release
Oct 24, 2026 (6 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Tamircohen28

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get diagnose-refusal running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying diagnose-refusal?

CallGet help
Cite this page

diagnose-refusal skill. Agent Mart. https://agentmart.dev/skills/tamircohen28-diagnose-refusal (last updated 2026-10-24)