← Reddit

Built a 5-stage agentic pipeline using Claude Code + MCP - here's what actually makes it reliable at scale

Reddit · Official-DevCommX · May 26, 2026
Building a reliable Claude Code + MCP pipeline at scale requires structured skill files that specify exactly what tools to call, in what order, and with what constraints, rather than relying on model improvisation. The builder discovered this through costly errors where Claude executed tools in the wrong sequence, enriching contacts before account research was scored. Encoding each of five pipeline stages as individual skill files transformed the system from a fragile demo into a consistent, auditable production system suitable for daily use.

Detailed Analysis

A developer building a production sales automation pipeline using Claude Code and the Model Context Protocol (MCP) has documented a critical reliability lesson: agentic AI systems fail not because of model capability gaps, but because of insufficient structural constraints on model behavior. The pipeline in question connects Claude Code to Apollo, a sales intelligence platform, across five sequential stages — account sourcing, research and signal scoring, stakeholder mapping, tiered enrichment, and sequence drafting. The core failure mode discovered was that Claude, when given loosely specified instructions, would execute the correct MCP tool calls but in the wrong order, triggering costly API operations prematurely and wasting real credits before prerequisite data was available.

The solution the developer settled on was what they term "skill files" — structured markdown documents stored within the project directory that define, for each pipeline stage, exactly which tools to call, in what sequence, under what constraints, and in what output format. Each skill file functions as a discrete contract that Claude reads before acting, executes against, and then returns structured output from, which the subsequent stage's skill file consumes. This architecture transforms an otherwise improvisational model behavior into a deterministic, auditable workflow. The key insight is that the problem was never the model's competence but rather the absence of formalized execution contracts at every stage boundary.

This matters considerably because it exposes a fundamental tension in deploying large language models within agentic, multi-step pipelines that interact with external services carrying real financial or operational consequences. Claude, like other frontier models, is designed to be adaptive and to fill in ambiguity with inference — a quality that is a strength in conversational or generative contexts but becomes a liability when execution order, cost controls, and data dependencies are strict. The developer's framing — that "Claude improvises when instructions are vague" — captures a systemic challenge that any team building on agentic AI infrastructure will encounter, regardless of which model underlies the system.

The approach described connects to a broader pattern emerging across the AI engineering community: the shift from prompt engineering as a conversational craft toward what might be called workflow specification engineering. As Claude Code and MCP gain adoption for automating tasks that touch APIs, databases, and external services, practitioners are discovering that reliability at scale requires treating model instructions less like suggestions and more like executable specifications. Skill files, as described here, are a pragmatic implementation of this principle — analogous in spirit to function signatures or interface contracts in traditional software development. They impose the kind of predictability that production systems require without sacrificing the model's ability to handle variation within each bounded stage.

The broader implication for the Claude Code and MCP ecosystem is that the infrastructure for agentic reliability is still being built by practitioners through trial and error rather than provided through established conventions. The developer's account of losing real money due to out-of-order tool calls underscores that the tooling ecosystem has not yet matured to the point where safe defaults or guardrails are built into the pipeline construction experience itself. As Anthropic continues developing Claude Code and the MCP standard gains wider adoption, the demand for native mechanisms — such as enforced execution ordering, stage-level permission scoping, or cost-aware tool gating — will likely grow, with community-developed patterns like skill files representing the interim solution bridging capability and production-grade reliability.

Read original article →