# Brainfeed Turns Unread Newsletters Into Notes You Approve

Brainfeed points your agents at the newsletters your second brain is missing. Agents read the issues, compare each idea to your Markdown notes, and send you only what is new. You swipe to accept, and accepted ideas land in your repo as a pull request. Try the free repo scan at [brainfeed.atharvashah.com](https://brainfeed.atharvashah.com).

<img src="/projects/images/brainfeed-home.webp" width="1600" height="1000" alt="Brainfeed Home: the pipeline from 5 sources to 14 agent runs, 6 queued ideas, 6 notes and the GitHub repo" loading="lazy" decoding="async">

## Summaries Shorten the Newsletter but Leave the Decision to You

People who keep a second brain in Markdown subscribe to more newsletters than they read. A summary tool makes each issue shorter, but you still decide what to keep, issue by issue. Your agents also start from zero every session, because nothing you read reaches the notes they work from.

Brainfeed moves the reading to agents and keeps one decision with you. No idea reaches your notes, or your agents, until you swipe to accept it.

## The Free Repo Scan Ranks 41 Newsletters in the Browser

Paste a GitHub repo of notes, and `scan.js` does the whole job in the browser tab.

1. It picks up to 40 files and 80 KB. Files named README, CLAUDE, AGENTS or index go first, and the rest are sampled evenly.
2. It fetches them 8 at a time from the GitHub API, or from raw.githubusercontent.com when you give no token.
3. It scores 20 topic clusters. A keyword hit counts 3 times in a path, 2 times in a heading and once in the body.
4. It keeps up to 6 topics and ranks 41 newsletters against them. The top 8 show, each with a match score.
5. It writes a setup prompt that gives your agent a weekly reading routine.

A private-repo token stays in the tab and goes only to api.github.com. No note body leaves the browser.

## Every Idea Gets One of Three Labels Against Your Notes

The agent pipeline reads each issue and places every idea against your notes:

- **New to your notes:** nothing you wrote covers it.
- **Builds on a note:** it extends a note you already have, and the card names that note.
- **Conflicts with a note:** it disagrees with a note, and the card quotes the line it contradicts.

Claude Haiku 5.5 extracts the ideas. Claude Sonnet 5.5 checks each conflict a second time, because a false conflict costs more trust than a missed one.

<img src="/projects/images/brainfeed-queue.webp" width="1600" height="1000" alt="The Brainfeed queue: a Latent Space card that conflicts with the note Agent evals, with Reject, Not now, Edit and Accept" loading="lazy" decoding="async">

## Your Swipes Teach the Next Queue

The queue takes accept, reject with a reason, not now, and edit. Undo works for 30 seconds. Every decision updates `brainfeed/preferences.md` in your repo, and the next run reads that file. Your taste lives in your own repo as plain text, where you and your agents can read it.

## Accepted Ideas Reach Your Repo as One Pull Request

Brainfeed never writes to your main branch. It makes one commit through the Git trees API on a new branch, and opens a pull request.

- New notes go into `brainfeed/notes/`.
- An existing file changes only between `<!-- brainfeed:start -->` and `<!-- brainfeed:end -->` markers.
- When another Brainfeed PR is still open, preferences go to a dated file, so two PRs never conflict.
- The app writes `CLAUDE.md` for Claude Code and Obsidian users, and `AGENTS.md` for Codex users.

<img src="/projects/images/brainfeed-notes.webp" width="1600" height="1000" alt="Brainfeed Notes: 6 accepted ideas grouped by week, filtered as new, builds on or conflicts, each linked to its pull request" loading="lazy" decoding="async">

## The Whole System Runs on Cloudflare's Free Plan

Brainfeed is three Cloudflare Workers and two D1 databases.

- **The site.** The `brainfeed` Worker serves the static landing page and the scan, with no build step.
- **The lead API.** `brainfeed-api` saves waitlist emails into the D1 database `brainfeed-leads`. It checks an origin allowlist, rate-limits to 4 requests a minute, and drops bots with a honeypot field. A live demo endpoint builds 8 real cards from 2 issues of up to 4 feeds.
- **The app.** `brainfeed-app` runs on D1 `brainfeed-app`, with 15 migrations and 23 tables for users, brains, cards, weights, decisions, spend, PRs and feed health. Three cron triggers run the weekly reading, the daily pull requests and an hourly sweep.

The Workers Free plan allows 50 subrequests per invocation. So each cron run stops at 40, saves its place, and lets the next tick carry on. GitHub calls keep a separate budget of 40.

## Spend Caps Keep the Model Bill Flat

- `SPEND_CAP_DAILY` holds each user to 50 cents a day.
- `SPEND_CAP_GLOBAL` holds all users together to $20 a day.
- `WEEKLY_BATCH` and `PR_BATCH` limit each cron tick to 5 users for reading and 12 for pull requests.
- Signups are rate-limited to 5 a minute, and agent runs to 3 a minute.
- Stored GitHub tokens are sealed with AES-GCM before they reach the database.

## Seven Integrations Connect Brainfeed to Your Tools

- **GitHub:** OAuth, a GitHub App for installation tokens, the REST API and the Git trees API.
- **Claude:** Haiku 5.5 for extraction, Sonnet 5.5 for conflict checks.
- **Feeds:** a tolerant RSS and Atom reader over 36 feeds, plus 5 sources that arrive by email forward.
- **Readwise Reader and custom feeds,** as extra sources.
- **Resend,** which emails me each new signup.
- **Agents:** `llms.txt` describes the site to an AI agent, and `webmcp.js` registers `join_waitlist` and `scan_repo` as tools for a browser that supports WebMCP.
- **A terminal CLI,** `brainfeed`, with no dependencies on Node 18+. It writes only inside the `brainfeed/` folder of your notes.

## What Is Live and What Is in Early Access

The landing page, the repo scan, the setup prompt, the waitlist and the live demo queue are live today. The full app is built and tested, with 263 tests and an eval set of 60 labeled cases. It is in early access until the GitHub App and the real pull request flow pass end to end.

[Scan your notes for free](https://brainfeed.atharvashah.com), and join the waitlist for the app.
