Building a self-sorting idea jar with a cloud routine
A phone page for jotting half-formed ideas, plus a scheduled Claude Code session that files them into a list each morning without turning them into tasks.
I have a new phone page called the Idea Jar. I type an idea into it whenever one comes up, half a sentence is fine, and every morning a scheduled agent sorts the new jots into a list of ideas. Each idea gets a short title, a one-sentence summary, one to three tags and my original words, unchanged. I can open any idea later and add notes to it.
Why not just use the work list?
The project already has a work list page, but everything on it is something to build or decide. An idea I jot there turns into a commitment. I wanted ideas kept apart, so nothing in the jar is a to-do, and an idea only goes on the work list when I say I want to act on it. I can also ask for a sort straight away if I want to act on something before the morning.
How is the page built?
It’s one HTML file of about 330 lines with no framework, published as a claude.ai artifact the same way as my other phone pages (the work list, the review desk and the dungeon designer). Nothing is stored in the page itself. It declares the artifact’s db capability, which is a small document store the host keeps for the page, so republishing the page never loses a jot and the agent can read and write the same data.
There are three collections:
jots/<id> {text, at, status: "new" | "filed", idea}
ideas/<id> {title, summary, tags, words: [{text, at, jot}], created, updated}
ideas/<id>/notes/<id> {text, at, by}
The words array keeps every jot that went into an idea, verbatim, with its time. The summary can be rewritten later but the words never are. Notes live in a subcollection under their idea, so the sorter can rewrite an idea without touching a note, and two notes added from two devices can’t overwrite each other.
The page subscribes once to the jots and once to the ideas with onSnapshot, so a sort shows up live. Notes are only subscribed to when I first open an idea, which keeps it well under the host’s limit of 64 live subscriptions per page. A re-render keeps any half-typed note and keeps the keyboard focus where it was. The unsent jot goes to local storage on every keystroke, so closing the page doesn’t lose it. That’s the only thing kept in the browser.
I set the jots and my original words in Kalam, a handwriting font, and everything the sorter writes in IBM Plex Sans, so my words look different from the summary. The jot box is drawn as lined paper with a repeating-linear-gradient whose period is the line height, scrolling with the text.
How does the morning sort work?
The sorter is a Claude Code routine, which is a session started on a cron schedule in Anthropic’s cloud. I used that so it runs without any session open on my machine. A page can ask Claude something itself, but only while someone has it open. A local scheduled job only runs while a session is open.
The routine runs at 0 14 * * *, which is UTC, so 7 am Pacific in the summer and 6 am in the winter. It uses Claude Sonnet 5.5 with no repository and only the tools it needs. A cloud session starts with no context, so the whole job is in its prompt:
- Read the clock with
date -uand use that value for every “now”. - Find the jots still marked
new. If there are none, stop. - List the existing ideas to compare against.
- For each jot, either add it to an existing idea if it’s clearly the same idea, or make a new idea. A jot holding several ideas becomes several ideas.
- Mark each jot
filedwith its idea’s id.
Every write is pinned to the version of the document just read, so if I change something on my phone during a sort, that write fails instead of overwriting me, and the agent re-reads and does it again. The writes go out in one atomic batch of up to 50. The prompt also lists what the agent must never do: turn an idea into a task, add plans or opinions, rewrite my words or touch a note.
What went wrong on the first run?
I fired the routine by hand right after making it. I’d already dropped in a first jot, and it sorted that into a new idea in about 12 seconds and 5 turns. But it wrote a made-up, rounded creation time (“03:00”) instead of reading the clock. That’s why step 1 now makes it run date -u before writing anything. I corrected the one wrong date by hand.