AI Won't Do Your Taxes — But It'll Make Them Bearable
How I used Claude Code to turn a dreaded weekend of Japanese tax filing into a 3-hour Friday evening

I'm a foreigner living in Japan. Every March, I file my own tax return — 確定申告 (kakutei shinkoku).
Most people in Japan never file taxes. Their employer handles everything through year-end adjustment. But my situation is different: I have multiple income types that don't fit the standard payroll flow. Salary from my Japan employer. Stock compensation from my employer's parent company that isn't included in my Japan payroll. Stock sales through a foreign brokerage. Small foreign dividends. Medical expenses for the family.
Each of these requires different tax treatment. Stock compensation is salary income taxed at the vest date, converted to yen at the daily exchange rate. Stock sales are capital gains under separate taxation. Medical expenses above ¥100,000 are deductible. Some deductions phase out at higher income levels. Prior-year stock losses carry forward for three years but can only offset specific income types.
It's the kind of tax return that most Japanese taxpayers, and many tax professionals, rarely encounter.
Every year, this takes me a weekend. Spreadsheets, exchange rate lookups, cross-referencing brokerage statements, and then carefully entering everything into e-Tax Web one field at a time.
This year, I tried something different.
What Claude Code actually did
I started on a Friday evening at 7pm. By 10pm, the return was filed. The longest part? Walking to the convenience store to scan the medical receipts.
I gave Claude Code my source documents: brokerage statements, medical receipts, employer documents. Together we built a Python calculation engine that:
- Computed vesting income for each vest event, converted at the MUFG TTM exchange rate for that specific date
- Calculated discount income from employee stock purchase plans (the spread between purchase price and fair market value)
- Aggregated dozens of individual stock sale lots into sale dates, computing gains/losses in both USD and JPY
- Tracked medical expenses across multiple receipts, correctly excluding one cosmetic procedure
- Applied the right deductions: dependent deductions (each in the right category), social insurance, medical expenses above ¥100,000
- Knew that certain deductions phase out entirely above income thresholds, and applied ¥0 correctly
- Calculated loss carryforward from prior years
The script generated an HTML dashboard showing every line item, every exchange rate, every intermediate calculation. When I needed to verify a number, I could trace it back to the source.
Then came the real test: entering everything into e-Tax Web.
The e-Tax walkthrough
Claude Code couldn't click buttons for me. e-Tax is a browser-based system with no API. But it walked me through every screen, telling me exactly which option to select, which field to fill, and what value to enter.
When I hit a locked field (the foreign tax credit screen wouldn't let me enter the adjustment amount), Claude diagnosed it instantly: I needed to enter the detail on screen 1/2 before screen 2/2 would unlock. Country, income type, tax type: once those were filled, the next screen opened up.
When e-Tax's final calculation came back lower than our estimate, Claude traced the discrepancy in minutes. We'd missed a specific deduction (所得金額調整控除) that applies when you have dependents and salary above a threshold. e-Tax applied it automatically. Claude updated the script to include it.
What AI couldn't do
The .data file that e-Tax generates when you save your return? Encrypted binary. I had Claude analyze it hoping we could generate it programmatically next year. No luck: ~58KB of encrypted data with no recognizable structure. Manual e-Tax entry remains the only path.
Scanning medical receipts at the convenience store? Still analog.
Understanding my specific situation (which stock grants fall into which category, which medical expenses are cosmetic, what the prior year's carryforward actually was) required my input. Claude computed; I verified.
The result
What usually takes a weekend took three hours on a Friday evening, and the biggest chunk of that was walking to the convenience store to scan receipts. The tax return was filed electronically, verified against e-Tax's own computation, and confirmed received.
More importantly, I now have a reusable calculation engine. Next year, I update the numbers — new vest dates, new sales, new medical receipts, new exchange rates — and the script handles the rest. The walkthrough is documented. The carryforward amounts are saved.
The interesting thing isn't that AI "did my taxes." It's that it turned a dreaded annual ordeal into a manageable process. The complexity didn't go away. I had a partner who could hold all of it in context simultaneously. Every exchange rate, every lot, every deduction rule, every e-Tax screen. That's what made the difference.
What I'd tell other expats
If you're filing Japanese taxes with foreign income, stock compensation, or other complexity:
- Build the calculation separately before touching e-Tax. Having a verified spreadsheet/script makes e-Tax entry mechanical rather than stressful.
- Exchange rates matter and are tedious. TTM rates from MUFG for every transaction date, with weekend dates mapped to the preceding business day. This is exactly the kind of thing AI handles well.
- Stock compensation from a foreign parent company is salary income in Japan, taxed at vest-date FMV converted to yen. If your employer doesn't include it in payroll, you file it as a separate 源泉徴収票 with ¥0 withholding.
- Stock losses carry forward 3 years but only offset stock gains and listed stock dividends — not salary. You must file 第三表 + 付表 every year to preserve the carryforward, even if you have no gains.
- The e-Tax .data file is encrypted. Don't waste time trying to generate it programmatically.