Overview
Klaus can save notes to an Obsidian vault during research sessions. Users can ask Klaus to save quotes, definitions, summaries, or page references as markdown notes.NotesManager Class
TheNotesManager class manages reading and writing markdown files in an Obsidian vault.
Constructor
Path to the Obsidian vault directory. If
None, reads from config.OBSIDIAN_VAULT_PATH.Properties
base_path (read-only)
Returns the configured Obsidian vault base path as a string.
current_file
The currently active notes file (relative path from vault root), or None if not set.
changed (read-only)
Boolean indicating whether the notes file was changed since the last reset_changed() call.
Methods
set_file(relative_path: str) -> str
Set the active notes file. Creates parent directories and the file if they don’t exist.
Relative path to the markdown file (e.g.,
"Papers/March 2026.md"). The .md extension is added automatically if missing.save_note(content: str) -> str
Append markdown content to the current notes file.
Markdown-formatted content to append
reset_changed() -> None
Reset the changed flag to False.
Tool Definitions
Notes functionality is exposed to Claude via two tool definitions:SET_NOTES_FILE_TOOL
SAVE_NOTE_TOOL
Usage in Brain
TheBrain class registers both tool definitions with Claude. When the user asks Klaus to save a note, Claude:
- Calls
set_notes_file(if no file is set yet) - Calls
save_notewith markdown content
Configuration
Set your Obsidian vault path in~/.klaus/config.toml:
.env:
Implementation Details
- Automatic
.mdextension: The.mdsuffix is added automatically if missing from the file path. - Directory creation: Parent directories are created automatically (
mkdir -pbehavior). - File persistence: The current notes file persists across questions in the same session.
- Session tracking: The notes file path is stored in the session record in
klaus.db.
Source Reference
Seeklaus/notes.py for the full implementation.