Inside Clay's Agent Stack: Coding Harnesses, Model Routing, and GTM Scale
Clay Head of AI Jeff Barg explains why the company rebuilt its agent around coding sandboxes, how users split usage with Claude Code, and why model selection is being automated.

Go-to-market platform Clay has expanded from 50 to around 600 people following a $115 million funding round at a $7.1 billion valuation, but its internal approach to AI looks increasingly like developer tooling. According to Jeff Barg, Head of AI at Clay, customer usage is now split nearly 50/50 between Clay’s first-party agent and external developer harnesses such as Claude Code. Rather than locking users into a single interface, the company is building infrastructure intended to work wherever teams already operate.
Barg joined Clay through the acquisition of Avenue, an operations alerting startup he cofounded with five people. At the time, Clay was heavily focused on product-led growth across its spreadsheet-based interface. As customer workloads escalated, the technical architecture behind its automation underwent a fundamental rewrite.
Shifting from tool loops to coding agents
Clay’s initial autonomous system, called Sculptor, shipped in September 2025 on models from the Claude 3.5 Sonnet era. It operated as a traditional tool loop driven by a tuned system prompt. While effective at simple spreadsheet tasks like adding enrichment columns, it failed when asked to carry out multi-step operations or analyze enterprise tables containing millions of rows. Evaluators that merely checked which tools the model invoked failed to capture real-world execution errors.
Recognizing that language models excel when writing code, the team overhauled Sculptor into a sandboxed coding agent built on the Pi harness. The updated agent executes the Clay CLI inside a cloud sandbox and pulls context through a dedicated data layer called Audiences, which unifies records across CRMs and Gong.
Behind the scenes, Clay deliberately bypassed complex orchestration frameworks like Temporal or LangGraph. Instead, the team built its own execution pipeline using BullMQ to manage asynchronous job queues, backed by Postgres and ClickHouse for operational data and Snowflake for analytics. To maintain platform stability when enterprise customers trigger runs across tables of 50,000 rows, Clay integrated LangSmith for observability and implemented rate-limiting safeguards that can pause and resume tasks during provider outages.
Model routing, economics, and post-training thresholds
Running high-throughput qualification workloads has forced Clay to scrutinize model economics. According to Barg’s calculations, checking all 40 million companies in Clay’s database against an ideal customer profile requires roughly 1,500 tokens per entity—1,000 for a LinkedIn profile and 500 for the qualification criteria. Using dedicated classifiers like TypeSafe's Jev, scoring the entire database would cost approximately $1,500.
Because base qualification tasks—such as finding funding figures or verifying firmographics—have been reliably solved by standard models for over a year, Barg sees frontier models as best suited for deep research and complex orchestration.
Clay is also addressing friction in its interface. Many users dislike configuring manual model selectors because they do not track every newly released model. Clay is preparing an automatic router to assign models dynamically based on task complexity, reserving manual overrides for agencies and power users. Regarding model customization, Barg cautions against premature post-training, arguing that fine-tuning internal open-weight models to match top-tier performance only becomes financially practical once inference spend reaches between $10 million and $100 million.
What it means for developers
Clay’s trajectory provides concrete architectural lessons for engineers building production agent systems:
- Coding environments outperform rigid tool sets: Constrained function-calling loops struggle with state management and error recovery. Exposing a clean command-line interface (CLI) to an agent operating inside a secure sandbox provides superior flexibility for data manipulation.
- Design for external harnesses: Modern technical teams prefer their existing development setups. Clay’s own internal teams demanded a CLI because they operated primarily in Cursor and Codex. Exposing the underlying platform via APIs and MCP servers lets external agents drive workflows without forcing users into proprietary interfaces.
- Separate classification from orchestration: Straightforward lead filtering can be offloaded to low-cost classification models, saving expensive frontier models for orchestration and nuanced synthesis. For benchmarking different tiers of reasoning models against high-volume tasks, developers can try top AI models cheaply through one API at https://apixoai.online.
- Keep operational infrastructure simple: Proprietary agent engines can often be maintained reliably with standard queue systems like BullMQ, provided engineering teams implement robust fairness algorithms, tracing, and throttling to survive sudden inference spikes.
As models continue to improve, agentic workflows are shifting from passive chat forms toward automated execution engines. For software teams, the focus is pivoting away from fine-tuning niche models and toward architecting reliable environments where models can run code, catch failures, and inspect structured data.
Source: How Clay Builds GTM Agents — Jeff Barg, Head of AI — Latent Space. Written by the Apixo team from that report.
One key for Claude, GPT, GLM, DeepSeek and more. Pay per token with crypto.
Get your API key

