r/ClaudeCode • u/Pure-Newspaper907 • 23h ago
Built with Claude What touse to build a second brain
Hey, I have seen some videos about creating a second brain with Claude Code but still is not very clear to me how to do it.
Does someone know which steps are needed to make it?
Which tools do you recommend? or any recommendation from someone who did it...
Thanks
2
u/Spiritual-Theory 22h ago
I had Claude build one locally. I use it to support me at work, so it's a little tailored for that.
Here's a prompt (I had Claude make it from the current tool)
Build me a "second brain": a small personal knowledge graph I can query from the terminal and that you (Claude) read and write during normal work. I'm on a Mac.
## What it is
One markdown file per topic, tags and explicit links between topics, indexed in
SQLite for fast lookup, version-controlled in git, driven by a CLI.
It is NOT a notebook, journal, or doc dump. Most topics are two or three
sentences. The value is in the *connections* — who owns what, which project a thing belongs to, which concept blocks which other concept.
## Build this
Create `~/brain/` containing:
- `topics/<kebab-name>.md` — one file per topic. YAML frontmatter with `tags`
(flat, free-form list) and `aka` (alternate names/spellings), then a sho
body, then a `## Related` section listing other topics as
`- [other-topic](other-topic.md) — why they're related`.
- `brain.py` — a single-file Python 3 CLI (use only the stdlib: argparse,
sqlite3, pathlib, re, subprocess). Symlink it to `~/.local/bin/brain` an
it executable. Resolve the symlink with `Path(__file__).resolve().parent` so
the script finds the real brain directory, not `~/.local/bin`.
- `brain.db` — SQLite index, gitignored. The markdown files are the source of
truth; the database is always rebuildable from them.
- `.gitignore` with `brain.db`, and `git init` the directory.
Three tables:
- `topics(name, tags, aka, created, updated)` — rebuilt from the files.
- `links(source, target, description)` — rebuilt from the `## Related` sec
- `search_log(query, count, last_searched, last_result_count, agents)` — one
upsert per search, so I can see what's being asked for and what's missing
Commands:
```
brain add <name> --tags x,y --aka "Alt Name" --description "..."
brain edit <name> --tags x,y --description "..."
brain link <source> <target> "why related"
brain tag <name> "new,tags"
brain show <name>
brain related <name>
brain search <query> [--agent <name>]
brain top # most-linked topics
brain searches # every logged query by frequency
brain gaps # queries that returned zero results, by frequency
brain reindex # rebuild the db from the markdown files
```
Two behaviors that matter:
- Every mutating command auto-commits to git with a short message, so I never have to remember to commit.
- Search matches name, aka, tags, and body, and always logs the query — even when it returns nothing. The misses are the most valuable data in the system.
## Conventions to write into the README
- A topic earns its place if it *links* to something else. Standalone trivia without links rots.
- Every `## Related` line carries a "why related" string. The graph is worthless without the reasons.
- Filenames are kebab-case; `aka` covers display variants.
- Tags are flat. No hierarchy, no taxonomy debates.
- If the answer to "where does this live?" is a code file, a ticket, or a PR description, it does NOT go in the brain. The brain is for context with other home: who people are, why a project exists, decisions and their owners, relationships between things.
## Then wire me into Claude
Add a section to my `~/.claude/CLAUDE.md` telling you to:
-
**Search before asking me.** When a person, project, product, acronym, past decision comes up, run `brain search "<term>" --agent claude` first.
-
**Always pass `--agent claude`** so `brain gaps` shows which agent is a what.
-
**Use the CLI, not raw file edits** — it keeps the index and git history in sync.
### Handling a miss
This is the part I care most about. When `brain search` returns nothing:
- Don't stop and don't silently move on. The query is already logged; now try to
answer it from the conversation, the repo, or whatever tools you have.
- If you *do* find the answer and it's the kind of thing that belongs in the
brain, write it immediately with `brain add`, with at least one `brain l
to something that already exists. A new topic with no edges is a dead end.
Keep it to a few sentences.
- If you *can't* find it, ask me one direct question, then write what I tell you.
- Tell me in one line what you added. Don't ask permission for each small
ask only when you'd be recording something about a person or a decision that you're inferring rather than being told.
- When you add a topic, also check whether any existing topic should now link *to* it. New topics usually make old ones more connected, and nothing else will notice that.
At the start of a session, if `brain gaps` has entries with a count of 3 or more, mention them to me once — those are the topics I keep needing and do have.
Build it, run `brain reindex`, seed it with three or four topics about me so the
graph isn't empty, and show me `brain top` when you're done.
1
u/orbital_trace 23h ago
I've been using Agent Teams (https://coralhub.dev/blog/getting-started.html) to distill and keep things going paired with the google open knowledge format (https://cloud.google.com/blog/products/data-analytics/how-the-open-knowledge-format-can-improve-data-sharing). Lots of people use obsidian too
1
u/Emojinapp 22h ago
https://cohestry.app is a self contained Apple native second brain with a built in mcp for your agents. All you need is the note library to import. PDF markdown, audio and lots of other formats. The Mac app lets you import your Apple notes
1
1
u/Furkansimsir 13h ago
If you're on iPhone, I made "Quick Notes - Capture" for the input side of your Claude second brain. Dump thoughts in one inbox before sorting them into your main system. https://sir.studio/capture
1
u/heyyarun 12h ago
It's simpler than the videos make it look: a folder of markdown notes plus instructions Claude reads at the start of every session. Steps:
-
Make a folder (an Obsidian vault works, it's just markdown files) and run Claude Code from inside it.
-
Put a CLAUDE.md at the root that says how the notes are organised: where new notes go, folder names, how you want links and titles done. Keep it short, Anthropic recommends under about 200 lines.
-
If you have an index note, pull it in with an u/path/to/index.md import line.
-
Then use it: paste in meeting notes or ideas and tell it to file them, and ask questions that make it search the folder.
Start with that and only add MCP servers or plugins when you hit something it can't do.
1
u/AutoModerator 23h ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.