Promptfire is an Obsidian plugin for assembling, formatting, and exporting vault context to LLMs — with targets, templates, token budgets, and smart note detection.
Find a file
Luca G. Oelfke 11fcce0f4c
feat: add frontmatter preset system for one-hotkey context generation
- Parse ai-context block from frontmatter with validation
- Support fields: template, include-linked, link-depth, include-tags,
  exclude-paths, exclude-tags, max-tokens, include-active-note
- Add LinkTraverser for cycle-safe graph traversal of linked notes
- Add TagCollector for collecting files by tags (hierarchical support)
- Token budget enforcement with size-based file prioritization
- New command: "Copy context from frontmatter preset"
- Fallback to generator modal when no preset found
- Clear error messages for invalid preset values

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 10:41:41 +01:00
.github/workflows feat: initial release of Claude Context plugin 2026-02-05 16:55:43 +01:00
src feat: add frontmatter preset system for one-hotkey context generation 2026-02-06 10:41:41 +01:00
.editorconfig feat: initial release of Claude Context plugin 2026-02-05 16:55:43 +01:00
.gitignore feat: initial release of Claude Context plugin 2026-02-05 16:55:43 +01:00
.npmrc feat: initial release of Claude Context plugin 2026-02-05 16:55:43 +01:00
AGENTS.md feat: initial release of Claude Context plugin 2026-02-05 16:55:43 +01:00
esbuild.config.mjs feat: initial release of Claude Context plugin 2026-02-05 16:55:43 +01:00
eslint.config.mts feat: initial release of Claude Context plugin 2026-02-05 16:55:43 +01:00
LICENSE feat: initial release of Claude Context plugin 2026-02-05 16:55:43 +01:00
manifest.json feat: initial release of Claude Context plugin 2026-02-05 16:55:43 +01:00
package-lock.json feat: initial release of Claude Context plugin 2026-02-05 16:55:43 +01:00
package.json feat: initial release of Claude Context plugin 2026-02-05 16:55:43 +01:00
README.md feat: initial release of Claude Context plugin 2026-02-05 16:55:43 +01:00
styles.css feat: initial release of Claude Context plugin 2026-02-05 16:55:43 +01:00
tsconfig.json feat: initial release of Claude Context plugin 2026-02-05 16:55:43 +01:00
version-bump.mjs feat: initial release of Claude Context plugin 2026-02-05 16:55:43 +01:00
versions.json feat: initial release of Claude Context plugin 2026-02-05 16:55:43 +01:00

Claude Context

Obsidian TypeScript 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.

FeaturesInstallationUsageConfigurationGenerator


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:

    cd /path/to/vault/.obsidian/plugins
    git clone https://github.com/yourusername/obsidian-claude-context.git claude-context
    
  2. Install dependencies and build:

    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:

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:

# === 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 for details.


Made with ♥ for the Obsidian community