Build an AI Second Brain with Ollama
Turn scattered notes into a cross-linked wiki using free local AI.
Introduction
30 Second Summary
Your best ideas are scattered across a dozen tools, from chat logs to meeting notes to project docs. None of them talk to each other.
In this project, you will use Ollama and Claude Code to build a free AI-powered second brain inside Obsidian. Your scattered notes get compiled into a structured, cross-linked wiki you can search, query, and grow over time.
What You'll Build
A personal AI second brain using Karpathy's LLM Wiki pattern, running entirely on free Ollama models inside an Obsidian vault.
By the end of this project, you'll have:
- An Obsidian vault with a clear separation between raw source material and AI-curated wiki pages.
- A CLAUDE.md schema file and four slash commands (/ingest, /query, /lint, /log) that power your second brain workflow.
- Real notes from your existing tools compiled into a cross-linked wiki with concept pages, people dossiers, and project pages.
- A model comparison guide documenting which Ollama model works best for each command (Secret Mission).
Are there any prerequisites?
This project assumes you're on macOS with Homebrew already installed. You'll also need a free Ollama account for cloud model access. No paid subscriptions are required.
Install Your Tools
Your AI second brain runs on three free tools working together. Obsidian stores your wiki as local Markdown files. Ollama provides the AI models. Claude Code acts as the agent that reads, writes, and cross-links your notes.
In this step, you will install all three tools and make sure they can talk to each other. By the end, you will have Claude Code running with an Ollama model, ready to start building your vault.
In this step, get ready to:
- Install Obsidian and create your second-brain vault.
- Install Ollama and pull your first AI model.
- Install Claude Code and connect it to Ollama.
Install Obsidian
Obsidian is a note-taking app that stores everything as plain Markdown files on your computer. It will be the visual home for your wiki.
- Open your web browser and go to obsidian.md/download.
- Click the macOS download button to download the installer.
- Open the downloaded .dmg file.
- Drag Obsidian into the Applications folder.
- Press Cmd+Space to open Spotlight.
- Type Obsidian and press Enter to open it.
Obsidian opens to its vault manager. A vault is just a folder where Obsidian stores all your notes.
- To the right of Create new vault, click Create.
- In the Vault name field, type second-brain.
- Click Browse and select your Documents folder.
- Click Create.
You should see an empty vault with a sidebar on the left and either a welcome message or an empty editor in the main area.
Obsidian not opening?
macOS may block the app because it was downloaded from the internet. Open System Settings, go to Privacy & Security, and click Open Anyway next to the Obsidian warning.
help me open Obsidian on my Mac
Install Ollama and pull a model
Ollama is the engine that runs AI models on your machine or connects to free cloud-hosted models. It powers all of Claude Code's intelligence in this project.
- Press Cmd+Space to open Spotlight.
- Type Terminal and press Enter to open it.
- Install Ollama using Homebrew by running this command:
brew install ollama
- Verify the installation by running:
ollama --version
You should see a version number in the output.
Seeing 'command not found: brew'?
This means Homebrew is not installed. This project requires Homebrew as a prerequisite. Visit brew.sh and follow the install instructions, then come back and try again.
help me install Homebrew on my Mac
Ollama offers two kinds of models. Cloud models run on Ollama's servers and are much more capable. Local models run entirely on your Mac with no internet required.
Cloud models require a free Ollama account. Let's sign in now so you can use them later.
- Sign into your Ollama account by running this command:
ollama signin
What happens when you sign in?
Ollama opens a browser window where you can sign in or create a free account on ollama.com. After you sign in, the terminal confirms you are authenticated. Cloud model access is now enabled for any ollama command you run.
Browser not opening?
The terminal prints a URL you can use manually. Copy the URL and paste it into your browser. If you already have an account, use the email address you signed up with.
help me sign into Ollama
Next, pull a local model as a fallback for when you want to work offline or when the cloud tier's session limits are reached.
- Download the qwen3.5 model by running this command:
ollama pull qwen3.5
You should see a progress bar as the model downloads. This is a 6.6GB download, so it may take a few minutes depending on your connection.
Why qwen3.5?
At the 9B parameter size that fits comfortably on 16GB of RAM, Qwen 3.5 outperforms other local options on text benchmarks. It also supports 256K context, which is ideal for processing long notes. This model is on Ollama's recommended list for Claude Code compatibility.
Download stalled or running out of space?
Make sure you have at least 7GB of free disk space. If the download stalls, press Ctrl+C to cancel and run ollama pull qwen3.5 again. Ollama resumes from where it left off.
help me download an Ollama model
Here are the six models Ollama recommends for use with Claude Code. You will experiment with these throughout the project.
Your model options
Cloud models (run on Ollama's servers, free tier):
- kimi-k2.5:cloud - recommended starting point for this project.
- glm-5:cloud - strong alternative cloud model.
- minimax-m2.7:cloud - another capable cloud option.
- qwen3.5:cloud - cloud version of the local model you just downloaded.
Local models (run on your Mac, no internet needed):
- glm-4.7-flash - lightweight local model.
- qwen3.5 - the one you just downloaded.
Cloud models are more capable but have session limits that reset every 5 hours and weekly limits that reset every 7 days. Local models have no limits but lower quality.
Install Claude Code and connect it to Ollama
Claude Code is an AI coding agent that can read files, create folders, and run commands in your terminal. In this project, it manages your entire vault on your behalf.
- Install Claude Code by running this command:
curl -fsSL https://claude.ai/install.sh | bash
What does this command do?
This downloads the Claude Code install script from Anthropic and runs it. The installer places the claude binary at ~/.local/bin/claude and updates your shell's PATH automatically.
- Verify the installation by running:
claude --version
You should see a version number in the output.
Seeing 'command not found: claude'?
The installer may not have updated your current terminal session. Close Terminal completely and reopen it, then try claude --version again.
help me fix Claude Code not being found after install
Now you need to start the Ollama server with a custom context length. Ollama defaults to only 4K tokens of context on machines with less than 24GB of RAM.
Claude Code needs at least 64K tokens to work properly. Without the override, Claude Code will either fail outright or produce truncated results.
This is the most common setup issue
If you skip the context length override and run Ollama with its default 4K context, Claude Code will produce broken results. The command below sets the context to 64K tokens.
- Open a new terminal tab by pressing Cmd+T.
- Start the Ollama server with the correct context length by running this command:
OLLAMA_CONTEXT_LENGTH=64000 ollama serve
What is happening here?
OLLAMA_CONTEXT_LENGTH=64000 temporarily sets an environment variable that tells Ollama to allow up to 64K tokens of context per request. ollama serve starts the local API server that Claude Code connects to.
This command blocks the terminal tab. It needs to keep running in the background for the rest of the project. Do not close this tab.
Seeing 'address already in use'?
Ollama may have auto-started a server when you installed it. Stop the existing server first by running pkill ollama in a separate tab, then try the command again.
help me stop the existing Ollama server
- Open another new terminal tab by pressing Cmd+T.
- Launch Claude Code with a cloud model by running this command:
ollama launch claude --model kimi-k2.5:cloud
What if I want to use a local model instead?
Replace the cloud model name with qwen3.5 to run everything on your machine:
ollama launch claude --model qwen3.5
Local models are slower and less capable, but they work without an internet connection and have no usage limits.
You should see Claude Code's interactive prompt appear in your terminal. It may ask you to log in on first use. Follow the browser prompts if it does.
Claude Code not starting?
Make sure the ollama serve tab is still running. If you accidentally closed it, go back and run OLLAMA_CONTEXT_LENGTH=64000 ollama serve in a new tab first.
If you see a message about needing to sign in for cloud models, run ollama signin in a separate tab and try again.
help me launch Claude Code with Ollama
All three tools are installed and talking to each other. In the next step, you will build the folder structure that separates your raw notes from your AI-curated wiki.
Build Your Vault Structure
Your tools are installed and ready to go. Now it's time to build the foundation your AI second brain sits on.
Every knowledge base needs a clear separation between raw input and curated output. You'll use Claude Code to scaffold a folder architecture that keeps your messy source material apart from polished wiki pages.
In this step, get ready to:
- Navigate to your vault and launch Claude Code with Ollama.
- Use Claude Code to create the raw/ and wiki/ folder hierarchy.
- Verify the new folder structure in Obsidian.
Navigate to your vault and start Claude Code
The Ollama server you started in Step 1 needs to keep running in its own terminal tab. You'll work from a second tab for the rest of the project.
- Open a new terminal tab by pressing Cmd+T. Keep the tab running ollama serve open in the background.
- Navigate to your vault folder by running this command:
cd ~/Documents/second-brain
- Launch Claude Code with Ollama by running this command:
ollama launch claude --model kimi-k2.5:cloud
You should see Claude Code's interactive prompt appear in your terminal.
Claude Code not starting?
- Make sure the ollama serve tab is still running. If you closed it, open a new tab and run OLLAMA_CONTEXT_LENGTH=64000 ollama serve again.
- If you see an authentication error, run ollama signin first. Cloud models require a free Ollama account.
- If cloud models aren't working, try the local model instead: ollama launch claude --model qwen3.5.
- Why can't I connect to Ollama's cloud models?
Ask Claude Code to scaffold the structure
Your vault needs two top-level folders. raw/ holds source material imported from your tools. wiki/ holds the AI-curated pages that Claude Code compiles from those sources.
Pro tip: customize your sources
The prompt below lists four common tools under raw/: Claude, ChatGPT, Notion, and Granola. Before you paste, edit the subfolder names to match the tools you actually use. Remove any you don't need, or add others like apple-notes-exports/ or google-docs-exports/.
- Paste this prompt into Claude Code:
Create the following folder structure in my Obsidian vault:
raw/
claude-exports/
chatgpt-exports/
notion-exports/
granola-exports/
README.md
wiki/
concepts/
people/
projects/
index.md
log.md
README.md
Rules:
- Add a README.md inside every folder (including subfolders) explaining its purpose in 2-3 sentences.
- index.md should have a "Wiki Index" heading and a note that it will be auto-populated by the /ingest command.
- log.md should have an "Activity Log" heading and a note that entries will be appended automatically.
What is the raw/ vs wiki/ pattern?
This architecture comes from Andrej Karpathy's LLM Wiki pattern. The idea is simple: raw inputs and curated outputs live in completely separate spaces.
- raw/ is the junk drawer. Conversation exports, meeting notes, rough ideas. You never edit these files directly.
- wiki/ is the library. Claude Code reads from raw/ and compiles structured, cross-linked pages here.
- index.md acts as the master catalog of everything in your wiki.
- log.md tracks every action Claude Code takes, so you always have a paper trail.
- Claude Code shows you which files it plans to create and asks for permission. Type y to approve each file.
After you approve, Claude Code creates all the folders, README files, index.md, and log.md. It prints a summary of everything it made.
Claude Code didn't create the files?
- Make sure you ran cd ~/Documents/second-brain before launching Claude Code. If Claude Code started from the wrong folder, it creates the files in the wrong place.
- If Claude Code's response was cut off or incomplete, paste the prompt again. It picks up where it left off.
- Help me figure out why Claude Code isn't creating my vault files.
Verify your vault in Obsidian
Obsidian watches your vault folder for changes in real time. The folders Claude Code just created should already be visible.
- Switch to Obsidian.
- In the left sidebar, expand the raw/ folder. You should see subfolders for each tool you listed, plus a README.md.
- Expand the wiki/ folder. You should see concepts/, people/, projects/, index.md, log.md, and a README.md.
- Open the Graph View by pressing Cmd+G.
The graph is sparse right now. You should see a handful of disconnected nodes, one for each Markdown file. By the end of this project, those nodes will form a dense, interconnected web.
Folders not showing in Obsidian?
- Click the vault name at the bottom-left of Obsidian's sidebar to confirm you're viewing the second-brain vault. If you see a different vault name, click it and switch to second-brain.
- If the sidebar is collapsed, click the arrow icon at the top-left to expand it.
- Verify the files exist on disk by running ls ~/Documents/second-brain in a terminal. If you see raw and wiki listed, the files are there and Obsidian should pick them up.
- Why aren't my vault folders showing up in Obsidian?
Your vault skeleton is in place. Next up, you'll create the schema and slash commands that teach Claude Code the rules of your second brain.
Create the Schema and Slash Commands
Your vault has a clean folder structure, but Claude Code doesn't know the rules yet. Without guidance, it would create pages in random formats with no consistent linking or metadata.
You'll fix that by creating a CLAUDE.md schema file that acts as a rulebook Claude reads every time it starts. You'll also create four slash commands that become the core verbs of your second brain.
In this step, get ready to:
- Create a CLAUDE.md schema file that defines your vault's rules and page conventions.
- Build four slash commands: /ingest, /query, /lint, and /log.
- Restart Claude Code and verify the commands load correctly.
Generate the CLAUDE.md schema
CLAUDE.md is a special file that Claude Code reads automatically when it starts. It tells Claude how your vault is organized, what metadata every wiki page needs, and how to write in your preferred style.
- Paste this prompt into your Claude Code session to generate the schema file:
Create a file called CLAUDE.md in the vault root with these four sections:
## Project Structure
Document the raw/ vs wiki/ folder hierarchy. Explain that raw/ holds unprocessed source material (exports, notes, transcripts) and wiki/ holds curated, cross-linked pages organized into concepts/, people/, and projects/.
## Page Conventions
Every wiki page must include YAML frontmatter with these fields:
- title: page title
- created: ISO date
- updated: ISO date
- source: path to the raw file this was derived from
- tags: list of topic tags
- links: list of [[wiki-links]] to related pages
Define four page types: concept (one idea per page), person (dossier of a person), project (project overview), and source-summary (summary of a raw source file).
## Style Guide
- Write in second person.
- Keep paragraphs to 2-3 sentences.
- Always cross-link related concepts using [[wiki-links]].
- Prefer atomic notes: one concept per page.
- Use headers to structure long pages.
## Domain Context
Before writing this section, ask me 2-3 questions about what I work on, what topics I care most about, and what I want this wiki to help me with. Then write this section based on my answers.
What does this prompt do?
This prompt creates a rulebook for Claude Code with four sections:
- Project Structure maps out the raw/ vs wiki/ separation so Claude knows where to read and write.
- Page Conventions defines the YAML frontmatter fields every wiki page needs (title, dates, tags, links).
- Style Guide sets the writing rules: short paragraphs, atomic notes, and cross-linking with [[wiki-links]].
- Domain Context personalizes the schema to your specific work and interests.
Claude Code will pause and ask you 2-3 questions about your domain before finishing the file. These questions help it tailor the Domain Context section to your actual work.
- Answer Claude's questions about what you work on, what topics matter to you, and what you want the wiki to help with.
- Approve the file creation when Claude Code asks for permission.
- Switch to Obsidian and check the left sidebar. You should see CLAUDE.md listed at the vault root.
- Click on CLAUDE.md to open it. You should see four clearly labeled sections with your personalized Domain Context at the bottom.
Don't see CLAUDE.md in Obsidian?
- Make sure you approved the file creation in Claude Code. Look for a permission prompt you may have missed.
- Check that your Claude Code session is running from the ~/Documents/second-brain directory. If Claude started in a different folder, it created the file there instead.
- Try clicking the vault name at the top of Obsidian's sidebar to refresh the file list.
Still stuck? Ask for help.
What is YAML frontmatter?
Frontmatter is a block of metadata at the top of a Markdown file, wrapped in --- delimiters. Obsidian reads these fields and displays them in a Properties panel at the top of each page.
Your schema tells Claude to include fields like title, tags, and links in every wiki page. This makes pages searchable, filterable, and interconnected.
Create the slash commands
Slash commands are reusable prompts stored as files. When you type /ingest in Claude Code, it reads the matching command file and executes those instructions. This turns complex, multi-step workflows into single-word actions.
- Paste this prompt into Claude Code to create all four command files:
Create four slash command files under .claude/commands/:
1. ingest.md - Slash command: /ingest [N]
Reads up to N files from raw/ (all files if N is omitted). For each file, creates or updates wiki pages in the appropriate wiki/ subfolder (concepts/, people/, projects/). Adds [[wiki-links]] between related pages. Updates wiki/index.md with new entries. Appends a timestamped summary to wiki/log.md.
2. query.md - Slash command: /query <question>
Searches wiki/ pages to answer the question. Cites source pages with [[wiki-links]]. Synthesizes across multiple sources. Flags any contradictions or disagreements between sources.
3. lint.md - Slash command: /lint
Scans the entire wiki/ for: broken [[wiki-links]], orphan pages with no inbound links, pages missing required frontmatter fields, and pages not updated in over 30 days. Reports all issues found and offers to fix them.
4. log.md - Slash command: /log <note>
Appends a timestamped entry to wiki/log.md with the provided note. Useful for capturing quick thoughts without creating a full wiki page.
What does each command do?
- /ingest is the core command. It reads your raw source files and compiles them into structured wiki pages with cross-links.
- /query lets you ask questions across your entire wiki. It cites sources and flags disagreements between them.
- /lint is a health check. It finds broken links, orphan pages, and missing metadata so your wiki stays clean.
- /log is a quick-capture tool. It adds timestamped notes to wiki/log.md without creating a full page.
- Approve each file creation when Claude Code asks for permission.
- Switch to Obsidian and check the sidebar. You should see a .claude folder containing a commands subfolder with four files: ingest.md, query.md, lint.md, and log.md.
Pro tip: hidden folders in Obsidian
If you don't see the .claude folder in Obsidian, it may be hidden by default. Open Settings, go to Files and links, and toggle on Detect all file extensions. You can also verify the files exist by running ls .claude/commands/ in your terminal.
Missing one or more command files?
- Check whether Claude Code hit a rate limit or session limit partway through. If it stopped mid-creation, paste the prompt again and ask it to create only the missing files.
- Verify the files are in the correct location. They should be at .claude/commands/ inside your vault root, not somewhere else.
Need more help troubleshooting?
Restart and test your commands
Claude Code only reads slash command files when it starts up. Since you just created the command files, you need to restart Claude Code for it to discover them.
- Type /exit in Claude Code to close the current session.
- Restart Claude Code by running this command in your terminal:
ollama launch claude --model kimi-k2.5:cloud
Why restart?
Claude Code scans the .claude/commands/ directory and reads CLAUDE.md at launch time. Any files you add while Claude Code is already running won't take effect until the next startup.
Now verify that Claude Code loaded your schema and commands correctly.
- Test your setup by pasting this prompt into the new Claude Code session:
List the available slash commands and summarize the rules from CLAUDE.md.
- You should see Claude list all four commands (/ingest, /query, /lint, /log) and describe the vault rules from your schema. If it mentions the four YAML frontmatter page types and the raw/ vs wiki/ separation, everything is working.
Claude doesn't recognize the slash commands?
- Make sure you exited and restarted Claude Code. Typing /exit and relaunching is required for new command files to load.
- Confirm the command files are in .claude/commands/ (not claude/commands/ without the dot). The dot at the start is required.
- Check that your ollama serve tab is still running in the background. If it stopped, restart it with OLLAMA_CONTEXT_LENGTH=64000 ollama serve before relaunching Claude Code.
Still not working? Ask for help.
Your second brain now has a rulebook and four commands ready to go. Next up, you'll import your real notes and conversations from tools like Claude, ChatGPT, or Notion into the raw/ folder.
Import Your Source Material
In the previous step, you created a CLAUDE.md schema and four slash commands that teach Claude Code how to manage your vault. Your second brain now has rules, but it has nothing to think about yet.
In this step, you'll export notes from the tools you already use and bring them into your vault's raw/ folder. Even 5-10 items from a single tool is enough to build a meaningful wiki.
In this step, get ready to:
- Export conversations or notes from your existing tools.
- Convert exported files to clean Markdown with YAML frontmatter.
- Verify the imported files in Obsidian.
Export your conversations
Your raw material can come from any tool where you've been capturing knowledge. Pick the tool you use most and export your conversations or notes from it.
How many items do I need?
You do not need to export everything. Start with 5-10 conversations or notes from a single tool. You can always add more later. The goal right now is to give your second brain enough material to produce a meaningful wiki.
Claude
Claude exports your full conversation history as a JSON archive. The file is not human-readable on its own, but Claude Code will parse it for you in the next substep.
- Open claude.ai in your browser and sign in.
- Click your initials in the bottom-left corner.
- Click Settings.
- Click Privacy.
- Click Export data.
- Check your email for a download link from Anthropic. The link expires after 24 hours.
- Click the download link in the email and save the ZIP file.
- Unzip the file. Inside you'll find JSON files containing your full conversation history.
Pro tip: export can take a few minutes
There may be a short delay while Claude generates the export. If the download link expires, repeat the export process to get a fresh link.
ChatGPT
ChatGPT exports your entire conversation history as a ZIP file containing a conversations.json file. This is densely nested JSON that Claude Code will convert into readable Markdown in the next substep.
- Open chatgpt.com in your browser and sign in.
- Click your profile icon in the bottom-left corner.
- Click Settings.
- Click Data Controls.
- Click Export under the Export Data section.
- Click Confirm export in the confirmation dialog.
- Check your email for a download link from OpenAI. This can take anywhere from a few minutes to a few hours.
- Click Download data export in the email and save the ZIP file. The link expires after 24 hours.
- Unzip the file. The main file you need is conversations.json.
Notion
Notion can export your entire workspace as Markdown and CSV files, which is the most useful format for your second brain.
- Open notion.so in your browser and sign in.
- Click Settings in the left sidebar.
- Under Workspace, select General.
- Click Export all workspace content.
- Choose Markdown & CSV as the export format.
- Click Export.
- Check your email for a download link from Notion. The link expires after 7 days.
- Download and unzip the file. You'll see Markdown files for your pages and CSV files for any databases.
Granola
Granola exports meeting note summaries as a CSV file. Full transcript bulk export is not supported yet, but the summaries contain enough context for your wiki.
- Open the Granola desktop app.
- Click Settings.
- Click Edit profile at the top of the sidebar.
- Click Generate CSV.
- Select the workspaces you want to include.
- Check your email for the CSV download link. It typically arrives within a few hours and expires after 24 hours.
- Download and save the CSV file.
What about full transcripts?
Granola does not support bulk transcript export yet. You can copy individual transcripts by opening a note, expanding the transcription box, and clicking the Copy button. Paste each one into a .txt file and save it to your Downloads folder.
Other Tools
If you use a different tool for notes or knowledge capture, the goal is the same. Get your content out in any text-based format.
- Check your tool's settings for an export or download option.
- Export as Markdown, plain text, CSV, or JSON if possible.
- If no export exists, copy and paste your most important notes into .txt or .md files manually.
- Save the exported files to your Downloads folder.
Once your exported files are saved to your Downloads folder, head back to your terminal where Claude Code is running.
- Ask Claude Code to move your exported files into the vault by pasting this prompt:
Move any exported files from ~/Downloads into the matching raw/ subfolder in my vault. If a matching subfolder doesn't exist yet, create one. Unzip any ZIP files first, then organize the contents into the right subfolder based on the source tool (e.g. raw/claude-exports/, raw/chatgpt-exports/, raw/notion-exports/, raw/granola-exports/).
- Review the file operations Claude Code proposes and approve them when prompted.
What does this prompt do?
Claude Code scans your Downloads folder for the files you just exported. It unzips any ZIP archives, identifies which tool each file came from, and moves everything into the correct raw/ subfolder inside your vault. This keeps your source material organized by origin.
Claude Code can't find your files?
- Make sure the exported files are in ~/Downloads, not in a nested subfolder. Some browsers save to a subfolder like ~/Downloads/chrome-downloads.
- If you renamed the files after downloading, mention the new filenames in your prompt so Claude Code knows what to look for.
- Help me find and move my exported files into the vault.
Convert exports to clean Markdown
Your exported files are in their raw format. JSON conversation logs and CSV spreadsheets are not readable in Obsidian. Claude Code can parse these files and create clean Markdown files with YAML frontmatter that Obsidian understands.
- Paste this conversion prompt into Claude Code:
Scan all subfolders inside raw/ for non-Markdown files (JSON, CSV, HTML, or plain text). Parse each file and extract individual conversations or notes. For each one, create a clean Markdown file with YAML frontmatter that includes three fields: source, date, and topic. Write the new Markdown files alongside the originals in the same subfolder. Keep the original files intact.
- Review the conversion plan Claude Code proposes and approve the script execution.
What does this conversion do?
- Claude Code reads each raw file and identifies individual conversations or notes inside it.
- For each conversation, it creates a separate .md file with a descriptive filename.
- Each file gets YAML frontmatter at the top with source (which tool it came from), date (when the conversation happened), and topic (a short summary).
- The original exported files are preserved. Nothing is deleted.
What is YAML frontmatter?
Frontmatter is a block of metadata at the very top of a Markdown file, surrounded by --- lines. Obsidian reads this metadata and displays it as a Properties panel at the top of the note. It lets you tag, filter, and organize your notes without cluttering the actual content.
Conversion taking too long or failing?
- Large exports (hundreds of conversations) can take several minutes to process. Let Claude Code work through them.
- If you hit a cloud model rate limit, wait 5 minutes and try again. The free tier resets session limits every 5 hours.
- If a specific file fails to parse, ask Claude Code to skip it and move on to the rest.
- Help me troubleshoot my file conversion.
Verify your files in Obsidian
Your converted Markdown files should now be sitting in the raw/ subfolders alongside the original exports. Time to confirm everything looks right in Obsidian.
- Switch to Obsidian.
- In the left sidebar, expand the raw/ folder and its subfolders.
- Confirm that .md files appear alongside the original exported files.
- Click on 2-3 of the .md files and check that they have readable content.
- Look for the Properties panel at the top of each note. You should see source, date, and topic fields displayed there.
What is the Properties panel?
When a Markdown file has YAML frontmatter, Obsidian displays it as a Properties panel at the top of the note instead of showing raw --- syntax. This makes your metadata easy to read and edit without touching the Markdown source.
Not seeing any .md files?
- Make sure the conversion prompt finished running in Claude Code. Check the terminal for any error messages.
- Click anywhere in Obsidian's sidebar and wait a moment. Obsidian indexes new files automatically but may take a few seconds.
- If files appear in Finder but not in Obsidian, close and reopen the vault from Obsidian > Open another vault, then reselect second-brain.
- Help me find my converted Markdown files.
Your vault now has real knowledge inside it. Next up, you'll run the /ingest command to compile these raw notes into a structured, cross-linked wiki.
Run the Ingest and Explore Your Wiki
Your raw/ folder is now loaded with notes from your everyday tools. Right now, though, they're just a pile of Markdown files sitting in separate folders with no connections between them.
The /ingest command changes that. It reads each source file, extracts the key concepts, people, and projects, then writes cross-linked wiki pages that tie everything together.
In this step, get ready to:
- Run a demo ingest on 2 sources to test the workflow.
- Run the full ingest to compile all your notes into wiki pages.
- Explore the cross-linked wiki and knowledge graph in Obsidian.
Run a demo ingest
Starting with a small test lets you see how the ingest workflow works before committing to a full run. The /ingest command accepts an optional number to limit how many source files it processes.
- In Claude Code, type the following command to ingest only 2 source files:
/ingest 2
What happens during an ingest?
- Claude Code reads source files from your raw/ subfolders.
- For each source, it creates a summary page and extracts key concepts, people, and projects.
- It writes new wiki pages under wiki/concepts/, wiki/people/, and wiki/projects/.
- It adds [[wiki-links]] between related pages and updates wiki/index.md and wiki/log.md.
- Approve any file creation prompts that Claude Code shows you.
Watch the output as Claude Code works. You should see it creating files under wiki/ and reporting which pages it created or updated.
- Switch to Obsidian and check the left sidebar for new files under wiki/.
- Open wiki/index.md and confirm it lists your first two ingested sources.
- Open wiki/log.md and confirm it has timestamped entries for the ingest run.
Slash command not recognized?
- Slash commands only load when Claude Code starts. If you added the commands without restarting, type /exit and relaunch with ollama launch claude --model kimi-k2.5:cloud.
- Make sure you're running Claude Code from inside your second-brain vault folder. The .claude/commands/ directory needs to be in the working directory.
- If you see truncated or garbled output, confirm your ollama serve tab is still running with OLLAMA_CONTEXT_LENGTH=64000.
- Help me troubleshoot why my /ingest command isn't working in Claude Code with Ollama.
Run the full ingest
Your demo run confirmed the workflow works. Now it's time to process all remaining source files.
- Run the full ingest by typing this command into Claude Code:
/ingest
What if I have a lot of source files?
Claude Code processes sources in batches. If you have many files, you can re-run /ingest as many times as needed to work through all of raw/. Each run picks up where the last one left off.
If you're using a cloud model, you may hit the free tier's session limits. These reset every 5 hours, so take a break and come back.
- Switch to Obsidian and press Cmd+G to open Graph View.
You should see nodes appearing as Claude Code creates wiki pages. Each node is a page, and each line connecting two nodes is a [[wiki-link]] between them.
Graph View looks empty or has no connections?
- Obsidian sometimes takes a moment to index new files. Close and reopen Graph View with Cmd+G.
- Check that your wiki pages contain [[double-bracket links]]. Open any page under wiki/concepts/ and look for links in the body text.
- If the ingest finished but created very few pages, re-run /ingest to process remaining sources.
- Help me figure out why my Obsidian Graph View isn't showing connections between my wiki pages.
Explore the results
Your scattered notes are now a structured knowledge graph. Time to see what your second brain looks like from the inside.
- Open wiki/index.md in Obsidian's sidebar. This is your master catalog listing every wiki page that was created.
- Open wiki/log.md to see the timestamped activity record. Each ingest run is logged here with what was processed.
- Browse the wiki/concepts/ folder to see concept pages that Claude Code extracted from your notes.
- Browse wiki/people/ for people dossiers and wiki/projects/ for project pages.
- Click any [[wiki-link]] inside a page to jump to the connected page. This is how you navigate your second brain.
What are all these page types?
- Concept pages capture ideas, frameworks, and technical topics. If three of your notes mention "retrieval augmented generation," you get one concept page that synthesizes all three perspectives.
- People dossiers collect everything you've noted about a person across all your sources into one page.
- Project pages group notes related to a specific initiative or piece of work you're doing.
- Each page has YAML frontmatter at the top with metadata like the source, date, and tags.
- Press Cmd+G to open Graph View one more time.
You should see a web of interconnected nodes. Each cluster of tightly connected nodes represents a topic area from your notes. Hover over any node to highlight its connections.
Secret mission
Model Showdown and Full Command Suite
You've built your wiki with one model, but is it the best one for the job? Try at least three different Ollama models and compare their wiki output. Then create a config.md that documents which model works best for each slash command.
Before you go
Clean Up Your Resources
Decide whether to keep your resources running, pause them to come back later, or delete them entirely. This project runs entirely on free, local tools with no ongoing costs.
Resources you used:
- Obsidian vault directory stored locally in ~/Documents/second-brain (no cost).
- Ollama installed via Homebrew (free, runs locally plus free cloud tier).
- Claude Code installed via shell script (free when used through Ollama).
- Downloaded model files stored locally (~6.6GB for qwen3.5).
Keep everything running
No action needed. Choose this if you're still actively building your second brain and want everything ready to go.
- Your vault and all files are stored locally on your machine.
- The Ollama cloud tier is free for light usage. Session limits reset every 5 hours and weekly limits reset every 7 days.
- You can keep adding to your vault anytime by launching Claude Code from your vault folder.
Pause - I'll come back to this later
Shut down running processes to free up memory. Your vault files, CLAUDE.md, and all exports remain on your machine.
- Type /exit in Claude Code to close it cleanly.
- Stop the Ollama server by pressing Ctrl+C in the terminal tab running ollama serve.
- To resume, start the Ollama server in one tab:
OLLAMA_CONTEXT_LENGTH=64000 ollama serve
- Then launch Claude Code from your vault folder in a second tab:
cd ~/Documents/second-brain
ollama launch claude --model kimi-k2.5:cloud
Delete - I don't want to use this again
Remove all project resources and start fresh. This permanently deletes your vault, wiki pages, and downloaded models.
- Type /exit in Claude Code to close it.
- Delete the vault:
rm -rf ~/Documents/second-brain
- Remove the downloaded model:
ollama rm qwen3.5
- Optionally uninstall Ollama:
brew uninstall ollama
- Optionally uninstall Obsidian by dragging it from your Applications folder to the Trash.
Mission accomplished
That's a Wrap!
You just built a fully functional AI second brain that runs entirely on free tools. Your scattered notes from Claude, ChatGPT, Notion, Granola, or wherever else you think now live in a structured, cross-linked wiki you can query, lint, and grow over time.
Here's what you learned:
- Set up an Obsidian vault with Karpathy's raw/wiki architecture and wrote a CLAUDE.md schema that teaches the AI the rules of your vault.
- Built four slash commands (/ingest, /query, /lint, /log) powered by Ollama and Claude Code at zero cost.
- Imported real notes from your everyday tools and compiled them into concept pages, people dossiers, and project pages connected through a visual knowledge graph.
- Compared multiple Ollama models in the Secret Mission and documented which model works best for each command in config.md.
Ready to quiz yourself?