How I Built The Daily
I built a scratch pad for Connections, then made it load each day’s board by itself. This is how it works, where the AI code lives, and the prompt it sends.
Try The Daily SortHow I play
Before I make a guess in Connections, I like to sort all sixteen words into groups. I usually do this in my head and at least try to identify a group or two. But beyond that I struggle to remember everything.
My wife plays a different way. She takes a screenshot of the board and marks up each group before she makes a guess. That way she can solve purple first and get it on top, which is a harder way to play.
I have always wanted a tool that allows me to sort the words into groups myself. Having a visual way to do this would help me think through the puzzle better.
In order for the tool to be helpful, it would have to have a way to get the day’s words from the daily puzzle. With AI, I figured I could build that pretty easily.
So I asked Claude Code for a scratch pad. The Daily Sort loads the day’s board and lets you paint each word a color. It doesn’t have the answers, only the sixteen words.
Before any of the daily-board code, I asked Claude for a write-up of how it would work. The write-up caught the hard parts early: where the API key lives, how to make sure the lookup only happens once, and what to do when two people click at the same time.
How a board gets here
Finding a board takes a web search, which costs money and a few seconds, so Claude only does it once a day. Just after midnight Eastern, a scheduled job asks Claude for the new board and the site will save it. Every visit after that loads the saved copy from the cache in about a second, with no AI.
Connections changes at midnight in each player’s own time zone, so now and then someone opens the page before the job has run, and their visit starts the lookup instead. The site sets a lock so only one lookup runs even if two people open the page at once, and their browser will poll, asking again every 3 seconds, until the board is saved.
First lookup of the day
- ASKovernight job asks for today
- LOCKone lookup per day
- CLAUDEweb search, a few seconds
- CHECK16 clean words
- SAVEfor everyone
If a visitor gets there before the job, their visit starts the lookup and the browser asks again every 3 seconds until the board is saved.
Every visit after that
- ASKbrowser asks for today
- CACHEsaved copy found
- DONEabout a second, no AI
Each answer from the server lists the steps it took, and you can click the request below to see today’s.
GET /api/
-
0 s 202
- date 2026-10-21 accepted
- cache miss: no saved copy yet
- lock free: started the background lookup
First visitor today. The lookup runs as a separate task, which can take longer than a normal page request is allowed to.
-
3 s 202
- date 2026-10-21 accepted
- cache miss: no saved copy yet
- lock held: a background lookup is already running
Still searching. Asking again every 3 seconds.
-
6 s 200
- date 2026-10-21 accepted
- cache hit: saved copy found (looked up 0 s ago)
The background lookup finished and saved the board. Everyone after you gets this copy for free.
claude-haiku-5-5 · 1 turn · 2 searches · 24,655 tokens read · 223 written · 2.4 s
Asking Claude
All the code that talks to Claude lives in one file: netlify/.
No other file talks to Claude, and the rest of the code only decides when to ask and what to do with the answer.
It’s the same habit as keeping every Shark Thief setting in one config file. When I want to change how the lookup works, I know where to look, and so does Claude.
netlify/The prompt, the models and the Claude API call. The only file that talks to Claude.connections/ claude-source.mjs netlify/Checks Claude’s answer before anything is saved.connections/ words.mjs netlify/The background lookup: takes the lock, applies the limits, asks, checks, saves.connections/ fetch.mjs netlify/The fast endpoint the page calls. Never calls Claude.connections/ today.mjs netlify/The overnight job that does the first lookup of the day.connections/ prefetch.mjs netlify/Signs requests so only the site can start a lookup.connections/ internal-auth.mjs src/The page itself: tiles, inkwells, wire report. No AI.components/ connections/
The prompt
It names the exact date, asks for the sixteen words in a fixed data format (JSON) and nothing else, and says what to send back when the board isn’t online yet. The last line is there so Claude sends an empty list instead of guessing.
Find the 16 words on the New York Times Connections puzzle for date. Search for that exact date and make sure the board you report is for date, not a neighbouring day. Spell each word exactly as it appears on the board. Reply with only this JSON and nothing else: {"words": ["WORD1", "WORD2", "..."]} If you can't find the board for date, reply with {"words": []}.
The model
This job is just finding sixteen words, so the cheapest model, Haiku, goes first, and if Claude’s service turns the request away the next model in the list runs.
The search
The call is capped at three web searches and set to think less than usual.
Claude’s web search can be limited to a list of sites. My first version listed a few, but two of them block Anthropic’s search bot, and that made the whole request fail, so now the search can use any site.
The parse
Claude’s answer comes back as text mixed in with search results, so the code pulls the JSON out. If it isn’t JSON, the first 300 characters go into the error so the logs show what Claude actually said.
Safe and cheap
Once it worked, I asked Claude for a security audit. The biggest problem it found: the lookup runs at a public URL, and anyone could call it directly for a date with no board yet. Every call would start a new lookup and spend money.
Now the page’s own server has to sign every request with a key only it has, and the lookup refuses anything unsigned.
The page’s server and the lookup both enforce a cap: a 10-minute wait after any lookup that didn’t save a board, and at most six lookups per date, so a flood of calls can’t run up the bill.
It also flagged that Claude reads whatever pages the search turns up, and a page could try to steer it. So a filter checks the answer before anything is saved: sixteen unique words, each short and in plain characters, with no web addresses and no bad words.
I also checked the cost. The first real lookup ran on Opus, which this job doesn’t need. It runs on Haiku now, with Sonnet as the backup.
tokenssearches3 characters = 1¢
- tokens
- $0.17
- searches
- $0.02
- total
- ≈ $0.19
- tokens
- < $0.01
- searches
- $0.02
- total
- ≈ $0.02
I really enjoyed building this and solving a problem, even a small one. It’s an example of using AI lightly: one lookup a day, and the rest is a plain web page.
Try today’s board on The Daily Sort
The Daily Sort is a sorting aid. It isn’t affiliated with The New York Times, and it never stores or shows the groups. Play the real game at nytimes.com/games/connections.