Financial Services

Modernizing Two Decades of Retirement Recordkeeping Logic with Claude Code

PCS Retirement is modernizing its data platform on Azure Databricks with v4c. When the program reached its hardest component, rearchitecting legacy SQL Server stored procedures without losing any of the financial business logic inside them, v4c built a Claude Code workflow that cut delivery time in half on the pilot procedure measured and produced converted workloads that ran up to 14 times faster.

‍The customer

PCS Retirement is a US retirement-plan recordkeeper. Its modernization program with v4c on Azure Databricks covers infrastructure as code, governance, ingestion and data-quality frameworks, reporting, and services-layer integration. Within that program, the SQL Server migration stands apart: roughly 1,400 stored procedures across multiple estates, carrying twenty years of recordkeeping logic that drives distributions, payroll, and ACH processing.

The challenge

These procedures were not simple to move. They relied on cursors, hand-built dynamic SQL, and linked-server OPENQUERY calls into Oracle/Relius and Salesforce. Some called utility scripts whose behavior could not be inferred from the T-SQL alone. And PCS needed more than a faithful port: a line-by-line translation would have carried the old performance limits into the new platform. The requirement was to rebuild procedural logic as set-based Spark transformations while proving the financial results came out identical.

At PCS's request, v4c started with some of the most difficult procedures in the estate, including OPENQUERY nested inside dynamic SQL, nested cursors used for string aggregation, and dead code paths, so the approach would be tested against real complexity rather than easy wins.

The solution

Three v4c engineers, working in Claude Code on PCS's Claude Team plan, built a three-stage pipeline of custom subagents:

  • Interpret. A Sonnet-based agent reads the extracted T-SQL and produces a structured manifest: business rules, branching, dependencies, reconstructed dynamic SQL, and a tier indicating how much scrutiny the procedure needs. Dead code is excluded, and anything ambiguous is flagged rather than guessed.
  • Convert. A Haiku-based agent turns the complete manifest into a single PySpark notebook in one pass, so the full structure of the procedure is preserved.
  • Review. A second Sonnet agent checks the notebook against the manifest, corrects what it can, and reports what it confirmed, what it fixed, and what still needs human judgment.

The manifest is the only structural input to the later stages, so all three agents work from one shared interpretation of the source. Routing interpretation and review to Sonnet and bulk conversion to Haiku kept usage within the Team plan's included limits.

Around the agents, v4c encoded PCS's conventions into a reusable tsql-to-pyspark skill, shared mappings, and project instructions: how to handle SCD Type 2 tables, how to route write-backs to external systems through staged and audited pushes, and a hard rule against inventing table or column names. Engineers run the full pipeline with a single /convert-proc command, or batch it across many procedures with schema-validated reports at every stage.

Every notebook was reviewed by a v4c practitioner before sign-off, then reconciled by PCS QA against the original SQL Server output inside PCS's own Databricks environment. Claude Code worked only from extracted procedure text and supporting scripts. It had no connection to production systems and saw no participant or production data.

Results

Across two two-week sprints, six pilot procedures were converted, reviewed, and accepted by PCS QA.

  • Faster delivery. For the procedure with a before-and-after comparison on record, a conversion that previously took three weeks of development plus a week of QA took one week of engineering plus a week of QA with the Claude Code workflow: half the elapsed time, and an estimated 130 engineer-hours reduced to about 50.
  • Faster execution. The converted payroll workflow ran in under 17 minutes in Databricks UAT, against two to four hours for the same chain and dataset on SQL Server, roughly 7 to 14 times faster. The gain comes from rewriting cursor and loop logic as set-based Spark transformations.
  • Verified correctness. PCS's reconciliation framework compared more than 650,000 rows across 58 tables for the main reporting procedure, with 100% row-hash matches, zero row-count deltas, and matching schemas and control totals throughout.

Scaling the approach

v4c handed the full pipeline to PCS, including the subagents, skill, mappings, and commands, with hands-on enablement for its engineers. Two PCS developers have since converted additional procedures themselves. The skills and patterns built for this pilot are now being scaled out to further transformations and are accelerating other Claude work across PCS.

Why it matters

Legacy financial logic is where modernization programs stall: the code is dense, the stakes are high, and faithful translation is not good enough. This pilot shows Claude Code taking on that work in a way that stays reviewable at every step, with explicit inputs, a shared interpretation, specialized model roles, and review artifacts, while acceptance stays with practitioners and customer QA. The result is a repeatable workflow that PCS owns and is extending.

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