Advent of Code: Organize Puzzle Inputs, Notes, and Solutions in Files
Use one folder per day, keep your notes in a Markdown file next to your code, and add a .gitignore rule so your puzzle inputs never reach a public repository. Ten minutes of setup before December 1 saves you from a messy tree by day five.
Advent of Code puzzles start on December 1 (Day 1 = Dec 1) and come out every day, ending mid-December. That's a short sprint, and every day adds an input, an example, some notes, and a solution. Here's a layout that holds up.
Quick answer
- One repo, one folder per year, one subfolder per day.
- Each day holds an
input.txt, anexample.txt, anotes.md, and your solution file. - Ignore
input.txtin Git. Commit the code and the notes.
Step-by-step
1. Make a folder per year and per day
Zero-pad the day numbers so folders sort correctly in any file browser. Skip the padding and day 10 lands between day 1 and day 2.
advent-of-code/
.gitignore
README.md
2026/
day01/
example.txt
input.txt
notes.md
solution.py
day02/
...Advent of Code works in any language, so the solution file can be whatever you like. Keep the same file names every day. That way you can copy yesterday's folder, clear it out, and start.
2. Keep the example and the real input apart
Every puzzle gives you a small example. Save it as example.txt and run your code against it first. When it matches the answer in the puzzle text, switch to input.txt. With two fixed file names, your code never hunts for data. It reads one path or the other.
3. Write one notes file per day
Notes pay off on day 12, when you remember solving something similar earlier but not where. A short template in Markdown is enough:
# Day 01
Puzzle: https://adventofcode.com/2026/day/1
## Part 1
Approach:
## Part 2
What changed:
## What went wrong
## RuntimeLink to the puzzle instead of pasting its text. Plain .md files are searchable across all 25 folders and open in any editor, now or in ten years.
4. Keep your puzzle inputs out of the repo
The About page's FAQ on copying says: "Advent of Code is free to use, not free to copy." It also asks: "If you're posting a code repository somewhere, please don't include parts of Advent of Code like the puzzle text or your inputs."
The same page says you may link to or reference puzzles, and that the site does not claim ownership or copyright over your solution implementation. So the rule of thumb is simple: your code and your notes can go public, while the puzzle text and your inputs stay out.
A .gitignore at the repo root does the job:
# puzzle inputs: not ours to redistribute
input.txt
**/input.txt
*.inputPer the gitignore documentation, a pattern with no slash in it can match in any directory, and a leading ** followed by a slash matches in all directories, so the second line is a belt-and-braces version of the first. A trailing slash would make a pattern match only directories, so leave it off when you mean files.
If you want a refresher on the syntax, see our guide to .gitignore syntax. Commit the .gitignore itself so the rules travel with the repo.
5. Use a global or local-only ignore for everything else
Some rules belong to you, not to the project. GitHub's docs on ignoring files describe a global ignore file at ~/.config/git/ignore, and a .git/info/exclude file for rules that apply only to your local clone and are never checked in. Scratch files and editor leftovers belong there. If you already sync your settings, the global file is a natural fit for a dotfiles repository.
Common problems and fixes
You already committed the inputs. A .gitignore rule does not affect files Git already tracks. Untrack them first:
git rm --cached 2026/day01/input.txt
git commit -m "Stop tracking puzzle input"Then the ignore rule takes over. Older commits still contain the file, so do this before the repo goes public, not after.
Your solution cannot find the input. Run your code from the day folder, or build the path from the script's own location. With fixed file names, that's a one-line fix.
Notes drift from the code. Write two lines in notes.md before you start and two when you finish. A good commit message per day, such as "Day 07: part 2 with memoization", gives you a second record to search.
Doing this with Carets
This workflow is plain files, which is why it fits Carets. Carets is a native notes and code editor for iPhone, iPad, and Mac. It opens your Markdown notes and your solution files in one place, with syntax highlighting for the code, and lets you organize them into files, projects, and tags.
- Open the
advent-of-codefolder as a project and keep every day'snotes.mdand solution side by side. - Tag days by topic, such as grid, parsing, or graph search, so day 12 can find day 6.
- Your files stay plain text, so they work with Git and with every other editor you use.
Carets is an editor, not a full IDE, so you'll still run your solutions elsewhere. For reading notes on a phone or jotting down an idea for part 2 away from your desk, it keeps everything in the same files.
Get Carets on the App Store for iPhone, iPad, and Mac.
Frequently Asked Questions
Can I put my Advent of Code solutions on GitHub?
The About page says you may link to or reference puzzles and that the site claims no ownership of your solution implementation. It asks you not to include the puzzle text or your inputs in a repository, so publish the code and notes and leave those out.
What do I do if I already committed my input files?
A .gitignore rule does not affect files Git already tracks. Untrack them with git rm --cached, add the ignore rule, then commit. Earlier commits still contain the files, which is worth knowing before the repo goes public.
Do I need a separate repo for each year?
No. One repo with a folder per year keeps a single ignore file and a single place to search your notes.