Engineering 11 min read

A Second Brain Where Git Is the Database

MMNMNOTE
githubclaude-codeai-agentsmarkdowngitautomationmcp
Updated June 8, 2026

Reference: bradautomates/second-brain — MIT · Python

Second Brain is a GitHub template that turns a plain Markdown vault into an AI "chief of staff" using Claude Code. There is no app and no database. Git stores your notes, syncs your devices, and logs every action, while scheduled AI subagents called "farmers" pull tasks and decisions from Slack and meeting transcripts into the vault automatically.

What is bradautomates/second-brain?

It is a Markdown vault wired up as an autonomous assistant, not a product you install. You clone the template into a private repo, point Claude Code at it, and its CLAUDE.md turns the model into a "Chief of Staff" that classifies whatever you type into a task, project, person, or idea and files it as Markdown.

The repo is 151 stars, 39 forks, MIT-licensed1 (as of June 2026).

curl -s "https://api.github.com/repos/bradautomates/second-brain" \
  | python3 -c 'import json,sys;d=json.load(sys.stdin);print(d["stargazers_count"], (d["license"]or{})["spdx_id"])'
# 151 MIT  (re-derive before quoting — it drifts)

The design thesis is stark: a paid app, a sync service, and a vector database are all replaced by one thing you already have — git.

What problem does it solve?

Your context is scattered across Slack, calendars, meeting recorders, and three different note apps. Second Brain collapses all of that into a single source of truth you fully own and control. You write in plain natural language, classification handles the filing, and every entity ends up as a portable Markdown file with structured frontmatter.

The README states the principle directly: "Natural language first — Say what you mean, let classification handle the rest."2 You type meeting with Sarah Friday about Q2 planning, and the system decomposes it into a person, a task with an extracted due date, and a wiki-style [[link]] between them. Every file is plain Markdown with YAML frontmatter, so the data is machine-readable and survives the tool. That is the same bet behind treating Markdown notes as durable AI memory instead of locking context inside a proprietary store.

How does git become the database?

There is no schema migration, no sync server, and no audit table anywhere in this repo. Git quietly provides all three of those things, and a single Bash hook does the writing for you, so you never type git commit yourself — the act of saving a note is also the act of recording it permanently.

The auto-commit.sh hook fires after every Write or Edit, derives a commit type from the folder, and pushes — but only for vault content paths:

case "$REL_PATH" in
  tasks/*|projects/*|people/*|ideas/*|daily/*|weekly/*|context/*) ;;
  *) exit 0 ;;
esac
# ...
git commit -m "cos: update $TYPE - $FILENAME"

Every action becomes a commit prefixed cos:, so your activity log is just git log --grep="cos:". The hook self-heals: it recovers from a detached HEAD with git reset --hard origin/main and falls back from git pull --rebase to a merge when a rebase fails. Concurrency between a cloud agent and your laptop is handled the same way every writer does it — rebase before push.

What is a "farmer"?

A farmer is a scheduled Claude Code subagent that reads an external source over MCP and writes the relevant bits straight into your vault. Built-in farmers watch Slack channels and Fireflies meeting transcripts, classifying messages into tasks and decisions; you generate your own with the /create-farmer command for any connected service.

The official Claude Code docs explain why this isolation matters: "Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions."3 Second Brain leans on that. The subagent file in .claude/agents/<name>-farmer.md is both the config and the executor — CLAUDE.md puts it plainly: "The subagent definition IS the config AND the executor."4 Its body is the entire system prompt, with no parent CLAUDE.md leaking in.

The farmer's job, from slack-farmer.md, is a tidy loop: discover tools, read the watchlist, check last-run state, read the last 24 hours, classify, deduplicate, sync, write, update state.

Why don't farmers hardcode their tools?

Because MCP tool names are not stable across environments, the farmer discovers them at runtime instead of pinning them in its config. The farmer file deliberately omits both the tools and mcpServers fields, naming only the capability it needs and resolving the actual tool when it runs — late binding, applied to agent tools.

The reasoning is spelled out in create-farmer/SKILL.md: "No mcpServers — doesn't work for remote MCPs; ToolSearch handles discovery."5 So at run time the agent searches for tools by service name, because — as slack-farmer.md warns — "MCP tool names are prefixed differently across environments (e.g., mcp__Slack__slack_read_channel vs slack_read_channel). Use the exact names returned by ToolSearch."6

There is one more piece of convention-as-wiring worth stealing. Farmer filenames must end in -farmer, because that is the exact matcher the auto-push hook listens on:

"SubagentStop": [
  { "matcher": ".*-farmer",
    "hooks": [{ "type": "command",
      "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/subagent-push.sh" }] }
]

A naming rule, not a registry, is what connects a new farmer to the system.

How do the pieces stay in sync?

Three independent paths all converge on the same private git repo, so there is no special sync service to run, pay for, or trust. The discipline that makes concurrent writes safe is simply rebase-before-push, applied identically by a cloud agent, a local session, and your Obsidian plugin alike.

A cloud-scheduled farmer clones fresh, farms, and pushes. A local Claude Code session pulls on start via the SessionStart hook (git pull --rebase --autostash). The obsidian-git plugin pulls when you open Obsidian each morning, so farmed content is simply there. Three writers, one rebase-on-write discipline, one remote. Farmed files carry source: farmer/<name> and farmed: <timestamp> in their frontmatter, so you can always tell auto-captured content from what you wrote by hand.

What does it teach?

The reusable lesson is that you can build a genuinely useful agent system on boring, durable primitives. Markdown is the data model, git is the database and sync, and deterministic Bash hooks are the autonomic glue around the non-deterministic model.

Three ideas travel well beyond this repo. First, git's commit log is an audit trail you get for free — prefix your commits and querying becomes git log --grep. Second, late-bind your tools: name a capability and resolve it at runtime rather than freezing brittle tool names into config. Third, wire by convention — a filename suffix matched by a hook is simpler and more legible than a registry. The privacy stance is enforced in code too: the init script runs gh repo view and refuses to proceed if your vault repo is public.

Verdict

If you live in Claude Code and want a notes-and-context system you fully own, Second Brain is worth studying and worth running — it is small enough to read end to end in an afternoon. Treat it as an architecture to learn from rather than a finished product: it was last pushed in early 2026, requires a paid Claude subscription, and is unmistakably an early-stage template. The ideas are the value.

Frequently Asked Questions

What is bradautomates/second-brain? It is an MIT-licensed GitHub template that turns a git-tracked Markdown vault into an AI chief-of-staff run by Claude Code. There is no app or database — git stores the notes, and Claude Code skills classify and file natural-language input as tasks, projects, people, and ideas.1

What is a "farmer" in Second Brain? A farmer is a scheduled Claude Code subagent defined in .claude/agents/<name>-farmer.md that reads an external source over MCP — Slack or meeting transcripts, for example — and writes the relevant tasks and decisions into your vault. CLAUDE.md describes it as both the config and the executor.4

How does Second Brain use git as a database? A PostToolUse hook auto-commits every vault change with a cos: prefix and pushes to a private repo. Git provides storage, cross-device sync, and a queryable audit log via git log --grep="cos:". There is no separate database or sync service.

Do farmers need their MCP tools hardcoded? No. Farmer files omit tools and mcpServers because remote MCP tool names vary by environment. The agent discovers them at runtime with ToolSearch, using "the exact names returned by ToolSearch" rather than fixed strings.6

Why must a farmer filename end in "-farmer"? Because the SubagentStop hook uses the matcher .*-farmer to auto-push a farmer's commits when it finishes. The naming convention is the wiring between a new farmer and the system, so a non-conforming name simply will not auto-push.

What does Second Brain require to run? The README lists a Claude Pro or Max subscription, the Claude Code CLI, Obsidian, and Git. The setup skill also enforces a private repo: its init script checks gh repo view and exits if the vault repo is public.

Can I add my own data source? Yes. Running /create-farmer walks you through connecting any MCP service — Gmail, Google Calendar, and others — then generates the subagent file, adds read-only tools to settings, updates your watchlist, and offers to schedule recurring runs.

Boring primitives, used well, outlast clever ones — Markdown and git were a database all along.


If your notes are plain Markdown you keep, they can power tools like this without ever leaving your control — that is the idea behind mnmnote.com.

Footnotes

  1. bradautomates/second-brain, GitHub repository (LICENSE: MIT) — https://github.com/bradautomates/second-brain · stars/forks re-derived via GitHub REST API, accessed 2026-06-05. 2

  2. README.md, bradautomates/second-brain — https://github.com/bradautomates/second-brain/blob/main/README.md · accessed 2026-06-05.

  3. "Create custom subagents," Claude Code documentation — https://code.claude.com/docs/en/sub-agents · accessed 2026-06-05.

  4. CLAUDE.md, bradautomates/second-brain — https://github.com/bradautomates/second-brain/blob/main/CLAUDE.md · accessed 2026-06-05. 2

  5. .claude/skills/create-farmer/SKILL.md, bradautomates/second-brain · accessed 2026-06-05.

  6. .claude/agents/slack-farmer.md, bradautomates/second-brain · accessed 2026-06-05. 2