June 16, 2026 · build log

A second brain, one loop at a time.

I wrote last time about turning Claude Code into a self-running agent with a goal, a loop, and claude -p. This is the layer that makes those loops actually useful day after day: a persistent second brain, and the boring tools you already have — Telegram, cron, your calendar, your task tracker — wired up as its hands. The trick isn't building it all at once. It's starting with one lean loop, watching how it serves you, and adding the missing loops only when you feel the gap.

What the second brain is (and isn't)

It's not a vector database you bolt on and forget. It's a small set of places your context actually lives, each one plain enough that you can open and read it yourself:

The point of all four is one thing: an agent that boots informed instead of blank. A cold agent re-derives your whole world on every run — slow, costly, and how it repeats last week's mistakes. A warm one picks up where the last one left off.

How claude -p leverages it

claude -p is Claude Code run headless — a prompt in, work done with tools, result out, on your existing subscription (no second API bill). Two mechanics make it lean on the brain instead of starting from zero:

So a single line — claude -p “<goal>” --allowedTools “…” — becomes: read the brain, decide the right move, act through real tools, write back what it learned. The --allowedTools flag is your blast radius; give each run only what that job needs.

The tools you already have become its hands

You don't need to buy anything. The everyday tools on your machine already cover the senses and the actuators an agent needs:

Diagram: Telegram, cron, calendar and tasks drive claude -p, which reads and writes the second brain
claude -p in the middle does the thinking; the tools around it are how it hears you and acts; the brain underneath is what it remembers. Nothing here is a new purchase.

Each of these is just an MCP tool to claude -p. The agent doesn't know or care that “Telegram” is special — it's a tool it's allowed to use, same as reading a file.

Start with one lean loop

Resist building the whole thing. On day one you want exactly one loop, simple enough that you can see whether it earns its place:

# heartbeat.sh — fired by cron a few times a day
claude -p "Read my brain (facts + open tasks). Pick the SINGLE
highest-value thing I should do next. Message it to me on Telegram
in one short paragraph. Don't do anything else." \
  --allowedTools "Read,mcp__telegram__send,mcp__tasks__list"

That's the entire system on day one: a heartbeat that reads your context and tells you the one move that matters. No autonomy to post, spend, or change anything — just a sharp nudge from something that remembers everything. Live with it for a few days. You'll feel, concretely, what it's missing.

Then add the missing loops — only when you feel them

Every loop you add should answer a friction you actually hit, not one you imagine. The order writes itself once you're using it:

Diagram: start with one heartbeat loop, then add follow-up, task-sync, and further loops only when needed
One loop on day one. Each new loop is a response to a real gap — and because they all share the same brain, every addition makes the others smarter.

The rule of thumb: add a loop the third time you wish it existed. Before that, you're guessing; after that, you're solving a problem you can name.

Why lean-first wins

Grow the organism, don't build the cathedral. A big upfront agent is mostly loops you guessed at, half of which you'll never trust enough to let run. A lean one earns each addition — and because every loop reads and writes the same brain, each new one makes the others smarter, not just more numerous. The system compounds instead of bloating.

It's the same bet I keep making: put the intelligence in the harness, not the model. The brain is durable context; the loops are durable behavior; the model is the best one going, already paid for, rented only for the seconds it's thinking. Keep the model cheap and replaceable, and let the value pile up in the structure around it — the memory, the loops, the rules — where it persists.

Start with the heartbeat. Let it tell you what to build next.