Revenue After a Contract Amendment With Claude

Summary
You need Subscription contracts with amendment fields, as CSV
Tested with Claude Sonnet 5.5, made-up data, 5 Nov 2026, two separate runs
Result 80 of 80 cells matched; 88 of 6,000 random cells differed, then 0
Contracts inA-12 fee 24,000.00term 1 Feb 2026 to 31 Jan 2027amended 1 Sep, 17,400.00 leftA-04 amended on its last dayClaudeRevenue outA-12 October 3,525.49A-12 to 31 Oct 20,876.98A-04 October 3,100.00A-04 to 31 Oct 23,000.00

How does revenue change after a contract amendment?

From amend_date, a contract's revenue is spread from amend_remaining_fee, the fee left to recognise.

A-12, for example, has a 24,000.00 fee and is amended on 1 Sep with 17,400.00 left. On 5 Nov 2026 we pasted five rules and one file of 40 contracts, eight of them amended, into Claude, and it wrote the script.

Which CSV columns does it use?

Columns the amendment rule uses
ColumnWhat the script does with it
fee, start_date, end_dateThe original rate: fee divided by the days of the term
amend_dateThe first day at the new rate
amend_remaining_feeWhat is left to recognise from amend_date to the end
contract_idRow key, named in the line errors

What plan does Claude give first?

Prompt 1: plan
I work in the accounting team of a software company. I want a small tool that works out our subscription revenue for October 2026, including contracts that were amended part way through the term.

I have one file, contracts.csv (contract_id, customer, start_date, end_date, fee, amend_date, amend_remaining_fee). fee is the subscription fee for the whole term. amend_date and amend_remaining_fee are filled only where a contract was amended.

Our policy:
1. Revenue is recognised by day over the term. The term runs from start_date to end_date, both days included.
2. Recognised to a date = fee times the days from start_date to that date, divided by the days in the term, rounded to the cent. October revenue is recognised to 31 Oct 2026 minus recognised to 30 Sep 2026.
3. An amendment changes the rate from amend_date. Before amend_date the contract keeps its original rate. From amend_date to end_date, amend_remaining_fee is what is left to recognise, spread by day over those days, both days included. Recognised to a date on or after amend_date = recognised to the day before amend_date at the original rate, plus the amended amount for the days from amend_date to that date, rounded to the cent.
4. Nothing is recognised before start_date or after end_date.
5. Stop, say which line is wrong, and write no output file if only one of amend_date and amend_remaining_fee is filled, if amend_date is not after start_date, if amend_date is after end_date, or if a date or an amount cannot be read.

Do not write code yet. Break the job into numbered steps. For each step say what could go wrong. Then list anything in the policy that is unclear.

Claude broke the job into eight steps and listed twelve unclear points. It spotted three amendments in our file that looked out of line before it wrote any code: A-04 and A-17 are amended on their last day, and A-29 has more left to recognise than the whole original fee.

Its rounding question: when the part before the amendment and the part after are added, is each rounded first, or only the sum?

It said the two can differ by a cent. A second run, started with no memory of the first, raised the same three contracts and the same question. We answered none of it.

What script does Claude write?

Prompt 2: build and run
Good. Use that plan. Write one Python script, standard library only, that reads the file and writes revenue_schedule.csv with one row per contract: contract_id, october_revenue, recognised_to_date (recognised to 31 Oct 2026). Use exact decimal arithmetic for money. Never change my file. Run it, then show me the totals of october_revenue and recognised_to_date, and the row for every contract that has an amend_date.

We gave the plan and then the build request to Claude Sonnet 5.5 (claude-sonnet-5-5), as two messages in Claude Code on 5 Nov 2026.

It wrote a 210 line script, ran it on all 40 contracts, and reported October revenue of 79,747.84 and 830,846.69 recognised to 31 Oct. The second run wrote a 160 line script and reported the same two totals. Every one of the 80 cells in both outputs agreed with our key.

How does the amendment rule work on real contracts?

The rule as we wrote it: Before amend_date the contract keeps its original rate.

From amend_date to end_date, amend_remaining_fee is what is left to recognise, spread by day over those days, both days included. All eight amended contracts, with the October revenue and the total recognised to 31 Oct that Claude's script wrote:

The eight amended contracts and their results
ContractFee and termAmendmentOctoberTo 31 Oct
A-1224,000.00, 1 Feb 2026 to 31 Jan 20271 Sep 2026, 17,400.00 left3,525.4920,876.98
A-1314,600.00, 10 Jun 2026 to 9 Jun 202731 Oct 2026, 9,000.00 left1,240.545,760.54
A-20109,500.00, 1 Nov 2025 to 31 Oct 20281 Oct 2026, 60,000.00 left2,440.9435,810.47
A-2918,250.00, 1 Apr 2026 to 31 Mar 202715 Oct 2026, 20,000.00 left2,723.8111,873.81
A-3836,500.00, 16 Jan 2026 to 15 Jan 202716 Aug 2026, 10,950.00 left2,218.6226,710.78
A-2624,000.00, 1 Feb 2026 to 31 Jan 202715 Nov 2026, 9,000.00 left2,038.3517,950.68
A-1712,000.00, 1 Jan to 31 Dec 202631 Dec 2026, 900.00 left1,019.189,994.52
A-0436,500.00, 16 Mar 2026 to 15 Mar 202715 Mar 2027, 250.00 left3,100.0023,000.00

A-26 is amended on 15 Nov, so its October is the plain old rate and the amendment has not started. A-13 is amended on 31 Oct: one day at 40.54 instead of 40.00 moves October by 54 cents.

A-17 has 900.00 left to recognise on its last day, 31 Dec, against about 33 a day before, and A-04 has 250.00 left for its last day. A-38 (16 Aug) and A-12 (1 Sep) start before October, and the script works October out from the fee, term dates and amend_remaining_fee.

Why did 88 of 6,000 cells differ by a cent?

Rule 3 ends "rounded to the cent" and does not say when. The first script added the unrounded parts and rounded the sum once. The second rounded the part before the amendment, added the amended part and rounded once, which gives the same cents as rounding each part.

On our 40 contracts the two methods give the same cents. We built 3,000 random contracts, two cells each (6,000 in all), 1,165 of them amended, and ran both scripts.

The second matched our reference everywhere. The first differed in 88 cells across 62 contracts, by a cent each time. We sent a third message to the first session:

Prompt 3: say when to round
On your rounding question: for an amended contract, round the part before amend_date to the cent, round the part from amend_date to the cent, then add the two. Change the script, run it, and tell me whether any figure in the file moved.

Claude changed the script and said no figure in the 40 contract file moved, which was true: all 80 cells still matched. We ran the 3,000 random contracts again.

The 88 differences became zero. Prompt 3 told Claude to round each part to the cent and then add the two, which is the reading our key uses. Rule 3 does not say which way to round, and no mistake was fixed.

What happens at the dates around the rule?

We built single contracts and checked the first script's row against a reference written from the same rules.

Amendment dates and amounts
What we sentWhat the script did
Amended on 30 Sep, 1 Oct, 31 Oct and 1 NovSame as the reference in all four
Amended the day after the start, and on the last dayThe last day matched. The day after the start differed by a cent in the first script, a rounding difference
Remaining fee of 0.00, and a remaining fee above the whole feeSame as the reference
Term ends 31 Oct, amended 30 OctSame as the reference
Amendment on a contract that ended before OctoberOctober 0.00, recognised to date as the reference

Of 18 single contract cases, 15 matched the reference, two differed by a cent through rounding, and one stopped on a negative remaining fee, which the policy does not mention.

What happens with bad data?

Bad data and the stop rule
What we sentWhat happened
Amendment on the start date, before it, or after the end dateAll stopped, naming the line, and no file was written
A date without an amount, or an amount without a dateStopped, line named, in both scripts
A date typed 15/08/2026, a fee of 12,000.00 with a comma, a blank fee, end before startStopped at the line
The same contract_id twice, or half-filled amendment fields on the second lineStopped, line named. The repeated id stop was Claude's own addition

All eleven bad files stopped before any output was written, in both scripts. Rule 5 named the amendment fields, the amendment dates and unreadable values. Claude added the stops on end before start, repeated ids and negative fees on its own.

What does a controller still review?

  • Is amend_date the effective date or the signing date?
  • Can amend_remaining_fee be larger than the original fee, or smaller than what was already recognised?
  • Can one contract be amended twice? Our file allows one amendment per row.

Questions about revenue after a contract amendment

What do you need to handle contract amendments with Claude?
Subscription contracts with amendment fields, as CSV. Ours had 40 contracts, eight of them amended.
How well did Claude handle contract amendments?
All 80 cells matched our key in both runs. On 3,000 random contracts the first script differed in 88 of 6,000 cells, by a cent each time, and in none after we said when to round.
When should the script round?
Rule 3 ends “rounded to the cent” and does not say when. We told Claude to round each part to the cent and then add the two, which is the reading our key uses.

Book a demo

Use the message box to tell us your ERP and the process you want to start with.

Request a demo