As your financial records grow, maintaining clarity and efficiency becomes paramount. This guide presents a structured approach to organizing your Beancount files, moving beyond a single, monolithic ledger. By categorizing accounts by type and segmenting transactions based on their nature and time frame, you can enhance readability, simplify maintenance, and facilitate future adjustments. Whether you’re dealing with daily expenses, income streams, or investment activities, this methodology offers a scalable framework to keep your financial data organized and accessible.

Opening & Closing Accounts

First, to build a ledger, we need to open (define) all the accounts we need. Different from the official recommendation, I choose to organize the files based on the account types. In other words, Asset accounts are defined in Asset.bean, Income accounts are defined in Income.bean and so on. One advantage of this file organization is we can easily find the corresponding account definition when needing to make changes.

Within each account type, if there are too many accounts in one file, I also divide them into multiple files. For example, I divide the Assets and Expenses accounts into multiple files due to their large number of accounts:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
accounts
├── Assets
│   ├── HealthCare.bean
│   ├── Retirement.bean
│   ├── cash.bean
│   ├── emergency.bean
│   ├── investment.bean
│   └── others.bean
├── Equity.bean
├── Expenses
│   ├── Active.bean
│   ├── Passive.bean
│   └── Taxes.bean
├── Expenses.bean
├── Income.bean
├── Liabilities.bean
└── accounts.bean

For the Assets and Expenses files, I divide them based on the account hierarchy I defined, which can be anything you like.

When some accounts are needed to be closed (e.g., short term CDs), I usually put the close Directive below the open Directive to be consistent. Otherwise, we might lose track of the corresponding close:

1
2
3
2024-09-16 open Assets:Emergency:CD:Fidelity:946251CC7 CD946251CC7
    bank: "Wayne Savings Community Bank"
2024-12-29 close Assets:Emergency:CD:Fidelity:946251CC7

Transactions

To log the transactions, I also divide different transactions into different files based on the nature of the transaction. Currently, I have the following categories:

  • Autos: All the vehicle related transactions, e.g., gas, maintenance service, repairs.
  • Children: All the kids related expenses, e.g., education.
  • Daily: Daily expense, mostly grocery.
  • Health: Health related expense. I further divide them into Dental, Medical and Vision subcategories.
  • Income: All the incomes transactions, mostly logs your paycheck.
  • RealEstate: Real estate related transactions, e.g., mortgage payments.
  • Retirement: Retirement related accounts, e.g., 401K and IRA.
  • Stock: Stock investments, buying and selling stocks.
  • Travel: Travel related expenses.

Within each category (except the Daily), transactions are organized by the year:

1
2
3
4
5
data/Income
├── Income.bean
│── 2023.bean
│── 2024.bean
│── 2025.bean

The reasons I organized the files in this way are

  1. Each file (year) contains not too many transactions that make the modification easy enough. For example, we can easily change the account hierarchy without messing up. Down the road of using Beancount, you will be in the need to change the account hierarchy (I changed the hierarchy several times), which means all the related transactions need to be updated. Putting all the related transactions in a separate file can make this change very easy.
  2. Make the transactions conceptually clean. Putting everything into one single file can also make it easy to make changes, but this one single file could be tedious and large. It is not healthy for your eyes and mind.

Daily Grocery

The only exception to this organization is the Daily category, which contains most of the daily transactions. Instead of using one file for each year, I use one file for each week. This is because there are many transactions need to be logged. Putting all of them into one file makes it hard to maintain and navigate.

The Daily directory looks like:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
data/Daily
├── 2023.bean
├── 2024.bean
├── 2025
│   ├── April
│   │   └── Week14.bean
│   ├── February
│   │   ├── Week06.bean
│   │   ├── Week07.bean
│   │   ├── Week08.bean
│   │   └── Week09.bean
│   ├── January
│   │   ├── Week01.bean
│   │   ├── Week02.bean
│   │   ├── Week03.bean
│   │   ├── Week04.bean
│   │   └── Week05.bean
│   └── March
│       ├── Week10.bean
│       ├── Week11.bean
│       ├── Week12.bean
│       └── Week13.bean
├── Daily.bean

At the end of the year, I will use a simple python script (or any script) to combine all the weekly files into one file, e.g., the 2023.bean and 2024.bean in the above. This operation is something like archiving all the transactions from last year.

Balance Asserts

Besides all the accounts and transactions, I also maintain a list of balance assert files. Due to the fact that I am kind of a neat freak, I do the balance assertion weekly. I follow the same file organization as the Daily Grocery.

Other Miscellaneous

There are a few other files need to be organized. I simply put them into individual files based on their usages:

  • event.bean: log all the events.
  • prices.bean: log all the commodity prices. I use bean-price to fetch the prices.
  • Commodity.bean: Define all the commodities with some metadata.

Overall File Organization

All the above files are put under the data/ directory within the Beancount main directory.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
data/
├── Asserts
│   ├── 2023.bean
│   ├── 2024.bean
│   ├── 2025
│   │   ├── February
│   │   │   ├── Week06.bean
│   │   │   ├── Week07.bean
│   │   │   ├── Week08.bean
│   │   │   └── Week09.bean
│   │   ├── January
│   │   │   ├── Week01.bean
│   │   │   ├── Week02.bean
│   │   │   ├── Week03.bean
│   │   │   ├── Week04.bean
│   │   │   └── Week05.bean
│   │   └── March
│   │       ├── Week10.bean
│   │       ├── Week11.bean
│   │       ├── Week12.bean
│   │       └── Week13.bean
│   └── Asserts.bean
├── Autos
│   └── SubruFroster2017.bean
├── Children
│   ├── Child
│   │   └── 2024.bean
│   └── Children.bean
├── Commodity.bean
├── Daily
│   ├── 2023.bean
│   ├── 2024.bean
│   ├── 2025
│   │   ├── April
│   │   │   └── Week14.bean
│   │   ├── February
│   │   │   ├── Week06.bean
│   │   │   ├── Week07.bean
│   │   │   ├── Week08.bean
│   │   │   └── Week09.bean
│   │   ├── January
│   │   │   ├── Week01.bean
│   │   │   ├── Week02.bean
│   │   │   ├── Week03.bean
│   │   │   ├── Week04.bean
│   │   │   └── Week05.bean
│   │   └── March
│   │       ├── Week10.bean
│   │       ├── Week11.bean
│   │       ├── Week12.bean
│   │       └── Week13.bean
│   └── Daily.bean
├── Health
│   ├── Dental
│   │   ├── 2023.bean
│   │   ├── 2024.bean
│   │   └── 2025.bean
│   ├── Dental.bean
│   ├── Medical
│   │   ├── 2023
│   │   │   ├── HeartAccident.bean
│   │   │   ├── Massage.bean
│   │   │   ├── Others.bean
│   │   │   ├── Preventive.bean
│   │   │   ├── Shoulder.bean
│   │   │   └── Stomach.bean
│   │   ├── 2023.bean
│   │   ├── 2024
│   │   │   ├── Ada.bean
│   │   │   ├── General.bean
│   │   │   ├── Shoulder.bean
│   │   │   └── Wife.bean
│   │   └── 2025
│   │       └── Ada.bean
│   ├── Medical.bean
│   ├── Pregnant
│   │   ├── 2023.bean
│   │   └── 2024.bean
│   ├── Pregnant.bean
│   ├── Vision
│   │   └── 2024.bean
│   └── Vision.bean
├── Income
│   ├── Income.bean
│   ├── Wife
│   │   ├── 2023.bean
│   │   ├── 2024.bean
│   │   ├── 2025.bean
│   │   └── pre-history.bean
│   └── Husband
│       ├── 2023.bean
│       ├── 2024.bean
│       └── 2025.bean
├── RealEstate
│   ├── Property_A
│   │   ├── 2019.bean
│   │   ├── 2020.bean
│   │   ├── 2021.bean
│   │   ├── 2022.bean
│   │   ├── 2023.bean
│   │   ├── 2024.bean
│   │   └── 2025.bean
│   ├── Property_B
│   │   ├── 2022.bean
│   │   ├── 2023.bean
│   │   ├── 2024.bean
│   │   └── 2025.bean
│   ├── Property_A.bean
│   └── Property_B.bean
├── Retirement
│   ├── Wife
│   │   ├── 2023.bean
│   │   ├── 2024.bean
│   │   └── 2025.bean
│   ├── Husband
│   │   ├── 2023.bean
│   │   ├── 2024.bean
│   │   └── 2025.bean
│   └── retirement.bean
├── Stock
│   ├── Stock.bean
│   ├── Wife
│   │   ├── 2023.bean
│   │   ├── 2024.bean
│   │   ├── 2025.bean
│   │   └── pre-history.bean
│   └── Husband
│       ├── 2023.bean
│       ├── 2024.bean
│       └── 2025.bean
├── Travels
│   ├── 2023-06-Mountain-View.bean
│   └── Travels.bean
├── asserts_template.bean
├── data.bean
├── event.bean
├── prices.bean

The End

I’m sharing my personal file organization system in this post, which are far from perfect, but I hope it is helpful to newcomers exploring Beancount.