reasoning-trace-optimizer

Analyze AI agent thinking traces to diagnose tool-use and instruction drift issues.

Updated Feb 14, 2026
One-click install
npx skills add https://github.com/Shakudo-io/opencode-skills --skill reasoning-trace-optimizer-shakudo-io
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: reasoning-trace-optimizer
Source: https://github.com/Shakudo-io/opencode-skills/tree/main/context-optimization/examples/interleaved_thinking
Command: npx skills add https://github.com/Shakudo-io/opencode-skills --skill reasoning-trace-optimizer-shakudo-io

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Reasoning Trace Optimizer helps teams debug and improve AI agents by exposing their interleaved thinking traces and tool-use reasoning to identify errors and optimization opportunities.

Core Features & Use Cases

  • Trace capture and analysis: Record thinking blocks, tool calls, and results to understand agent behavior.
  • Pattern detection: Identify issues such as context degradation, tool_confusion, and instruction drift with concrete evidence.
  • Prompt optimization and skill generation: Produce improved prompts and reusable Agent Skills from analysis results.
  • Use Case: Debug a failing agent, improve prompts for reliability, and generate shareable skills for team-wide adoption.

Quick Start

Capture a trace for a failing task and review the resulting analysis and optimized prompts to begin improvements.

Frequently Asked Questions about reasoning-trace-optimizer

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

FAQPage Schema
How do I debug a failing AI agent using its thinking traces?

To debug a failing AI agent using its thinking traces, you capture the interleaved thinking blocks and tool calls to identify context degradation, tool confusion, and instruction drift with concrete evidence from the recorded session.

What is context degradation and how does it affect agent reliability?

Context degradation is a pattern where an AI agent loses track of instructions or relevant data over time. It affects agent reliability by causing instruction drift or incorrect tool use, which you can diagnose by analyzing interleaved thinking traces.

How do I optimize prompts based on agent tool-use reasoning?

You optimize prompts based on agent tool-use reasoning by analyzing the captured traces to find errors, then generating concrete prompt improvements and reusable Agent Skills to correct the behavior and support continuous improvement.

Can I generate reusable skills from an agent debugging analysis?

Yes, you can generate reusable skills from an agent debugging analysis. The process produces evidence-based recommendations and artifacts, including optimized prompts and shareable Agent Skills for team-wide adoption.

What is the best way to identify tool confusion in AI agents?

The best way to identify tool confusion in AI agents is to capture and analyze their thinking traces. This exposes the interleaved reasoning behind tool calls, providing concrete evidence of when the agent selects or applies the wrong tool.