Financial Services

Rebuilding PCS Retirement’s Retention-Risk Scoring with Claude

Rebuilding PCS Retirement’s Retention-Risk Scoring with Claude

As part of PCS Retirement’s broader modernization on Azure Databricks, v4c used Claude Code to rebuild the scoring that flags retirement plans at risk of leaving. The new pipeline replaces a single all-in-one prompt with a governed workflow that calls Claude inside PCS’s own Databricks workspace and computes every score in code.

Customer Story

PCS Retirement, a US retirement plan recordkeeper serving more than 31,000 plans and the advisors who work with them, is modernizing its data architecture and platforms with v4c on Azure Databricks. Retention is a company priority, and relationship managers use a retention-risk score on each plan record in Salesforce to decide where to step in before a plan moves to another provider.

That score was produced by a Salesforce Agentforce prompt that read each plan’s recent case emails and returned a score with a written analysis. In a six-week engagement, PCS asked v4c to rebuild the scoring in Databricks, alongside the rest of its data platform. A v4c delivery lead used Claude Code to design and build the replacement from a written specification. The finished pipeline calls Claude Sonnet to read the emails and write the analysis, while the score itself is calculated in code.

Problem Statement

The existing approach placed the whole scoring procedure in one prompt: hard stops for terminated plans, points for plan flags, six service-category signals with a cap, a judgment on sentiment, and two multipliers. Because the model did the arithmetic, the cap and the order of steps were instructions rather than enforced rules, and the component scores and the written analysis did not always agree. The score was read out of the model’s prose, so a malformed reply could leave a plan with no score at all.

Running the prompt was also slow and costly. Each plan took around 30 seconds and plans ran one at a time, so a full pass over more than 8,500 live plans took about 70 hours, and long email threads could exceed processing limits and fail.

The input data added a further constraint. Case emails can contain personal information such as Social Security numbers, dates of birth and account numbers. Any replacement had to continue to remove or mask that information before a model read the text, keep every model call inside PCS’s Databricks environment, and produce scores PCS could compare plan by plan with the ones relationship managers already relied on.

Solution Built on Claude

Claude played two roles. Claude Code built the pipeline, working from a specification package committed to the repository: a migration plan, product requirement documents, table definitions, scoring configuration, synthetic test data with known answers, and a decision log. The rule throughout was to follow the existing Salesforce behavior unless there was a reason not to, and to record every departure, with its reason, in the same pull request as the code. The build ran in stages (scaffold, core logic and tests, data path, model steps,checks and calibration) with a review pause after each.

Inside the resulting Databricks job, Claude does only the work that requires reading. Raw Salesforce email stays in the bronze layer. Between bronze and silver, personal information is replaced with typed placeholders, and only that de-identified text reaches a model. One Claude call per plan reads every case and returns the matching service categories, each with a short supporting quote, plus a sentiment reading. Code computes the score from versioned weights. A second Claude call writes the analysis from the score breakdown and quoted evidence, never from the emails themselves, and a gold view publishes the result in the same fields Salesforce shows today.

The Claude Engineering Workflow

Claude Code builds from a specification, not a conversation

The kickoff prompt gave Claude Code a reading order for the package, the branch and data-handling rules, the existing library pattern to follow, and staged deliverables. Values that needed a business owner, such as a threshold or which of two source fields was authoritative, were kept on a confirmation list, and Claude Code was instructed to stop and ask rather than fill them in from general knowledge. A root CLAUDE.md recorded repository conventions that had previously cost time, such as development schema naming, current-row filters on historized tables, paused schedules and serverless settings, along with PCS’s data rules: no unredacted email text in chat, output or commits, and Databricks-hosted models only. A pipeline-level CLAUDE.md limited the tables a Claude Code session could read to redacted ones.

Claude reads the emails; code decides what they are worth

The design rule was simple: if a subject-matter expert could write a rule as an if-statement, it belongs in code; if it requires reading, it is a model call that returns a fact, and code decides what that fact is worth. Model answers are JSON, checked field by field against a schema. A plan whose answer fails is not published for that run and keeps its last good score, so a bad answer never overwrites a good one. The written analysis is checked as well: it is held back if it names a person who does not appear in the plan’s emails or states a tone that differs from the computed one. Every table is stamped with its run and with the prompt, scoring-configuration and library versions, so any score can be traced to its inputs and two runs compared row by row.

Tests, review and validation

Claude Code wrote more than 1,100 unit tests. They cover every scoring step and cap against a golden file, a rule-for-rule port of the Salesforce email-cleaning logic, each redaction recognizer including adversarial inputs, cut-off and malformed model answers, and an end-to-end run on synthetic data. Pull requests were reviewed by a repository-specific Claude Code review agent that sizes each review by what the change touches and applies adversarial testing to any change in redaction.

Validation compared the pipeline’s scores with the existing scores on a sample of plans drawn evenly across score bands, using production data as it stood when each existing score was produced. For every plan more than 25 points apart, Claude read the de-identified emails, the pipeline’s reading and the existing written analysis against the scoring rules, and classified the cause of the difference. The validation tables store scores, step results and review verdicts, but no email text, quotes or written analyses.

Refining the Workflow Through the Build

1. One call per plan. The first design used separate per-case classification and per-plan sentiment calls. v4c moved to a single call per plan over the same transcript the existing process reads, which matched how a plan had been assessed before and reduced cost. The change was recorded as a decision, and each output still lands in its own table.

  1. Rules the prompt left implicit. The highest existing scores came mostly from exit wording in the emails, which no scoring category covered. v4c added an explicit plan-exit category that sets a plan’s score to 100 only when a move away is decided or complete, and excludes threats, requests for proposal, and advisor or administrator changes. Sentiment, which the original prompt left unweighted, became a proportional adjustment whose two constants were fitted on half of the validation sample and measured on the other half.
  1. Redaction tested on real email. Before real data reached a model, the pipeline ran on synthetic emails with known answers. Checks on de-identified real email then widened what the redaction covers, and a residual scan stops the run if anything that should have been masked gets through.
  1. Holding to the written rules. Reviewing the largest differences plan by plan showed where the two approaches read the rules differently, such as adding weight for tone on neutral threads or treating an employee departure as a plan exit. With PCS, v4c kept the pipeline to the written scoring rules and corrected the pipeline’s own misreadings.

Outcomes

The pipeline was built, validated and handed over within the six-week engagement. Run-time and cost figures below are projections for a full scoring run, based on the measured pace and billed usage of the final validation run.

Run time | about 85% shorter, from roughly 70 hours to about 11

Cost | more than 50% lower per full scoring run

Validation | all seven acceptance criteria met across ~900 plans

Run time and cost. The previous process scored plans one at a time at around 30 seconds each. At the pace measured in validation, the pipeline averages under five seconds per plan, so a full run over the more than 8,500 eligible plans finishes in about 11 hours instead of running for nearly three days. Usage billed for the validation run, scaled to the full plan count, puts a full run at less than half the cost of the previous approach, and a daily run that scores only new plans costs a small fraction of that.

Agreement. On held-out plans, the pipeline’s scores stayed within the agreed average difference of the existing scores, and more than 80% of the plans previously scored at the highest risk were scored the same way. Agreement was closest in the lower bands. In the middle bands the pipeline scores lower, because it applies the written steps rather than adding unstated weight for tone. The comparison measures agreement with the existing scores, not whether either score predicts a plan leaving; defining and tracking that outcome is PCS’s next step.

Explainability. Every published score now comes with its step-by-step breakdown, the case evidence behind it and the versions that produced it, so a relationship manager or engineer can see exactly why a plan scored as it did.

The job ships paused in every environment, so nothing runs until PCS switches it on. Promotion to production, writing scores back to Salesforce, and the period of running alongside the existing scoring are PCS decisions that follow the handover.

Enabling PCS to Use Claude Code

v4c handed over a runbook, a handoff guide and a developer guide, with the specification package, decision log and both CLAUDE.md files kept in the repository next to the code. PCS’s technology team reviewed the specifications and architecture before handover. v4c then led a session for PCS’s Databricks engineering team on building pipelines with Claude Code, using the retention-risk build as the worked example. It covered a four-phase method with a gate before each phase, the rule for what belongs in code and what belongs in a model call, and seven guardrails for Claude Code in PCS’s data-platform repository, such as working only on feature branches, shipping new jobs paused, and using synthetic data until sign-off. PCS’s engineers now maintain the library, the CLAUDE.md files, the review agent and the decision log.

Why This Claude Engagement Matters

“Service is central to how PCS works with plan sponsors and their advisors, and this score helps our relationship managers recognize where additional focus is required” said Christopher Mericle, Vice President, Enterprise Data at PCS Retirement. “Working with v4c, we rebuilt it on our own platform and under our own controls, giving us the ability to scale with our business and ready to use Claude on what we build next.”

The engagement shows Claude in two roles on one problem: Claude Code as the build tool working from a reviewable specification, and Claude as a narrow, checked step inside a governed data pipeline. Keeping the model to reading and writing, and putting the arithmetic in code, made every score explainable and let PCS measure the change plan by plan before deciding to switch.

Let’s Get Started
Ready to transform your data journey? v4c.ai is here to help. Connect with us today to learn how we can empower your teams with the tools, technology, and expertise to turn data into results.
Get Started