Architecture diagram on a light grid showing three inputs (106/867/IBKR documents, year rules, and Harbor sandbox) feeding a teal Tax Skill block containing taxcalc.py and a --review gate, producing a verified draft that improves from 0.43 to 0.93 through a coral Harbor eval loop

Teaching Claude to Draft My Israeli Tax Return, Measured with Harbor ​

Every year I hand an accountant the same pile of documents: two Form 106s from employers, a section 102 trustee report for RSUs, a bank Form 867, an Interactive Brokers statement, a US 1042-S, plus pension and life-insurance certificates. Weeks later I get back a Form 1301 and an expected assessment (השומה הצפויה) with one number that matters: refund or balance due.

I wanted to answer two questions with hard measurements instead of spot checks. How close can Claude Code get on its own? And how much does a skill (instructions plus small scripts) actually move accuracy across models and tax years?

The goal is a verifiable draft I can compare against an accountant's filing, with every figure linked back to a source file. It does not replace the accountant.

A deterministic calculator beat 1,288 lines of tax prose, and Haiku with the skill beat Opus without it ​

I built an evaluation suite in Harbor (0.27) over two datasets: my three filed assessments for 2023, 2024, and 2025 (kept locally, never committed, reported here only as scores and error deltas) and 17 synthetic taxpayer cases using fake documents in matching formats. Every taxpayer name, document, and financial amount published in this article and in the repository is made up. Every arm ran Claude Code 2.1 on AWS Bedrock across Haiku 5.5, Sonnet 5.5, and Opus 5.5.

  • Prose alone changed nothing. A pre-existing draft (v0-draft) spanning 1,288 lines across eight Markdown files scored 0.43 on 2025, tying vanilla Sonnet (also 0.43, both missing the final balance by about ₪3,600).
  • Moving arithmetic into a Python script (taxcalc.py, 136 lines in v1 and 163 lines by v5) drove the jump. Sonnet climbed from 0.48 to 0.93 on filed returns (5 of 6 balances within ₪100) at $0.52 per attempt, and every model reached 1.00 (17 of 17 balances) on the final v5 suite.
  • The skill outweighed model size. Haiku 5.5 with v3 scored 0.87 on filed returns (3 of 6 balances) and 1.00 on v5 synthetic cases, beating Opus 5.5 without instructions (0.60 filed, 0.58 synthetic).
  • Process steps written in Markdown were skipped. Marking a reviewer subagent "mandatory" in SKILL.md triggered it in just 7 of 25 Sonnet trials in v2 and 9 of 22 in v3. Enforcing it inside taxcalc.py via --review pushed adherence to 22 of 22 in v4 and 51 of 51 across all three models in v5.

Grouped bar chart comparing Claude Haiku 5.5, Sonnet 5.5, and Opus 5.5 with no skill versus the tax skill on real 2023-2025 assessments and the 17-case synthetic suite: Haiku with the skill scores 0.87 real and 1.00 synthetic, beating Opus without the skill at 0.60 real and 0.58 synthetic

That lines up with larger ablation studies in harness engineering: structured tools and deterministic scripts move reliability far more than longer prompts.

How the Harbor evaluation harness keeps answers away from the agent ​

Harbor executes an agent inside Docker against a task folder and grades its artifacts with a separate verifier. Keeping expected outputs unreachable during execution mirrors our agent improvement loop at Komodor, shrunk to one laptop repository.

Pipeline diagram of the Harbor evaluation harness: 17 synthetic cases, 3 local real tax years, and a frozen skill snapshot enter a Docker container where Claude Code reads /app/docs, runs taxcalc.py and a reviewer subagent, and writes /app/output/result.json; only after the container exits does Harbor upload tests/answer.json and run grade.py and score.py

Each piece of the setup maps to one Harbor primitive:

Harbor primitiveRole here
Task (task.toml, instruction.md, Dockerfile)One taxpayer-year with documents baked into /app/docs, asking for 11 integer ILS fields in /app/output/result.json
Isolation (environment_mode = "shared")tests/answer.json and tests/grade.py upload only after the container exits, keeping the oracle invisible
Verifier (tests/grade.py)Checks each field within ₪100 or 0.5% (strict ±₪100 on balance), weighting balance ×3 and tax_due ×2
Arms (--skill <dir>)Identical tasks run vanilla or with a frozen snapshot under skill-versions/ (v0-draft, v1, v3, v4, v5)
Attempts (-k)Filed years repeat 2 to 3 times per arm to expose variance instead of trusting one lucky pass
Artifacts (--artifact /app/output)Exports notes.md (every extracted number with its source) for root-cause debugging
Sanity agents (-a nop, -a oracle)nop proves missing output scores 0.00, while oracle copies the key and confirms all 17 tasks score 1.00 before spending tokens
Job logs (tools/score.py)Summarizes reward, strict balance rate, cost, duration, and reviewer invocation rate parsed from claude-code.txt

The 11 graded fields (salary_income, capital_income_total, total_income, regular_rate_tax, special_rate_tax, surtax, gross_tax, credits_total, tax_due, payments_total, balance) sum to weight 14. Missing balance alone drops a perfect run from 1.00 to 0.79 (11/14).

Real filed returns caught rules that synthetic cases never could ​

Ground truth comes from two sets serving opposite jobs. First are my filed assessments (השומה הצפויה) and detail appendices (נספח פרוטים) for 2023, 2024, and 2025. Before running any LLM against them, I calibrated taxcalc.py until it matched every field across all three years within ₪2.

Three rules only surfaced because actual assessment numbers refused to agree. Foreign tax paid is capped against Israeli tax on all remaining foreign income pooled together, never item by item. Under section 29, capital losses incurred abroad must offset foreign gains first and then foreign dividends or interest before shielding Israeli gains. On my 2024 filing, a small foreign loss wiped out foreign dividends and eliminated their US-withholding credit, which explained a persistent ₪200 gap until taxcalc.py encoded that sequence.

The third surprise was missing input, not law. My detail appendix listed "ניכוי שכ"ט רו"ח" (the accountant's fee, VAT included) deducted from salary. That invoice was absent from the folder I handed Claude, creating a ₪1,404 salary gap in 2024 and ₪1,416 in 2025. No prompt extracts a bill missing from /app/docs, so interactive use now asks the user for it.

The second set holds 17 synthetic taxpayers under cases/src/<year>-<nn>-<scenario> (from 2023-13-year-2023-rules through 2026-17-year-2026-rules) generated by tools/make_cases.py with fake Hebrew and English forms mirroring live layouts: 106 with field codes, trustee 106, bank 867, IBKR CSV, FX note, donation receipts, life-insurance certificate, and accountant invoice. Difficulty ramps from one employer to mid-year job switches, crossing the surtax ceiling, capital income alone over ₪721,560, US withholding, carried-forward losses, duplicate Copy of 106 traps, RSU equity already folded into payroll's 106, and 2026 bracket changes.

Because make_cases.py derives synthetic keys using taxcalc.py, those 17 fixtures test document parsing and field mapping. They cannot detect a legal bug shared by calculator and instructions. Only filed assessments catch law errors.

From 0.48 to 0.93 across five skill versions ​

Each iteration on Sonnet 5.5 was evaluated against the same filed years and synthetic set (v0-draft, v1, v3, v4, and v5 are preserved as frozen snapshots under skill-versions/).

VersionChangeLinesSynthetic reward · bal ±₪100Filed 2023-25 reward · bal ±₪100Reviewer ran
no skillvanilla Claude Code00.52 · 0/160.48 · 0/6—
v0-draftpre-existing prose tax guide (8 Markdown files)1,288—0.43 · 0/1 (2025 only)—
v1moved arithmetic to taxcalc.py + field map + year table2731.00 · 13/130.86 · 1/3—
v2added fee deduction + prose "mandatory" reviewer—1.00 · 16/160.81 · 4/97/25 (28%)
v3added section 29 foreign-loss ordering + FTC after offsets2951.00 · 16/160.93 · 5/69/22 (41%)
v4taxcalc.py stamps DRAFT until --review review.md is passed3031.00 · 16/160.92 · 4/622/22 (100%)
v5added 2026 widened brackets + per-year reference files3321.00 · 17/17—17/17 (100%)

Two-panel chart showing Sonnet 5.5 from no skill and v0 draft through v4: top panel tracks mean reward on real 2023-25 returns climbing from 0.48 baseline to 0.93 while synthetic hits 1.00 from v1 onward; bottom panel shows reviewer adherence jumping from 28% in v2 and 41% in v3 to 100% (22 of 22) in v4

Reading vanilla failure logs turned up a surprise: messy PDFs were not the problem. Across all three filed years, vanilla Claude read Form 106s, trustee reports, bank 867s, and IBKR statements accurately, even Hebrew PDFs whose extracted text came out reversed and garbled.

Then it lost thousands of shekels inside the rules. Without instructions, Claude credited 35% of all employee pension deposits or stacked the pension fund's annual certificate on top of the 106. Section 45a caps the eligible base at 7% of a ceiling (₪116,400 in 2025), limiting the credit to ₪2,852. That single mistake moved balances by ~₪3,000, causing credits_total to fail on all 16 Sonnet and Haiku synthetic vanilla runs.

Surtax broke the same way. Starting in 2025, an extra 2% surtax applies to capital income above ₪721,560, tested on capital income alone (Tax Authority instruction 5/2025). My salary crossed ₪721,560 while my capital income stayed below it, so the assessment charged 3%. Both vanilla Sonnet and the 1,288-line v0-draft charged 5%, inflating surtax by several thousand shekels.

Across the 16 synthetic baselines, median absolute balance error hit ₪4,390 for Haiku, ₪5,816 for Sonnet, and ₪1,452 for Opus. On filed years without instructions, failing benchmark attempts missed balances by ₪440 up to ~₪78,500 (when a 2023 run double-counted an income source without matching withholding), and only 1 of 18 benchmark trials (an Opus 2023 run at -₪100) cleared the ±₪100 bar.

Shrinking the package from 1,288 lines of prose to 273 lines in v1 (332 by v5) changed the model's job. Rather than simulating progressive brackets in tokens, Claude normalizes documents into facts.json, discards duplicates (Copy of 106, pension certificates repeating payroll, RSU sheets already inside employer 106), and invokes python3 scripts/taxcalc.py facts.json.

Moving the reviewer gate from prose into the script took adherence from 28% to 100% ​

Step 5 in v2 instructed Claude to spawn an independent reviewer subagent through the Agent/Task tool, giving it only /app/docs and facts.json (never expected totals) to check every line item against its source file. SKILL.md called this step mandatory.

Harbor records the complete Claude Code stream in agent/claude-code.txt. Counting Agent and Task tool calls revealed that Sonnet skipped the review most of the time: 7 of 25 trials in v2 (4/16 synthetic, 3/9 filed) and 9 of 22 in v3 (6/16 synthetic, 3/6 filed). Haiku and Opus followed the Markdown instruction in 22 of 22 v3 trials while Sonnet cut corners.

In v4, I enforced the workflow inside taxcalc.py:

python
if not (a.review and Path(a.review).is_file() and Path(a.review).stat().st_size > 0):
    out["status"] = "DRAFT - not reviewed"
    print(
        "NOT FINAL: run the independent reviewer subagent (SKILL.md step 5), "
        "save its reply to review.md, apply backed corrections, "
        "then rerun with --review review.md",
        file=sys.stderr,
    )
else:
    out["status"] = "reviewed"

Animated flow diagram showing the --review gate in taxcalc.py: on the first call without --review, the script outputs DRAFT - not reviewed and routes the agent to spawn an independent reviewer subagent that checks /app/docs against facts.json; rerunning with --review review.md emits status: reviewed

Putting the check into a tool the agent already had to invoke raised Sonnet adherence from 41% to 100% (22 of 22 in v4), and v5 held 100% across Haiku, Sonnet, and Opus (51 of 51). That guarantee was not free: forcing the subagent pass on every filed return raised Sonnet's average cost from $0.52 to $0.75 (+44%) and duration from 2.5 to 3.8 minutes (+52%), and synthetic runs moved from $0.07 / 0.4 min to $0.11 / 0.6 min.

Reward barely moved between v3 (0.93) and v4 (0.92). The reviewer catches bad extractions when they appear, whereas remaining filed-year gaps were +₪132 and +₪135 rounding residues on 2025 balances plus a ₪270 FX-rate difference on 2024 foreign capital income. Measuring process adherence alongside accuracy still paid off: without auditing transcripts, I would have believed Sonnet was running step 5 all along.

The skill matters more than the model, including on 2026 rules ​

To test whether frontier capability alone solves tax preparation, I benchmarked Haiku 5.5, Sonnet 5.5, and Opus 5.5 on AWS Bedrock with and without v3 across 16 synthetic tasks and 3 filed years (k=2, 6 filed trials per arm).

ModelArmSynthetic (16): reward · bal ±₪100Filed (6 trials): reward · bal ±₪100Avg cost $ (filed)Avg min (filed)
Haiku 5.5no skill0.53 · 1/160.35 · 0/6$0.508.6
Haiku 5.5skill v30.97 · 15/160.87 · 3/6$0.7812.7
Sonnet 5.5no skill0.52 · 0/160.48 · 0/6$0.623.7
Sonnet 5.5skill v31.00 · 16/160.93 · 5/6$0.522.5
Opus 5.5no skill0.58 · 0/160.60 · 1/6$1.414.6
Opus 5.5skill v30.83* · 9/160.83 · 2/6$2.136.3

*Opus's 0.83 on synthetic v3 was my fixture bug, explained below.

Even when a v3 or v4 attempt missed the strict ±₪100 bar on filed years, the balance residual stayed small:

  • Sonnet v3: 5 of 6 within ₪100, lone miss of -₪195 on one 2023 attempt.
  • Sonnet v4: 4 of 6 within ₪100, both 2025 attempts off by +₪132 and +₪135.
  • Opus v3: both 2023 attempts passed all 11 fields (both -₪13 on balance), 2024 off by -₪129 and -₪134, 2025 off by +₪108 and +₪126.
  • Haiku v3: both 2023 within ₪100, 2024 passed all 11 fields once (-₪96 on balance) and missed by -₪149 once, 2025 off by +₪129 and +₪190.

Sonnet 5.5 plus v3 was both the sharpest and the cheapest on filed returns ($0.52 and 2.5 minutes, beating vanilla Sonnet on cost and latency because taxcalc.py eliminated sprawling hand-calculation turns).

Testing a law change: 2026 brackets in skill v5 ​

Tax thresholds shift annually. In 2024 brackets and the surtax ceiling tracked CPI (₪698,280 to ₪721,560, credit point ₪2,820 to ₪2,904). In 2025 brackets froze through 2027 while the 2% capital surtax took effect. For 2026, the Arrangements Law widened the 20% bracket to ₪228,000 and the 31% bracket to ₪301,200, trimming tax by roughly ₪5,039 on salaries above ₪301,200.

For v5, I split references/year-rules.md into per-year tables (references/years/2023.md through 2026.md), added 2026 to taxcalc.py, fixed the synthetic persona, and added 2026-17-year-2026-rules. Rerunning all three models on the 17-task suite alongside vanilla runs on the 2026 task gave a clean split:

ModelSkill v5 (17 cases): reward · bal ±₪100 · reviewerVanilla on 2026 case (1 case)Avg cost $ / case (v5)Avg min / case (v5)
Haiku 5.51.00 · 17/17 · 17/170.36 (0/1 bal, off by +₪4,894)$0.011.6
Sonnet 5.51.00 · 17/17 · 17/170.36 (0/1 bal, off by -₪41,456)$0.110.8
Opus 5.51.00 · 17/17 · 17/170.50 (0/1 bal, off by +₪3,134)$0.271.1

Without v5, no model handled the widened 2026 brackets or surtax rules cleanly. With v5, all three landed 17 of 17 balances and invoked the reviewer every time.

Test-data bugs and Harbor sharp edges ​

An eval harness catches bugs in your fixtures and scripts just as quickly as bugs in the agent.

The funniest surprise was Opus scoring 0.83 on synthetic v3, failing 7 of 16 cases by the same 0.5 credit point (₪1,452 in 2024-2025, ₪1,410 in 2023). Opening its notes.md explained everything: I had named the fictional taxpayer "Dana" (usually a female Hebrew name) while hardcoding 2.25 resident credit points into the oracle. Under Israeli law, women receive an extra 0.5 credit point. Haiku and Sonnet blindly copied 2.25 from Form 106. Opus noticed the name, applied the statute, and got docked by my broken fixture. Renaming the persona to "Dani Levi" and declaring gender explicitly in taxpayer_info.txt sent Opus straight to 17 of 17 (1.00). Audit fixtures like production code.

Harbor itself delivered solid isolation (--skill, -a oracle, -a nop, -k, and extra reward.json columns all saved engineering time), though five operational snags surfaced during runs:

  • AWS SSO credentials in Docker: passing AWS_PROFILE into a container fails because the container lacks your local SSO cache. tools/run.sh exports temporary keys via aws configure export-credentials --format env and unsets AWS_PROFILE.
  • Image rebuild bottlenecks: Harbor builds one image per task, so regenerating fixtures invalidates every build cache and parallel jobs rebuild identical images concurrently. Pre-installing nodejs, npm, and procps in the task Dockerfile shaved roughly two minutes of setup off each trial.
  • Live test-directory reads: Harbor loads tests/ from the host path at verification time. Regenerating cases/tasks mid-job can grade older runs against mutated answers, so freeze task directories while jobs run.
  • Subagent cost reporting: dollar figures in result.json come from Claude Code's internal accounting and may under-count subagent tokens. Treat costs as relative signals across arms, not exact AWS invoices.
  • Ad-hoc subsets: -p <dir> executes every task inside a directory, making symlink folders (private/realset, private/case2026) the cleanest way to slice subsets without duplicating data.

What this benchmark can't prove ​

  • Narrow taxpayer profile: three filed years from one salaried individual (RSUs, Israeli bank 867, IBKR, pension, life insurance, donations, accountant fee). Self-employment, rental income, joint spouse filing, and extra credit-point entitlements are out of scope.
  • Shared calculator bias: synthetic cases compute answers using taxcalc.py, so 17 of 17 proves clean extraction and routing rather than legal validity.
  • Unfiled 2026 rules: no 2026 assessment exists yet, and the 2026 brackets come from Knesset and CPA publications rather than a finalized Tax Authority booklet.
  • Residual ₪100-200 balance drift: real assessments still show small balance rounding residues on 2025 (+₪108 to +₪190) and ~₪270 variance on 2024 foreign capital income (about ₪70 to ₪134 on balance) when trades convert at a slightly different Bank of Israel FX rate.
  • Accountant review stays mandatory: every notes file starts by stating that the output is a draft for you and your accountant to verify together, never a filed return.

Sources and how to reproduce ​

Everything except my private 2023-2025 assessments lives in niradler/harbor-tax (requires Docker, Harbor 0.27+, Python 3.12, and either a Claude OAuth token or AWS Bedrock access):

bash
python3 skill/israel-annual-tax/scripts/taxcalc.py --self-check
python3 tools/grade.py --self-check
python3 tools/make_cases.py
harbor run -p cases/tasks -a oracle -y
tools/run.sh --tasks cases/tasks --arm none --name vanilla
tools/run.sh --tasks cases/tasks --arm skill/israel-annual-tax --name skill
python3 tools/score.py --summary vanilla skill

Law references backing references/years/*.md and taxcalc.py:

If you are authoring a domain skill for a coding agent, ask which part belongs in a 160-line script and which "mandatory" step in your Markdown file is quietly getting skipped.