# Claude Context
[](https://obsidian.md)
[](https://www.typescriptlang.org/)
[](LICENSE)
**Copy your vault context to clipboard with one hotkey.**
Give AI assistants (Claude, ChatGPT, etc.) instant understanding of your vault's conventions, structure, and workflows.
[Features](#features) • [Installation](#installation) • [Usage](#usage) • [Configuration](#configuration) • [Generator](#context-generator)
---
## The Problem
When working with AI assistants on your Obsidian vault, you constantly need to explain:
- How you name files
- Where things go
- What link style you use
- Your tag conventions
- Your workflows
This is repetitive and error-prone. The AI forgets, you forget to mention something, and inconsistencies creep in.
---
## The Solution
**Claude Context** stores your vault's conventions in a dedicated folder (`_claude/`) and copies everything to your clipboard with a single hotkey. Paste it into any AI chat, and the assistant immediately understands how to work with your vault.
---
## Features
### 📋 One-Click Context Copy
Press a hotkey or click the ribbon icon to copy all context files to your clipboard. The output is formatted with clear separators between files.
### ⚙️ Context Generator
Don't want to write context files manually? The built-in generator walks you through your preferences:
- **Language** - English or German
- **File naming** - kebab-case, snake_case, camelCase, or free
- **Link style** - Wikilinks or Markdown
- **Tag style** - Hierarchical, flat, or none
- **Frontmatter fields** - Customize required fields
- **Custom rules** - Add your own conventions
- **Folder purposes** - Auto-detects your folders, you describe their purpose
- **Templates** - Define your note templates
Click "Generate" and your context files are created instantly.
### 📁 Auto-Detect Vault Structure
The generator automatically scans your vault's folder structure. Just fill in the purpose for each folder, and `structure.md` is generated with your actual directories.
### 🔧 Flexible Settings
- **Context folder** - Change from `_claude/` to any name
- **Separator** - Customize the separator between files
- **Include filenames** - Toggle `# === filename.md ===` headers
- **Show preview** - Preview before copying
- **Include active note** - Append the currently open note
- **Excluded files** - Skip specific files from being copied
### 📝 Include Active Note
Working on a specific note and want context for it? Use "Copy context with current note" or enable "Include active note" in settings. The current note is appended to your context with an `ACTIVE:` prefix.
---
## Installation
### From Source
1. Clone this repository into your vault's plugins folder:
```bash
cd /path/to/vault/.obsidian/plugins
git clone https://github.com/yourusername/obsidian-claude-context.git claude-context
```
2. Install dependencies and build:
```bash
cd claude-context
npm install
npm run build
```
3. Enable the plugin in Obsidian:
- Settings → Community Plugins → Enable "Claude Context"
### Development Setup
For development with hot reload:
```bash
cd /path/to/vault/.obsidian/plugins/claude-context
npm run dev
```
---
## Usage
### Quick Start
1. **Generate context files**: `Ctrl+P` → "Claude Context: Generate context files"
2. **Configure your preferences** in the generator modal
3. **Click "Generate"** to create your context files
4. **Copy context**: `Ctrl+P` → "Claude Context: Copy context to clipboard"
5. **Paste** into ChatGPT, Claude, or any AI assistant
### Commands
| Command | Description |
|---------|-------------|
| Copy context to clipboard | Copies all context files |
| Copy context with current note | Copies context + active note |
| Generate context files | Opens the context generator |
### Ribbon Icon
Click the clipboard icon in the left sidebar for quick access to "Copy context to clipboard".
---
## Configuration
### Settings
Access via Settings → Claude Context:
| Setting | Description | Default |
|---------|-------------|---------|
| Context folder | Folder containing context files | `_claude` |
| Separator | Text between files | `---` |
| Include filenames | Add filename headers | On |
| Show preview | Preview before copying | Off |
| Include active note | Always include open note | Off |
| Excluded files | Files to skip (comma-separated) | Empty |
### Context Files
The plugin expects markdown files in your context folder:
```
_claude/
├── VAULT.md # Main entry point (always first)
├── conventions.md # Naming and formatting rules
├── structure.md # Folder organization
├── workflows.md # How to do things
├── templates.md # Note templates
└── examples.md # Concrete examples
```
`VAULT.md` is always copied first. Other files are sorted alphabetically.
---
## Context Generator
The generator creates a complete context setup based on your preferences.
### Sections
**General**
- Vault description (free text explaining your vault's purpose)
- Language selection
**Formatting**
- File naming convention
- Link style (Wikilinks vs Markdown)
- Maximum heading depth
- Date format
**Tags**
- Tag style (hierarchical, flat, or none)
- Predefined tags for consistency
**Frontmatter**
- Required fields for all notes
**Rules**
- Custom rules for the AI to follow
- Forbidden actions (folders/files the AI should never touch)
**Folder Structure**
- Auto-detected folders with purpose fields
- Generates "where does what go" documentation
**Note Templates**
- Define template names, target folders, and tags
- Generates template documentation
**Files to Generate**
- Toggle which context files to create
- Skip files you don't need
---
## Example Output
When you copy context, you get something like:
```markdown
# === VAULT.md ===
# Vault Context for AI Assistants
Personal Zettelkasten for development and knowledge management.
## Quick Reference
- Language: English
- File naming: kebab-case
- Links: [[wikilinks]]
- Frontmatter: `date`, `tags`
...
---
# === conventions.md ===
# Conventions
## Language
- Vault language: English
...
---
# === structure.md ===
...
```
Paste this into any AI chat, and it immediately understands your vault.
---
## License
MIT License - see [LICENSE](LICENSE) for details.
---
Made with ♥ for the Obsidian community