context-debugging

Diagnose agent failures by classifying context issues and applying remediation steps.

7|2|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/AndurilCode/craftwork --skill context-debugging
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: context-debugging
Source: https://github.com/AndurilCode/craftwork/tree/main/skills/context-debugging
Command: npx skills add https://github.com/AndurilCode/craftwork --skill context-debugging

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you identify why an AI agent produces wrong, ignored, hallucinated, or inconsistent outputs when the root cause is not an obvious code bug but the assembled context or instructions.

Core Features & Use Cases

  • Context-first triage: Verifies what the model actually receives (system prompt, tools, retrieved docs, and history) before diagnosing.
  • Failure classification for agent behavior: Routes issues into common context failure modes like regression, missing context, tool definition problems, buried or conflicting instructions, and context overflow, then matches each to focused fixes.
  • Decision-ready workflow: Provides step-by-step diagnosis questions plus targeted quick and full remediation guidance, and includes an explicit boundary for genuine reasoning failures.

Quick Start

Use the skill when you suspect your agent keeps failing or ignoring instructions by running the context-debugging triage questions and applying the corresponding quick fix for the matched failure category.

Frequently Asked Questions about context-debugging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my AI agent ignore instructions and hallucinate despite constraints?▼

Agent failures often stem from incorrect, missing, or conflicting context rather than code bugs. Diagnosing the assembled context—system prompt, tools, and retrieved docs—against intended instructions isolates whether buried directives or context overflow cause the hallucination.

How do I debug agent behavior regression after prompt or tool changes?▼

Debugging agent regression requires verifying what the model actually receives post-change. Comparing actual context assembly against intended definitions identifies missing directives or tool definition problems introduced by recent modifications.

How do I fix conflicting instructions in my agent's context window?▼

Fixing conflicting instructions requires classifying the agent failure into context failure modes, then applying category-specific remediation. Routing buried or ambiguous directives through targeted context verification resolves instruction conflicts systematically.

What is the best way to diagnose agent failures caused by excessive context?▼

Diagnosing excessive context involves a context-first triage to verify system prompt, tools, and history volume. Classifying the issue as context overflow matches it to focused remediation steps that reduce assembly bloat.

Can I use context debugging if my agent switches to unexpected alternative outputs?▼

Yes, diagnosing unexpected output switches applies when agents regress from expected behaviors. Verifying actual versus intended context and checking for instruction conflicts resolves unexpected alternative outputs without modifying harness code.

When should I not use context debugging for agent failures?▼

Context debugging does not resolve genuine reasoning failures or infrastructure and harness code bugs. It applies exclusively to agent failures caused by incorrect, missing, ambiguous, conflicting, or excessive context assembly.