How to build a custom AI harness with Claude SDK

Categories: AI, Product

Summary

A harness is simply code wrapped around an AI agent to make it more effective for specific workflows—and it's not about complexity but constraint. The key insight: successful harnesses combine deterministic and non-deterministic steps (like Sentry debugging workflows), making them far superior to general-purpose AI coding tools for repetitive, multi-step business processes.

Key Takeaways

  1. A harness has three core components: specific context, specific actions, and specific outcomes. Build a harness when the same workflow needs identical setup and outcomes—coding, incident management, PR releases, and support escalations are prime use cases.
  2. Custom harnesses outperform general-purpose AI tools because they allow 'micromanaging' the workflow—being prescriptive about how jobs get done. The speaker chose Sentry debugging as their first harness because it required coding, custom context, and specific outcomes (Linear tracking + documentation).
  3. Real-world harness applications combine technical and non-technical workflows: production incident management, PR releases, support escalations, migrations, research processes, and doc consolidation—proving harnesses apply beyond just coding.
  4. Build a harness when you identify 'combination of deterministic and non-deterministic workflow step-by-step process'—this is the decision framework. If it's a one-off task, use Claude directly; if it's repeated with structure, build a harness.
  5. The harness interface in this example uses terminal UI, Claude agent SDK, and integrates with real tools (Sentry, Vercel, Linear, GitHub), demonstrating how constraint through tool integration and UI design makes agents more effective than unrestricted models.

Related topics

Transcript Excerpt

A harness is some code around an AI agent that makes it more effective. Why we've seen people build these specific use case harnesses is sometimes with a specific job, you just want to micromanage a little bit. You just want to be more prescriptive about how that job gets done. [music] I'm going to show you how it works and then we will talk about how I built it. So the interface I built for my harness is a terminal UI. The harness core is run on clawed agent SDK and then it's connected to real tools. So it's connected [music] to Sentry Vcel and then it's connected to linear and GitHub in terms of getting [music] tasks done. I think we all have done good work. But then now I've realized that these agents can help us solve very very specific problems by constraining that work. It's really l…

More from How I AI Podcast