reasoning-trace-optimizer

Analyze AI agent reasoning traces to detect failure patterns and optimize prompts.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/CxxxxDxxxF/project-blackout --skill reasoning-trace-optimizer-cxxxxdxxxf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: reasoning-trace-optimizer
Source: https://github.com/CxxxxDxxxF/project-blackout/tree/main/Agent-Skills-for-Context-Engineering/examples/interleaved_thinking
Command: npx skills add https://github.com/CxxxxDxxxF/project-blackout --skill reasoning-trace-optimizer-cxxxxdxxxf

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires anthropic, pydantic, rich, python-dotenv, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps developers debug and optimize AI agents by analyzing their reasoning traces, identifying failure patterns, and suggesting prompt improvements.

Core Features & Use Cases

  • Trace Capture: Records detailed thinking blocks and tool calls from M2.1 agent interactions.
  • Pattern Analysis: Detects common issues like context degradation, tool confusion, and instruction drift.
  • Prompt Optimization: Iteratively refines prompts to improve agent performance and reliability.
  • Use Case: An agent is failing to follow complex instructions. Use this Skill to analyze its reasoning trace, discover it's losing context, and automatically generate an improved prompt that reinforces goal adherence.

Quick Start

Use the reasoning trace optimizer skill to analyze the agent's last task failure.

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 an AI agent that is losing context and failing to follow complex instructions?

To debug an AI agent experiencing context degradation or instruction drift, you can analyze its reasoning traces to identify failure patterns and iteratively optimize prompts to improve goal adherence.

What is the best way to optimize prompts for an agent experiencing tool confusion?

The best way to optimize prompts for tool confusion is to analyze reasoning traces to detect the failure patterns and apply automated prompt improvements that reinforce correct tool usage.

How do I analyze interleaved thinking blocks and tool calls from MiniMax M2.1 agent interactions?

You can analyze interleaved thinking blocks and tool calls from MiniMax M2.1 interactions by recording detailed reasoning traces and evaluating them for failure patterns like context degradation.

Do I need the anthropic Python library to analyze reasoning traces?

Yes, you need the anthropic Python library installed in your environment to interact with the model and analyze reasoning traces for prompt optimization.

Why does my AI agent experience instruction drift during complex tasks?

Instruction drift often occurs due to context degradation over long interactions; analyzing reasoning traces isolates these failure patterns to generate prompts that reinforce goal adherence.