Office hours: Build your self-driving GTM engine·Oct 29, 9:00am PT, onlineRegister→
Cargo
  • PrimitivesData ModelsYour companies, contacts and deals, merged from every sourceContextWhat your team knows, as files every agent readsTerritoriesWho sells where, defined onceMailboxesMailboxes in your reps' names, warmed up and kept under limitsToolsThe actions your agents, plays and reps callAgentsAI that researches, decides and writes, reading your contextPlaysWorkflows that run on a trigger or a schedule, with retriesAppsInternal apps for your reps, hosted on Cargo
    Add-onsChrome ExtensionSell faster, right in your browserButtonTrigger AI agents inside your CRMFormTurn any tool into an embeddable formSlackTag Cargo in Slack. It does the GTM workGitHubPlan on every pull request, deploy on merge
    MoreProjectsDefine your entire GTM in codeCLIUse Cargo from your terminalMCPUse Cargo from Claude and ChatGPTDeveloper resourcesCargo API docs, OpenAPI spec, auth docs, webhooks, MCP serverAPI ReferenceExplore the Cargo APIDocumentationLearn how to use CargoIntegrationsConnected to your entire GTM stack
  • VeriffHow Veriff replaced MuleSoft with Cargo under NetSuite, Stripe and SalesforceAugmentHow Augment Code routes developer sign-ups to reps in under an hourWeights & BiasesHow Weights & Biases ships a new purchase signal in 2 days on CargoSee all
  • Pricing
  • Cookbooks
  • Blog
Sign in
Blog

Run a Monthly Win-Loss Review From Your CRM's Closed Deals

16 Oct6min read
AurelienAurelien

To run a win-loss review every month without a spreadsheet, extract your CRM’s deals, accounts and contacts whole, run the same fixed SQL over the closed ones each month (won versus lost by industry, size and country, plus the lost reasons), and land the findings in your go-to-market repository as one pull request a human merges. The win-loss review cookbook deploys that as one Claude Code harness agent on a monthly cron, three CRM models and a five-line Slack digest.

The problem: what the CRM knows about who buys and who does not ends up in a quarterly deck nobody reopens, while the ICP every scoring and outbound agent reads stays whatever someone wrote a year ago. This puts the evidence where those agents read, with every count next to its denominator.

How it works, end to end #

  1. The platform extracts the CRM into three models. crm_deals, crm_accounts and crm_contacts: every record and every column, refreshed hourly, with no filter in the model config. The queries do the narrowing.
  2. On the 1st of the month at 06:00 UTC, the agent runs the audit. A fixed set of named queries, run with cargo-ai storage query execute: counts by pipeline, lost reasons, contacts on deals, won versus lost by industry, by size band and by country, titles at won accounts, and the deals closed since the last run. The agent is told to run those and no other SQL, so one month is comparable to the next. No query selects a deal amount.
  3. It states two hygiene findings first. The lost-reason fill rate (“lost reason on 11 of 14”) and the deal-to-contact rate. Under half on lost reasons, and it writes no objection files that month and says why.
  4. It picks a mode from the won count. With 20 or more closed-won deals in the 365-day window it is in verify mode and states what won versus lost shows. Below that, every finding is written with confidence: hypothesis and the pull request says how many wins would make it an analysis.
  5. It writes, then appends. The first pass verifies icp/ against the deals and names a disqualifier (a profile that looks like a fit and loses), adds dated insight/ files, objection/ files from recurring lost reasons, and one client/ file per closed-won account. Every month after, it only adds files: personas are never edited, and the ICP only on the first pass. A change the deals suggest is a proposal in the pull request body, with the deal ids.
  6. It records the run, opens one pull request and posts once. outputs/<date>-win-loss-review/README.md holds each query’s result, so every [R: <query>] tag in the context files points to something a reader can check. A month with no newly closed deal opens no pull request. After a human merges, the next cargo-ai project deploy syncs context/ into the workspace context that every other Cargo agent reads.

The Slack digest is five lines and its numbers come only from the queries:

text
:bar_chart: *Win-loss review Oct 2026*: 23 deals closed
Won 9, lost 14 · lost reason on 11 of 14 · contacts on 19 of 23
Learned: a RevOps title at 6 of 9 won accounts · 8 of 14 losses were under 50 employees
Proposed: add "under 50 employees" as an ICP disqualifier (8 of 14 losses, 0 of 9 wins)
PR: https://github.com/<you>/<repo>/pull/<n>

(Illustrative, fictional records.)

Run it #

shellscript
npm install -g @cargo-ai/cli
cargo-ai login --email you@company.com      # emailed code, no browser, 100 free credits, no card

cargo-ai project cookbook view win-loss-review
cargo-ai project init my-gtm --cookbook win-loss-review && cd my-gtm && npm install
# already have a Cargo project? from its root:
cargo-ai project add cookbook/win-loss-review

Before deploying, set the Slack channel id and languageModel on the agent, and, if your portal records the lost reason on a custom property, set LOST_REASON_COLUMN in infra/agents/win-loss-analyst.prompt.ts (HubSpot’s standard closed_lost_reason ships). cargo-ai project plan should show one agent, three models, the bound connectors and two folders. After cargo-ai project deploy and the first sync, run the pipelines query by hand and confirm both won and lost are non-zero. Then start the first pass yourself:

shellscript
cargo-ai ai message create --agent-uuid <uuid> \
  --parts '[{"type":"text","text":"Run the win-loss review first pass. Follow your system prompt exactly and open one pull request."}]'

The monthly cron takes it from there.

What it needs and what it costs #

NeedsWhy
An authorized CRM connector (HubSpot in the example)The only source; Salesforce and Attio adapt the models and queries
An authorized GitHub connectorThe agent’s only write path: a branch and a pull request
An authorized Anthropic connectorThe harness runs on Cargo’s model proxy, billed to it
An authorized Slack connectorThe digest, through postMessage with the channel locked
A repository with context/ and outputs/The shape cargo-ai project init scaffolds

Cost, from the code: the HubSpot fetchRecords extractor and Slack’s postMessage carry no Cargo credit price in their definitions, and the SQL queries are not billed actions. The recurring cost is model usage for one harness run a month, scaling with how many deals closed since the last one, plus the first pass over the whole window. Nothing in the cookbook needs a credential in .env.

What it will not do #

  • It does not read calls, an inbox, a website or Slack. The CRM is its only source; keeping company and competitor context fresh from the web is a separate cookbook, so a page and a deal never end up at one confidence level in one file.
  • It does not write to the CRM, select a deal amount, contact a customer or merge its own pull request.
  • It does not write the workspace context directly. The pull request is the gate; the agent has no context capability.
  • It does not edit a persona, or the ICP after the first pass.

One status note from the cookbook itself: it is marked to-be-approved, meaning it has not yet been deploy-verified against a live workspace. Treat its acceptance list as the test and read the plan before you deploy.

Related: the verified ICP is what account scoring reads, and the closed-won accounts feed expansion signals before renewal.

Frequently asked questions #

The cookbook draws the line at 20 closed-won deals in a 365-day window. At or above it, won versus lost is treated as an analysis. Below it, the same files are written with confidence hypothesis and every count carries its denominator. Both numbers are constants in the prompt file you can change.

The agent reports the fill rate on every run, for example 4 of 9, and writes no objection files when it is under half. A rate of zero with lost deals in the window usually means the reason lives on a custom property, which you name in LOST_REASON_COLUMN.

The checked example is HubSpot. Salesforce and Attio change the connector, the three models’ config and the queries together, following the CRM audit reference in the cookbook, and the first pass should be checked by eye.

~/run-it-on-cargo/

Build this workflow instead of reading about it.

Cargo is the GTM infrastructure your coding agent builds on: enrichment, scoring, routing and outreach, defined in code and run in production.

Start building
AurelienAurelienOct 16, 2026
On this page
  • How it works, end to end
  • Run it
  • What it needs and what it costs
  • What it will not do
  • Frequently asked questions

Stay Informed with our
weekly Newsletter

Related articlesSee all articles
GTM Engineering
CI/CD for Go-to-Market: What It Means and How to Set It Up

CI/CD for GTM means every change to enrichment, scoring, routing and sequences ships as a pull request that is planned, checked, approved, deployed on merge, logged and reversible. What each software CI/CD step becomes for go-to-market, and how to set it up on Cargo.

AurelienAurelien·Nov 3, 2026
GTM Engineering
Require Approval Before a High-Impact Go-to-Market Change Goes Live

How Cargo holds a go-to-market pull request that would send or spend more than set limits until a reviewer adds the cargo:approve-impact label: the thresholds, what counts as high impact, who should approve, and what the gate does not catch.

AurelienAurelien·Nov 3, 2026
GTM Engineering
Test a Go-to-Market Change Before It Reaches Production

How to test a change to enrichment, scoring, routing or outreach before it runs on every lead: check the project offline, dry run an action, read the plan on the pull request, ship the play switched off and pilot it on 50 records, evaluate agents, and use a second workspace as staging.

AurelienAurelien·Nov 3, 2026

Build the self-driving GTM engine

Your coding agents build it on Cargo.Or our team builds, operates and improves it with you.

Start building
Cargo
Backed byY CombinatorSOC 2 Type IICertified
LinkedinX

Product

Data ModelsContextTerritoriesMailboxesToolsAI AgentsPlaysAppsIntegrationsPricing

Add-ons

Chrome extensionButtonFormSlackGitHub

Build

DocsDeveloper resourcesCargo API docsCargo OpenAPI specCargo auth docsCargo webhooksCargo MCP serverProjectsClaude CodeCodexCursorAll coding agents

Resources

ReportsBlogCustomer storiesCookbooksEnrichmentRoutingSignalsScoringCRM hygieneAd audiencesGTM skillsGTM EngineeringGlossaryCompareCargo x ClayCargo x WorkatoCargo x n8nCargo x DeeplineCargo x DefaultCargo x LeanDataCargo x UnifyCargo x ValleyCargo x Gojiberry

Company

ManifestoCommunityEventsJobsPartners DirectoryPartner Program

Legal

SecurityTerms of servicePrivacy PolicyRefundsDPASupport
© 2026 Cargo
 ////////    ///////    ////////     ////////    ///////
///         ///   ///   ///   ///   ///         ///   ///
///         ///   ///   ///   ///   ///         ///   ///
///         /////////   ////////    ///  ////   ///   ///
///         ///   ///   /// ///     ///   ///   ///   ///
///         ///   ///   ///  ///    ///   ///   ///   ///
 ////////   ///   ///   ///   ///    ///////     ///////

$ npm install -g @cargo-ai/cli