# Export highlights into Obsidian literature notes.

> Close the research loop. Keep the agent marks worth keeping with k, then export one clean Markdown note straight into your Obsidian vault.

- Canonical URL: https://hoja.crafter.run/docs/obsidian
- Version: 0.2.1

## One command to write the note.

```sh
hoja annot export --active --obsidian --output /path/to/vault/papers/attention.md
hoja annot export --active --obsidian --include-agent --output /path/to/vault/papers/attention.md
hoja annot export 1706.03762 --obsidian --json   # markdown plus structured summary
```

- **Human layer by default**: Only your own highlights and notes are exported unless you pass --include-agent, which appends agent layers under their own heading.
- **Obsidian-safe escaping**: Brackets, pipes, and hash symbols inside extracted quotes are escaped so they never accidentally create broken wikilinks, tables, or tags.
- **Safe atomic writes**: -o writes via a temporary file with mode 0600, refuses symlinks or directories, and never overwrites an existing note unless you pass --force.

## What lands in your vault.

```markdown
---
title: "Attention Is All You Need"
doc_key: "1706.03762"
exported: "2026-11-30"
---

# Attention Is All You Need

## Page 1

> The dominant sequence transduction models are based on complex recurrent or convolutional neural networks.

- Note: core motivation for dispensing with recurrence.

## Agent Notes (fx)

### Page 3

> scaled dot-product attention (mint)

- Note: scaling by 1/sqrt(d_k) prevents softmax saturation for large d_k.
```

## Sync annotations with HOJA_DATA_DIR.

```sh
export HOJA_DATA_DIR=/Users/you/hoja-data   # absolute path, no ~ or .., mode 0700
```

Setting HOJA_DATA_DIR moves annotations/, state/, and stacks/ together into one private 0700 directory for dotfiles, git, or iCloud sync. Control sockets remain in the local cache because Unix domain socket paths are length limited.
