sort a year of finances with AI
Sort a year of transactions with Codex so your accountant can review them.
// THE SHORT ANSWER
I did it with Codex: I gave it twelve statements and in under four minutes it had the whole year organized.
- Tested on
- Sep 4, 2026
- Who it's for
- Business owners, freelancers and creators who keep their books by hand
- Level
- Beginner, you don't need to code
- Cost
- It works with your ChatGPT account, including the free plan. Usage limits depend on your plan.
file · AGENTS.md
# Finances 2025 — instructions for the agent This folder keeps simple business books from the bank statements. ## Structure - `estados/` — one PDF per month, named `MM-month-2025.pdf` (example: `03-march-2025.pdf`). - `movimientos-2025.csv` — every transaction of the year, one row each. - `resumen-2025.md` — totals by month and by category, always current. ## Workflow: process the new month When I ask you to "process the new month" (or a specific month, or "process all"): 0. Before anything, record the start time: run `date +%s` on Mac or Linux, or `Get-Date -UFormat %s` on Windows, and remember the value. 1. Look in `estados/` for PDFs that are not yet in `movimientos-2025.csv`. 2. Read each PDF and extract every transaction: date, description, debit or credit, amount and balance. 3. Check the numbers add up: opening balance + deposits - withdrawals = the closing balance on the PDF. If it does not add up, tell me and save nothing. 4. Assign a category to each transaction using these rules (bank descriptions come mixed in English and Spanish, exactly as each merchant records them): - Credits: STRIPE / TRANSFERENCIA RECIBIDA / ADSENSE / ACH COLLAB → `ingresos` - ADOBE / CANVA / GOOGLE *WORKSPACE / ZOOM / NOTION → `software` - META PLATFORMS → `publicidad` - TRANSFERENCIA ENVIADA (payments to collaborators) → `freelancers` - WEWORK → `coworking` - TELMEX / INTERNET → `servicios` - AMZN / AMAZON → `equipo` - UBER → `transporte` - COMISION → `comisiones` - If a description matches no rule but the category is obvious, classify it with your best judgement and tell me at the end which ones you classified that way, so I can confirm them. - If it is not clear, use `otros` (and tell me which ended up there). 5. Add the new rows to `movimientos-2025.csv` with the columns: `fecha,mes,concepto,categoria,cargo,abono,saldo`. Create the file with headers if it does not exist. Do not duplicate transactions already recorded. 6. Regenerate `resumen-2025.md` in full: a table of totals by month (income, expenses, net) and a table of the year by category. End with the line "Updated: [date] · last month processed: [month]". 7. Finish by telling me in one line: how many transactions you added, the net for the period, and whether anything ended up in `otros`. 8. As the LAST line of your reply, work out the elapsed time (run the time command again and subtract the start time) and write it in this exact format: "Total time: X minutes and Y seconds." (if it took under a minute: "Total time: Y seconds.") ## Rules - Never invent amounts: everything comes from the PDF. If a value cannot be read, tell me. - Do not delete or change transactions from earlier months. - Amounts go without a currency symbol and with a decimal point (e.g. `1800.00`).
Only change the category rules highlighted below. Copy the rest exactly, and adjust those rules to the wording on your own statements.
STEP BY STEPFrom twelve PDFs to a CSV and a summary to review
Install Codex with one command
On a Mac, open Terminal. You'll find it in Applications, inside Utilities. On Linux, open your terminal. On Windows, open PowerShell. Copy the command for your system, paste it, press Enter and wait for it to finish.
Create the folder and download your statements
Create a folder called finanzas-2025 on the Desktop and, inside it, another called estados. Then go to your bank's site, download each month's PDF and save them in estados with one name per month: 01-enero-2025.pdf, 02-febrero-2025.pdf and so on. A warning: bank statements carry sensitive information. Check the data controls on your ChatGPT account before you use real documents. On Mac or Linux, if you prefer the terminal, the command below creates both folders at once. If you already keep a Proyectos folder, create finanzas-2025 there: one folder per project.
Move into the folder and sign in with your ChatGPT account
In the terminal type cd, add a space, drag the finanzas-2025 folder onto the window and press Enter. Once inside, type codex and press Enter. Choose the option to sign in with ChatGPT: the browser opens for you to log in. The free plan works; usage limits depend on your plan. When it confirms your session, leave Codex (type /quit and Enter). You are connected now, and this only happens once.
Create the AGENTS.md file
In the finanzas-2025 folder (not inside estados) create a text file named exactly AGENTS.md, matching upper and lower case. On a Mac: open TextEdit, press Cmd+Shift+T to switch to plain text, paste the file above and save it as AGENTS.md (if TextEdit adds .txt, remove it from the name). On Windows: open Notepad, paste the file, and in Save as choose type All files and type AGENTS.md. Codex reads AGENTS.md when it starts a session in that folder, which is why you don't paste the rules into every task. Before going on, confirm the real file name: on Windows, in File Explorer turn on View, Show, File name extensions and check it says AGENTS.md and not AGENTS.md.txt; on a Mac, select it and press Cmd+I to see the full name.
Run the command and let it work
In the same terminal, still inside the finanzas-2025 folder, run the command. Codex goes month by month: it reads each PDF, checks the numbers add up, and categorizes every transaction. Depending on the mode, Codex may ask permission to read or write; approve it. If the folder opens read only, type /permissions and allow changes inside finanzas-2025. At the end it prints how long it took.
Review it and share with your accountant
Codex leaves two files in the folder: movimientos-2025.csv with every transaction of the year, and resumen-2025.md with the totals by month and by category. Open Google Sheets, import the CSV (File, Import, Upload), check the totals against your statements, and share it with your accountant using the share button.
Keep it going month by month
When a month closes, download the new PDF, save it in estados and run codex "procesa el mes nuevo". Codex works out what is missing, adds only that month, and keeps the summary current.
WHAT TO CHECK
Before you use it with a real client
ASK YOUR AGENT
Ask for this guide without leaving the chat
Find the superpowers guide on how to sort a year of finances with AI and walk me through it.
Works in Claude, in Codex and in compatible MCP clients.
NEXT SUPERPOWER
#001get space back on my computerThis prompt does the job by hand. I can also automate the process so the result arrives ready for you to review.