Start Free
Auto-Avoidance & Auto-Recovery · Save AI Credits · Works with Claude Code, Cursor & OpenClaw

Stop Wasting Your AI Credits on Repeated Errors.

Your AI should finish the job, not get stuck fixing the same mistake. QianYuan Guard adds instant auto-avoidance and verified auto-recovery to Claude Code, Cursor, OpenClaw & n8n — catching stuck loops in 0.1s so your subscription quota goes toward real work. No coding expertise required.

15 callsFree pool, total
30 daysFree validity
3 full patchesFree trial allowance
Claude Code · Cursor · OpenClaw · MCPIntegration paths

Free is a real quota, not a demo lock: 15 calls over 30 days, first 3 recalls return the complete executable patch. No credit card, no auto-renewal.

LIVE REGISTRY STREAM
The repeat tax

Your Agent Has Solved This Before. Why Start Over?

Every fresh session starts blind. The same failure gets diagnosed, patched and forgotten — then diagnosed again next week in another repository.

Repeated troubleshooting

Identical stack traces are re-read from scratch because the last fix lived only in a chat window.

Retry loops

Agents retry the same failing command with cosmetic changes, burning tokens and time without new information.

Lost experience

What worked is never written down in a form the next agent can query, so the team relearns it.

01 RECORDFailure and fix are written back
02 RECALLAgent queries the symptom
03 REUSECandidate fix is returned for the agent to apply
04 VERIFYOutcome is recorded; the entry gains evidence

Guard is a recall assistant. It narrows the search space and returns recorded fixes; it does not guarantee that every error is solved, and it does not apply patches without your agent.

Real fixes, honest labels

Three Failures Agents Keep Re-solving

Symptoms and root causes below are published entries from the library. Labels state how each entry was checked — we do not call anything “Verified” or “Battle-Tested” without an independent external reproduction.

MCP · stdio · WindowsRule-Audited

FastMCP (stdio): a synchronous tool that first-imports numpy/scipy deadlocks on Windows

Problem
First call hangs for minutes — often forever. Reproducible on Windows with the stdio transport.
Root cause
OpenBLAS loader lock inside DllMain when the scientific stack is imported for the first time inside a synchronous tool.
Solution
Move the import out of the tool path, add an init guard, and pin OPENBLAS_NUM_THREADS=1. The full patch is returned by qy_recall.
Verification
Automated rule review only. No independent external account has reproduced it under our record.
Reuse value
Any Windows + stdio MCP server that imports numpy, scipy or pandas inside a tool handler.
MCP · HTTPRule-Audited

MCP HTTP initialize returned 406 Not Acceptable

Problem
initialize returns 406; the client reports “error decoding response body (server returns SSE instead of JSON)”; the server is skipped at boot.
Root cause
The client Accept header does not declare both JSON and text/event-stream, or the two sides disagree on response-type detection.
Solution
Send Accept: application/json, text/event-stream and sniff content-type before parsing JSON. Patch retrievable via qy_recall.
Verification
Automated rule review only.
Reuse value
Every remote MCP client handshake that supports both JSON and SSE responses.
Schema · ZodRule-Audited

McpError -32602: structured content does not match the tool's output schema

Problem
A Zod intersection output schema passes locally but is rejected by the SDK client after listTools(). SDK 4.1.13 fails; 4.2.0+ passes.
Root cause
Intersection schemas translate into additionalProperties that the client-side validator rejects.
Solution
Flatten the output schema instead of intersecting, or upgrade the SDK to 4.2.0 or newer. Patch retrievable via qy_recall.
Verification
Automated rule review only.
Reuse value
Anyone authoring MCP tool output schemas with Zod.
Four steps, no magic

How It Works

Guard sits beside your agent as an MCP tool plus an optional hook. It records outcomes and answers one question well: “has this failure been seen before?”

STEP 1
Install Guard

One command writes the MCP server entry and, for Claude Code, the hook configuration.

STEP 2
Agent hits a problem

The agent’s own error, stack trace or failing command is the query. No extra instrumentation required.

STEP 3
Recall relevant experience

qy_recall returns ranked candidate fixes, root-cause hints and a confidence signal.

STEP 4
Verify and preserve

If the fix works, the outcome is written back; if it fails, that is recorded too, so the next agent does not repeat it.

Where it runs

Compatibility and Support Level

Support levels are listed per platform. “Supported” means we ran the installer or shipped the plugin ourselves. “Compatible” means the platform speaks standard MCP or OpenAPI, so it works through its own MCP host — we did not run its official installer. Plain chat-only models without tool calling cannot use this.

PlatformIntegrationLevel
Claude CodeHooks (PreToolUse / PostToolUse) + MCPSupported — installer tested
Cursor.cursor/mcp.json standard MCP entrySupported — installer tested
OpenClawNative plugin packageSupported — plugin shipped
OpenAI Codex CLI / ChatGPTStandard Streamable HTTP MCP · codex-cli.tomlSupported — config published
Trae / Windsurf / Cline / Roo CodeStandard MCP JSON config · ide-mcp.jsonSupported — config published
DeepSeek / Kimi / GLM / QwenVia any MCP host or OpenAPI tool call · openapiCompatible — OpenAPI & MCP
Dify / n8n / CozeMCP connector / OpenAPI custom tool · openapiCompatible — OpenAPI & MCP
Plain chat-only LLMs (no tool calling)—Not supported

Ready-to-paste configs (no account needed to read them): codex-cli.toml · ide-mcp.json · dify-n8n-coze-openapi.json

Simple, non-renewing

Pricing

Every free entry point uses the same rule: 15 calls total over 30 days, with the first 3 recalls returning complete patches. Paid plans are one-time purchases; nothing renews automatically.

Free
$0
  • 15 calls, total pool
  • Valid for 30 days
  • First 3 recalls return the full patch
  • +3 calls per verified feedback
  • No email required
Start Free
Pro
$4.99 / 30 days
  • Full executable patches, no masking
  • Unlimited normal daily use (Fair-use rate limit applies)
  • Valid 30 days from activation
  • One-time purchase, no auto-renewal
  • Activate with the Gumroad license key
Get Pro One-time payment, no auto-renewal. Activate with the License Key from your Gumroad receipt.
Founder Lifetime
$149 one-time
  • Lifetime access, never expires
  • Limited to 10 seats
  • Custom 50-patch set for 2 frameworks within 48h
  • Same full-patch access as Pro
Get Founder Now on sale — $149 once, 10 seats only. Activate with the license key from your Gumroad receipt to unlock lifetime access.
Already bought? Activate in seconds.

After paying on Gumroad, copy the License Key from your receipt email, open qianyuan.ltd/#activate (or the activate tool in your client), paste your token and the key, and click Activate. Pro unlocks 30 days instantly; Founder unlocks lifetime access.

Protocol and privacy

What Leaves Your Machine

Guard is an MCP server. It does not read your repository or upload source files. Redaction happens locally before any request is sent.

Local redaction rules

The hook replaces secrets and local paths with [REDACTED] before upload:

  • sk-… API keys and ghp_… tokens
  • Bearer … authorization headers
  • Absolute local paths containing a username

Upload limits

When a command fails, at most a high-risk command fragment of 800 characters or the last 20 lines of a stack trace (up to 1,200 characters) is sent. Project source files are never uploaded.

Transport

Streamable HTTP MCP over TLS, bearer-token authenticated. The local API binds to loopback only; a reverse proxy terminates TLS.

Auditable

Hook source ships with the installer and is published at github.com/alvinxiao2/qianyuan-guard so the redaction rules can be read, not just trusted.

Separate collection

China Source

A companion library of Chinese-language engineering sources and incident write-ups, curated separately from the English fix database. It has its own index and does not share the Guard pricing.

Browse China Source

Why separate

Different language, different review pipeline, different audience. Keeping it out of the hero keeps the Guard promise narrow: recall recorded fixes for agent failures.

Questions

FAQ

What is QianYuan Guard?

An MCP server and optional hook that lets an AI agent query a library of recorded failure fixes, then write back whether the fix worked. It is a recall tool, not an autonomous repair agent.

Which AI agents are supported?

Claude Code (hooks + MCP), Cursor (MCP config) and OpenClaw (native plugin) are covered by the installer. OpenAI Codex CLI, Trae, Windsurf, Cline and Roo Code work with the published configs; DeepSeek, Kimi, GLM, Qwen, Dify, n8n and Coze connect through standard MCP or OpenAPI. Chat-only models without tool calling cannot use Guard.

How does it work?

The agent calls qy_recall with the error text or failing command. Guard returns ranked candidate fixes with root-cause hints. The agent applies one, and the outcome is recorded through the verification path.

What is included in Free?

15 calls in a single total pool, valid for 30 days. The first 3 recalls return the complete executable patch; later recalls return the root-cause hint and a locked patch. No credit card and no email are required.

What is Pro?

A one-time $4.99 purchase that unlocks unmasked patches and raises the limit to unlimited normal daily use (fair-use rate limit applies) for 30 days from activation, activated with a Gumroad license key.

Does Pro renew automatically?

No. There is no subscription and no stored payment method. When the 30 days end, the token stops working unless you activate another key.

How does Founder work?

Founder is a one-time $149 lifetime license limited to 10 seats, including a custom 50-patch set for two frameworks within 48 hours. It is on sale now: $149 one-time for 10 seats; activate with your Gumroad license key to unlock lifetime access.

What data is processed?

Your query text (the error or command) and, through the hook, a redacted high-risk command fragment of at most 800 characters or the last 20 lines of a stack trace up to 1,200 characters. Secrets, bearer tokens and local paths are replaced locally with [REDACTED]. Source files are not uploaded.

How do I install Guard?

Run the one-line installer for macOS or Linux, or the PowerShell installer on Windows. It writes the MCP entry for your client, the optional Claude Code hook, and a local credentials file.

How do I contact support?

Email support@qianyuan.ltd. Include your token ID (never the token itself) and the recall ID if you have one.

Start Free — 15 calls, 30 days

Enter an email and an agent name. The key is issued immediately; the first 3 recalls return complete patches.