Connect Obsidian Vault to Claude Code

Link your Obsidian vault to Claude Code for persistent app context.

Introduction

30 Second Summary

Every time you start a coding session with an AI assistant, you spend the first few minutes re-explaining your app's architecture, tech stack, and past decisions. That wasted context adds up fast.

In this project, you will build a structured Obsidian vault that stores your sleep app's knowledge, then connect it to Claude Code so it loads your app's full context automatically at every session start.

What You'll Build

A knowledge vault connected to Claude Code via the --add-dir flag, giving your AI assistant persistent memory about your sleep tracker app while you work in your project folder.

By the end of this project, you'll have:

  • A structured Obsidian vault storing your sleep app's architecture, decisions, and coding conventions.
  • Custom rules and a frontend UI skill that Claude Code loads automatically to follow your conventions and build sleep-themed components.
  • A one-line shortcut command that connects your vault to Claude Code from your app project folder.
  • Secret Mission: Create a "save decision" skill so Claude Code writes architectural decisions back to your vault on command.

Are there any prerequisites?

You need Claude Code installed and working, Obsidian installed, VS Code installed, and an active app project (like a sleep tracker). No cloud accounts or paid services are needed beyond your existing Claude Code subscription.

Set Up Your Vault Structure

For Claude Code to work effectively on your sleep app, it needs context about your project. Right now, every time you start a session, Claude Code re-reads your codebase to figure out what you're building.

Your Obsidian vault will become your app's "second brain." In this step, you'll create the folder structure that organizes your app's context, decisions, and custom skills into a layout Claude Code can read.

In this step, get ready to:
  • Create the folder structure in your Obsidian vault.
  • Add a .claudeignore file to keep Obsidian's internal config hidden from Claude Code.
  • Fill in an about-me.md note with your project details.
Open Obsidian and create your folder structure

Your vault needs a consistent structure so Claude Code always knows where to find your app's architecture, coding rules, and reusable skills. Here's the target layout you'll create:

your-vault/
  App/
    decisions/
  Context/
    about-me.md
  .claude/
    rules/
    skills/
  .claudeignore

What is each folder for?

  • App/ stores everything about your sleep tracker app (specs, architecture, decisions).
  • App/decisions/ holds records of technical choices you've made and why.
  • Context/ holds general info about you and your preferences.
  • .claude/rules/ contains conventions Claude Code auto-loads and follows.
  • .claude/skills/ contains reusable skills Claude Code can invoke.
  • Press the Windows key to open your search bar.
  • Type Obsidian and press Enter to open it.
  • Open your existing vault from the vault picker (or it opens automatically if you only have one vault).

Now create the folders that Obsidian can manage directly.

  • In Obsidian's left sidebar, right-click in the file explorer panel.
  • Click New folder.
  • Name it App.
  • Right-click the App folder and create a subfolder named decisions.
  • Right-click again in the root of the file explorer and create a folder named Context.

Obsidian hides folders that start with a dot by default. You'll create the .claude folder using File Explorer instead.

  • Open File Explorer on Windows (press Windows + E).
  • Navigate to your vault's folder on disk. If you're unsure where it is, click the vault icon at the bottom-left of Obsidian and look at the path shown.
  • Inside your vault folder, create a new folder named .claude (right-click, select New then Folder).
  • Open the .claude folder and create two subfolders inside it: rules and skills.

Your vault folder in File Explorer should now show App, Context, and .claude at the top level.

Don't see the .claude folder in File Explorer?

Windows hides folders starting with a dot by default. In File Explorer, click View in the top menu bar, then check Hidden items to reveal it.

Help me show hidden folders on Windows

Create the .claudeignore file

Obsidian stores its own internal configuration in a folder called .obsidian/. Claude Code doesn't need any of that. A .claudeignore file tells Claude Code which files to skip.

  • In File Explorer, make sure you're inside your vault's root folder.
  • Right-click in the empty space, select New then Text Document.
  • Rename the file to .claudeignore (remove the .txt extension entirely). Click Yes if Windows warns about changing the extension.
  • Right-click .claudeignore, select Open with, and choose Notepad.
  • Add this single line to the file:
.obsidian/
  • Save and close the file.

What does this file do?

The .claudeignore file works like a .gitignore. Any path listed inside it becomes invisible to Claude Code. Obsidian's .obsidian/ folder contains internal config, themes, and plugin data that would just be noise for your coding sessions.

Windows won't let you remove the .txt extension?

Make sure File name extensions is checked under View in File Explorer. Without this, Windows hides extensions and won't let you change them.

Help me create a file without an extension on Windows

Create your about-me note

This note gives Claude Code a quick snapshot of who you are and what you're building. It helps Claude Code tailor its responses to your skill level and communication preferences.

  • Switch back to Obsidian.
  • Right-click the Context folder in the left sidebar.
  • Click New note.
  • Name it about-me (Obsidian adds the .md extension automatically).
  • Replace any default content with the following, filling in your own details:
# About Me

- Name: [[YOUR_NAME="your name"]]
- Building: AI Sleep Coach / Sleep Tracker app
- Skill level: [[YOUR_SKILL_LEVEL="your level, e.g. beginner, intermediate"]] at app development
- Preferences: [[YOUR_PREFERENCES="how you like explanations - simple, detailed, with examples"]]

What does this note do?

When Claude Code reads your vault, this note gives it immediate context about your background. Instead of producing generic answers, Claude Code adapts its explanations to your skill level and preference style.

The Building: line is fixed to your sleep app project. The other fields are yours to customize however you like.

  • Save the note (Ctrl+S).

Check the Obsidian sidebar. You should see the App folder (with decisions inside), the Context folder (with about-me inside), and about-me open in the editor pane.

✔️ Awesome, I've got everything!

Great. Double check you've saved your about-me.md note and that your vault has the correct folder structure.

ⓧ I'd like to double check the full code

Here's what each file should contain:

.claudeignore (in your vault root):

.obsidian/

Context/about-me.md:

# About Me

- Name: [[YOUR_NAME="your name"]]
- Building: AI Sleep Coach / Sleep Tracker app
- Skill level: [[YOUR_SKILL_LEVEL="your level, e.g. beginner, intermediate"]] at app development
- Preferences: [[YOUR_PREFERENCES="how you like explanations - simple, detailed, with examples"]]

And your folder structure (visible in File Explorer) should include: App/, App/decisions/, Context/, .claude/, .claude/rules/, and .claude/skills/.

Don't see the Context folder or about-me note?

Make sure you created the note inside the Context folder (right-click the folder, not the root). If the note landed in the wrong place, drag it into Context from Obsidian's sidebar.

Help me move my note to the right folder

Your vault now has a clean structure that separates app knowledge, personal context, and Claude Code configuration. Next up, you'll fill in the brain of this vault by writing a CLAUDE.md file and your app's architecture notes.

Write Your App's Brain

Your vault has a skeleton of folders, but folders alone don't help Claude Code understand your app. Every time you start a session, Claude Code needs to know what you're building, what tech stack you chose, and what decisions you've already made.

Without this context, Claude Code wastes tokens re-reading your codebase and asks you the same setup questions over and over. In this step, you'll fill your vault with the knowledge that eliminates that problem.

In this step, get ready to:
  • Create a CLAUDE.md that briefs Claude Code on your entire app.
  • Write architecture documentation describing your tech stack and structure.
  • Record your first technical decision so future sessions respect past choices.
Create CLAUDE.md in your vault root

CLAUDE.md is the first file Claude Code reads when it connects to a directory. It acts as a briefing document that tells Claude Code everything it needs to know about your app without re-reading your codebase.

What is CLAUDE.md?

Think of CLAUDE.md as a cheat sheet you hand to a new team member on their first day. It summarises what the project is, where things live, and what conventions to follow.

Claude Code loads this file automatically at the start of every session. The official recommendation is to keep it under 200 lines so it stays focused and token-efficient.

  • In Obsidian, right-click in the root of your vault (the top of the left panel, not inside any folder).
  • Select New note.
  • Name the note CLAUDE (Obsidian automatically adds the .md extension).
  • Paste the following content into the note:
# Sleep App - AI Second Brain

This vault is persistent memory for my AI Sleep Coach / Sleep Tracker app.
Load this context before working on the app.

## The App

- Name: [your app name]
- What it does: AI-powered sleep coach that [describe what it does]
- Tech stack: [list your technologies]
- Current status: [what's built so far, what you're working on now]

## Architecture

Read App/architecture.md for the full picture.

## Key Decisions

Check App/decisions/ before making architectural choices. Past decisions and their reasoning are stored there.

## Rules

- Follow the conventions in .claude/rules/
- When I make a technical decision, suggest saving it to App/decisions/
- Reference existing vault notes before proposing solutions
- Keep the app's scope focused on sleep coaching and tracking

What does this file do?

  • The App section gives Claude Code your project summary at a glance. Fill in your app's name, what it does (tracks sleep, gives recommendations, etc.), your technologies, and where you're at right now.
  • Architecture and Key Decisions point Claude Code to other files in the vault for deeper detail. You'll create those next.
  • Rules tells Claude Code how to behave. It will reference your vault before proposing solutions and suggest saving decisions as you make them.
  • Fill in the bracketed placeholders with your own app details. Replace each [...] section with real information about your sleep app.

Note appearing inside a folder instead of vault root?

If your CLAUDE.md ended up inside a subfolder, drag it to the top level in Obsidian's left panel. The file must sit in the vault root (the same level as your App/ and Context/ folders) for Claude Code to find it.

help me make sure CLAUDE.md is in the right place in my vault

Create your architecture document

Your CLAUDE.md points Claude Code to App/architecture.md for deeper technical detail. This file describes your app's structure so Claude Code can navigate your codebase intelligently.

  • In Obsidian's left panel, click on the App folder to open it.
  • Right-click inside the App folder and select New note.
  • Name the note architecture.
  • Paste the following content into the note:
# Architecture

## Overview

[One paragraph describing how the app works at a high level]

## Tech Stack

- Frontend: [e.g., React, Next.js, React Native]
- Backend: [e.g., Node.js, Python, Supabase]
- Database: [e.g., PostgreSQL, SQLite]
- AI: [e.g., Claude API, OpenAI, local model]
- Hosting: [e.g., Vercel, AWS, not decided yet]

## Folder Structure

[Paste or describe your app's current folder structure]

## Key Components

- [Component 1]: [what it does]
- [Component 2]: [what it does]

What does this file do?

This gives Claude Code a map of your project. When you ask it to add a feature, it knows where frontend code lives, what database you use, and how your components connect.

Fill in what you know right now. If you haven't decided on hosting yet, that's fine. Write "not decided yet" and update later as your app evolves.

  • Replace each bracketed placeholder with your app's real details. Use the examples as a guide for format.
  • Confirm the note appears as architecture inside the App folder in Obsidian's left panel.
Record your first technical decision

Decisions get lost over time. You forget why you picked one database over another, and Claude Code has no way to know unless you write it down. Decision records solve this by capturing what you chose, why, and what alternatives you considered.

  • In Obsidian's left panel, expand the App folder and click on the decisions subfolder.
  • Right-click inside decisions and select New note.
  • Name the note 001-tech-stack.
  • Paste the following content into the note:
---
type: decision
date: 2026-06-14
status: accepted
---

# Tech Stack Choice

## Decision

[What technology choices you made]

## Why

[Your reasoning]

## Alternatives Considered

[What else you looked at]

What does this file do?

  • The --- block at the top is YAML frontmatter. It stores metadata (type, date, status) that makes decision records searchable and sortable.
  • The numbered prefix (001-) keeps decisions in chronological order. Your next decision would be 002-something.md.
  • When Claude Code reads this folder in future sessions, it knows not to suggest approaches you've already considered and rejected.
  • Fill in the bracketed placeholders with your actual tech stack decision. Describe what technologies you chose for your sleep app, why they fit your needs, and what else you considered.
  • Update the date in the frontmatter to today's date if needed.
  • Confirm the note appears as 001-tech-stack inside App/decisions/ in Obsidian's left panel.

Frontmatter showing as plain text?

If the --- block displays as visible text instead of being hidden behind a metadata panel, that's normal in Obsidian's editing view. Switch to Reading view (click the book icon in the top right) to see it rendered properly.

Make sure the --- is on the very first line of the file with no blank lines above it. Frontmatter only works when it starts at line 1.

help me fix my YAML frontmatter in Obsidian

✔️ Awesome, I've got everything!

Great. Double check that all three files are saved and that you've replaced the bracketed placeholders with your own app details.

ⓧ I'd like to double check the full code

Here are all three files you should have created in this step. Compare your notes against these templates (your filled-in details will replace the bracketed sections).

# Sleep App - AI Second Brain

This vault is persistent memory for my AI Sleep Coach / Sleep Tracker app.
Load this context before working on the app.

## The App

- Name: [your app name]
- What it does: AI-powered sleep coach that [describe what it does]
- Tech stack: [list your technologies]
- Current status: [what's built so far, what you're working on now]

## Architecture

Read App/architecture.md for the full picture.

## Key Decisions

Check App/decisions/ before making architectural choices. Past decisions and their reasoning are stored there.

## Rules

- Follow the conventions in .claude/rules/
- When I make a technical decision, suggest saving it to App/decisions/
- Reference existing vault notes before proposing solutions
- Keep the app's scope focused on sleep coaching and tracking
# Architecture

## Overview

[One paragraph describing how the app works at a high level]

## Tech Stack

- Frontend: [e.g., React, Next.js, React Native]
- Backend: [e.g., Node.js, Python, Supabase]
- Database: [e.g., PostgreSQL, SQLite]
- AI: [e.g., Claude API, OpenAI, local model]
- Hosting: [e.g., Vercel, AWS, not decided yet]

## Folder Structure

[Paste or describe your app's current folder structure]

## Key Components

- [Component 1]: [what it does]
- [Component 2]: [what it does]
---
type: decision
date: 2026-06-14
status: accepted
---

# Tech Stack Choice

## Decision

[What technology choices you made]

## Why

[Your reasoning]

## Alternatives Considered

[What else you looked at]

Your vault now has a brain. Claude Code can read your app's summary, architecture, and past decisions before writing a single line of code. Next up, you'll teach it how you want code written by creating rules and a reusable skill.

Create Rules and a Frontend UI Skill

Your vault now has a CLAUDE.md that tells Claude Code what your app is. That covers the "what" of your project. Now you need to teach Claude Code how you want things built.

Rules and skills are two different mechanisms for this. Rules auto-load based on file patterns, so they're perfect for conventions that should always apply. Skills are invoked on demand, making them ideal for task-specific workflows like "build me a UI component."

In this step, get ready to:
  • Create a path-scoped frontend rule that Claude Code follows automatically on UI files.
  • Build a reusable UI component skill that produces sleep-app-themed interfaces on command.
Create a frontend rule file

Rules live in .claude/rules/ as Markdown files. When a rule has a paths: field in its frontmatter, Claude Code only loads it when working with files that match those glob patterns.

  • In Obsidian, right-click the .claude/rules/ folder in the left panel.
  • Select New note and name it frontend.md.
  • Paste the following content into the file:
---
paths:
  - "**/*.tsx"
  - "**/*.jsx"
  - "**/*.css"
  - "**/*.html"
---

# Frontend Conventions

- Use consistent component structure: imports at top, types/interfaces, component function, styles
- Name components with PascalCase
- Keep components focused on one responsibility
- Prioritize accessibility: use semantic HTML, ARIA labels, and keyboard navigation
- Design mobile-first, then scale up
- For the sleep app: use calming colors (dark blues, purples, soft gradients) and avoid bright/harsh UI elements
- Animations should be smooth and gentle (ease-in-out, 200-300ms)

What does this file do?

The paths: frontmatter at the top tells Claude Code to only load this rule when it's working on .tsx, .jsx, .css, or .html files. If Claude Code is editing a backend Python file, this rule stays out of the way.

The conventions below the frontmatter are your coding standards. Claude Code treats them as instructions it must follow whenever the path condition matches.

Why rules instead of putting this in CLAUDE.md?

Rules with path-scoping only load when relevant. If you put frontend conventions in your CLAUDE.md, they'd load every single session, even when you're working on backend logic or database schemas. That wastes context tokens.

Path-scoped rules keep Claude Code's context lean. The right conventions appear at the right time, automatically.

  • Confirm that frontend.md appears inside the .claude/rules/ folder in Obsidian's left panel.

Don't see the .claude folder in Obsidian?

Folders starting with a dot are hidden by default in some Obsidian configurations. Click the gear icon at the bottom left, go to Files & Links, and make sure Detect all file extensions is toggled on. You can also create this file in File Explorer or VS Code and it will appear in your vault.

Help me find or create .claude/rules/frontend.md in my Obsidian vault

Create a frontend UI skill

Skills are different from rules. A skill is a reusable workflow that you or Claude Code invoke on demand with a slash command. Each skill lives in its own folder under .claude/skills/ with a SKILL.md file as the entrypoint.

  • In Obsidian, right-click the .claude/skills/ folder and select New folder.
  • Name the new folder ui-component.
  • Right-click the ui-component folder and select New note.
  • Name it SKILL.md.
  • Paste the following content into SKILL.md:
---
description: Build a polished UI component for the sleep app. Use when creating new screens, components, or updating the interface. Follows sleep-app design conventions.
---

# Frontend UI Component Builder

When building UI for the sleep app, follow these principles:

## Design Language

- Theme: calming, nighttime-inspired (dark mode preferred)
- Colors: deep blues (#1a1a2e, #16213e), purples (#0f3460), accent teals (#53a8b6)
- Typography: clean sans-serif, generous line height (1.6+), large touch targets
- Spacing: consistent 8px grid system
- Borders: soft, rounded (8-16px border radius)

## Component Structure

1. Start with the data/props the component needs
2. Build the layout skeleton first (no styling)
3. Add responsive behavior (mobile-first)
4. Apply the sleep-app theme
5. Add micro-interactions (subtle hover states, smooth transitions)
6. Ensure accessibility (screen reader labels, focus indicators, color contrast)

## Sleep App Specific Patterns

- Sleep data visualizations: use gentle curves, avoid sharp angles
- Time displays: always show in 12hr or 24hr based on user preference
- Loading states: use pulsing/breathing animations (mimics calm breathing)
- Empty states: encouraging messages, never harsh error language

What does this skill do?

The description in the frontmatter tells Claude Code when to use this skill. Claude Code reads this description and can decide to invoke the skill automatically when it's relevant, or you can invoke it manually with /ui-component.

The body below the frontmatter is the actual instruction set. It gives Claude Code a complete design system for your sleep app, from color palette to animation style to accessibility requirements. Every component Claude Code builds will follow these patterns.

  • Verify that SKILL.md appears inside the .claude/skills/ui-component/ folder in Obsidian's left panel.

Obsidian renamed SKILL.md or added extra characters?

Obsidian sometimes appends numbers or changes casing when creating notes. Make sure the file is named exactly SKILL.md (all caps, no spaces). If Obsidian renamed it, right-click the file and select Rename to fix it. Alternatively, create this file using File Explorer or VS Code directly in your vault folder.

Help me create SKILL.md in the correct location with the right name

Verify your rule and skill are in place

The folder name ui-component determines the slash command. Because the skill lives in a folder called ui-component, you'll invoke it with /ui-component in Claude Code.

  • Expand the .claude/ folder in Obsidian's left panel and confirm you see this structure:
.claude/
  rules/
    frontend.md
  skills/
    ui-component/
      SKILL.md

How skills load from your vault

When you connect your vault to Claude Code using --add-dir (coming in the next step), skills in .claude/skills/ are loaded automatically. This is a special exception. Skills from additional directories are always available without extra configuration.

✔️ Awesome, I've got everything!

Great. Make sure both files are saved in Obsidian before moving on.

ⓧ I'd like to double check the full code

Here's what each file should contain:

.claude/rules/frontend.md:

---
paths:
  - "**/*.tsx"
  - "**/*.jsx"
  - "**/*.css"
  - "**/*.html"
---

# Frontend Conventions

- Use consistent component structure: imports at top, types/interfaces, component function, styles
- Name components with PascalCase
- Keep components focused on one responsibility
- Prioritize accessibility: use semantic HTML, ARIA labels, and keyboard navigation
- Design mobile-first, then scale up
- For the sleep app: use calming colors (dark blues, purples, soft gradients) and avoid bright/harsh UI elements
- Animations should be smooth and gentle (ease-in-out, 200-300ms)

.claude/skills/ui-component/SKILL.md:

---
description: Build a polished UI component for the sleep app. Use when creating new screens, components, or updating the interface. Follows sleep-app design conventions.
---

# Frontend UI Component Builder

When building UI for the sleep app, follow these principles:

## Design Language

- Theme: calming, nighttime-inspired (dark mode preferred)
- Colors: deep blues (#1a1a2e, #16213e), purples (#0f3460), accent teals (#53a8b6)
- Typography: clean sans-serif, generous line height (1.6+), large touch targets
- Spacing: consistent 8px grid system
- Borders: soft, rounded (8-16px border radius)

## Component Structure

1. Start with the data/props the component needs
2. Build the layout skeleton first (no styling)
3. Add responsive behavior (mobile-first)
4. Apply the sleep-app theme
5. Add micro-interactions (subtle hover states, smooth transitions)
6. Ensure accessibility (screen reader labels, focus indicators, color contrast)

## Sleep App Specific Patterns

- Sleep data visualizations: use gentle curves, avoid sharp angles
- Time displays: always show in 12hr or 24hr based on user preference
- Loading states: use pulsing/breathing animations (mimics calm breathing)
- Empty states: encouraging messages, never harsh error language

Your vault now has brains (CLAUDE.md), conventions (rules), and workflows (skills). Next up, you'll connect everything to Claude Code and test that it actually works while you're coding in your app project.

Connect Your Vault to Claude Code and Test

Your vault is loaded with context, rules, and a custom skill. Now it's time to actually connect it to Claude Code while you work on your sleep app.

The --add-dir flag lets Claude Code access files from a second directory without leaving your app project. Combined with an environment variable, it also loads your vault's CLAUDE.md, rules, and skills automatically.

In this step, get ready to:
  • Start Claude Code with your vault connected via a single command.
  • Test that Claude Code loads your CLAUDE.md, rules, and skills.
  • Create a PowerShell shortcut so you can connect with one word.
Start Claude Code with your vault connected

You need to be inside your app project folder (where your code lives) so Claude Code can read and write your app files. The vault gets added as a secondary directory.

  • Press the Windows key to open your search bar.
  • Type VS Code and press Enter to open it.
  • Open your app project folder in VS Code by clicking File in the top menu bar.
  • Click Open Folder and select your sleep app project folder.
  • Open the integrated terminal by pressing Ctrl+` (that's the backtick key, above Tab).

You should see a terminal panel appear at the bottom of VS Code, with the path showing your app project folder.

  • Find your vault's full path by opening File Explorer, navigating to your vault folder, right-clicking it, and selecting Copy as path.
  • Start Claude Code with your vault connected by running this command:
$env:CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD="1"; claude --add-dir "[[VAULT_PATH=\"C:\\Users\\YourName\\Documents\\YourVault\"]]"

What does this command do?

This single command does three things at once:

  • $env:CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD="1" tells Claude Code to load CLAUDE.md, rules, and skills from any additional directories.
  • claude starts Claude Code in interactive mode from your current app project folder.
  • --add-dir gives Claude Code file access to your vault without changing its working directory.

Claude Code should start up and you'll see its interactive prompt. It now has access to both your app project AND your vault.

Claude Code not starting?

  • Make sure you replaced the vault path placeholder with your actual vault path (the one you copied from File Explorer).
  • Check that your vault path is wrapped in double quotes, especially if it contains spaces.
  • Confirm claude works on its own first by running claude --version in the terminal.

help me troubleshoot why Claude Code won't start with the --add-dir flag

Test the connection

Now that Claude Code is running with your vault connected, you can verify it actually loaded your context, rules, and skills.

  • Type this prompt into Claude Code:
What app are we building?

Claude Code should describe your sleep app based on the CLAUDE.md in your vault. It should mention your app name, what it does, and your tech stack without you needing to explain any of it.

  • Test that your rules loaded by typing:
What frontend conventions should you follow?

Claude Code should reference the conventions from .claude/rules/frontend.md in your vault. Look for mentions of PascalCase, accessibility, calming colors, and mobile-first design.

  • Test your skill by typing this (note the slash at the start):
/ui-component
  • When it loads, ask Claude Code to build a sleep score card component.

Claude Code should produce a UI component that uses your sleep-app design language. Look for dark blues, rounded borders, and the calming theme you defined in your skill.

Why does /ui-component work from the vault?

Skills stored in .claude/skills/ within an added directory are loaded automatically. This is a special exception for the --add-dir flag. Your vault's skills are available just as if they were in your app project.

Claude Code doesn't know about your app?

  • Double-check that you set the environment variable CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD to "1" in the same command. Without it, Claude Code gets file access but does NOT load CLAUDE.md or rules.
  • Confirm your vault path is correct. Run ls on the vault path in a separate terminal to check files exist.
  • Make sure CLAUDE.md is in your vault's root folder, not inside a subfolder.

help me figure out why Claude Code is not loading my vault context

Create a shortcut for quick access

Typing that long command every session gets old fast. You can save it as a function in your PowerShell profile so it's always available.

  • Open your PowerShell profile file by running this command in the VS Code terminal:
notepad $PROFILE

If Notepad asks whether you want to create the file, click Yes.

  • Add this line at the bottom of the file:
function ccvault { $env:CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD="1"; claude --add-dir "[[VAULT_PATH=\"C:\\Users\\YourName\\Documents\\YourVault\"]]" }

What does this function do?

PowerShell profiles run automatically whenever you open a new terminal. By adding a function here, you create a custom command called ccvault that's always available.

Typing ccvault from your app project folder runs the full connection command. No copy-pasting needed.

  • Save the file in Notepad (Ctrl+S) and close it.
  • Save the file in Notepad (Ctrl+S) and close it.
  • Open a brand new terminal in VS Code by clicking the + icon in the terminal panel.
  • Test your shortcut by running:
ccvault

Claude Code should start up with your vault connected, just like before. You now have a one-word shortcut for every future session.

Seeing a script execution error?

If you see a message about scripts being disabled on your system, PowerShell's execution policy is blocking your profile. Fix it by running this command, then open a new terminal and try ccvault again:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

help me fix PowerShell execution policy errors when running my profile

Your vault and app project are now fully connected. Next up, you'll take on a secret mission to make your vault even smarter.

Secret mission

Create a "Save Decision" Skill

Your vault stores context that Claude Code reads. But what if Claude Code could write back to your vault too? In this mission, you'll create a skill that saves architectural decisions directly into your vault's App/decisions/ folder, so your knowledge base grows automatically as you build.

Clean Up Your Resources

Clean Up Your Resources

This project runs entirely locally, so there are no ongoing costs. Decide whether to keep your vault files to continue building your knowledge base, or remove them entirely.

Resources you used:

  • Obsidian vault files (App/, Context/, .claude/, CLAUDE.md, .claudeignore) stored locally in your vault folder.
  • PowerShell profile function (ccvault) stored in your $PROFILE file.

Keep everything running

No action needed. Choose this if you're still actively building your sleep app.

  • Your vault grows smarter over time as you add decisions, context, and skills.
  • The more context you add, the better Claude Code performs on your app.
  • Everything is free local files. There is nothing to pause or stop.

Pause - I'll come back to this later

Since everything is local files, there is nothing to pause or shut down. Your vault stays on disk until you're ready to use it again.

  • Your vault files remain in your Obsidian vault folder, ready whenever you return.
  • The ccvault function stays in your PowerShell profile. Type ccvault any time to reconnect.

Delete - I don't want to use this again

Remove all project resources and start fresh. This deletes your vault structure and the PowerShell shortcut.

  • Delete the vault folders and files you created. Open PowerShell and run:
Remove-Item -Recurse -Force "C:\Users\YourName\Documents\MyVault\App"
Remove-Item -Recurse -Force "C:\Users\YourName\Documents\MyVault\Context"
Remove-Item -Recurse -Force "C:\Users\YourName\Documents\MyVault\.claude"
Remove-Item -Force "C:\Users\YourName\Documents\MyVault\CLAUDE.md"
Remove-Item -Force "C:\Users\YourName\Documents\MyVault\.claudeignore"

What about the vault path?

Replace C:\Users\YourName\Documents\MyVault with the actual path to your Obsidian vault. This is the same path you used in the ccvault function.

  • Remove the ccvault function from your PowerShell profile. Open the profile by running:
notepad $PROFILE
  • Find the line that starts with function ccvault and delete it.
  • Save and close the file.

Nice Work!

Nice Work!

You just built a persistent knowledge system that makes Claude Code dramatically more effective at building your sleep app. Every coding session now starts with full context, custom skills, and a vault that grows smarter over time.

You've learned how to:

  • Built a structured Obsidian vault with a CLAUDE.md that gives Claude Code full context about your sleep app's architecture, tech stack, and decisions at every session start.
  • Created path-scoped rules and a frontend UI skill so Claude Code automatically follows your coding conventions and produces sleep-app-themed components on demand.
  • Connected the vault to Claude Code using the --add-dir flag and created a ccvault shortcut for instant access from your app project folder.
  • (Secret Mission) Built a save-decision skill so Claude Code writes architectural decisions back to your vault, creating a growing knowledge base that compounds over time.

Ready to quiz yourself?