1.4 KiB
1.4 KiB
Claude Code: Hard Overrides to Stabilize Tool Use
When Claude Code's layered system prompts clash with our tool protocol, force a minimal, deterministic lane.
Settings (recommended)
- Stop sequences:
````,
` (or whatever the IDE uses to inject formatting).
- Max output tokens: small (e.g., 512).
- Temperature: 0.1-0.3.
- Disable auto-formatting / code fences if possible.
- Disable auto-tool use; we trigger tools via explicit JSON only.
System message (short)
Use the contents of docs/prompts/qwen_tool_mode_system.txt verbatim as the final system layer closest to the model.
Runtime guardrails
- Reject any non-JSON output; send a short corrective user message:
OUTPUT MUST BE JSON. Please resend. - If repeated, send
{"final":{"content":{"error":"RESET_REQUIRED"}}}back and restart the session.
Registry injection
- Provide the tool list and JSON Schemas (kom.memory., kom.local.backup., acf.*).
- Keep it short; link to full schemas if the UI allows references.
Troubleshooting
- If model keeps adding prose, tighten stop sequences and lower max tokens.
- If JSON keys drift, include a 2–3 line example of a valid
actionand a validfinal. - If it calls undefined tools, respond with a single tool error and re-present the allowlist.
Fallback DSL
- Accept
@tool <name> {json-args}and convert to a JSONactionbehind the scenes when necessary.