# Read and annotate beside Claude Code, Codex, or fx.

> Install the skill once, ask in plain English, and your coding agent drives the live reader through its control socket without ever touching your human highlights.

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

## Install the skill and embedded playbooks.

```sh
npx skills add crafter-station/hoja

# The installed binary also embeds version-matched playbooks:
hoja skills list
hoja skills get core --full
hoja skills get annotate
hoja skills get rex
```

Because the core, annotate, and rex playbooks are compiled into the Rust binary with include_str!, an agent always reads instructions matching the exact flags installed on your machine. Set HOJA_SKILLS_DIR to add or override custom <name>/SKILL.md files.

## Peek, search, and push papers without stealing focus.

```sh
hoja ctl ls --json                           # live readers: pid, stack, anchor, active title
hoja ctl peek --text                         # read visible page without moving reader
hoja ctl peek --png --output /tmp/live.png   # capture visible page for dense math/figures
hoja ctl open 2305.10601                     # push cited paper in background (unseen * badge)
hoja ctl open 1706.03762 --focus --page 3    # focus only when human asked to look now
hoja ctl search "ablation" --limit 20 --json # search every open document in the stack
hoja ctl goto --page 7                       # jump active document
```

In Rex, panes opened by hoja rex install export HOJA_ANCHOR so hoja ctl resolves the exact reader paired to your agent pane instead of spawning duplicate splits.

## Solid human marks, dashed agent marks.

Your highlights live in <hash>.json (writable only by the TUI). Every agent writes into its own <hash>.<agent>.json sidecar with --by <slug>. The CLI rejects --by human, so an agent can never edit or delete your notes.

| Signal | Color | Style |
| --- | --- | --- |
| Key contribution, main claim, headline result | amber | highlight |
| Limitation, caveat, threat to validity | rose | underline |
| Definition, term introduction, notation | mint | highlight |
| Equation, algorithm line, code, hyperparameters | sky | highlight |

```sh
hoja annot ls --active --by human
hoja annot apply --active - --by fx --batch study-1 <<'JSON'
[
  {"op": "add", "page": 1, "match": "scaled dot-product attention", "color": "mint", "style": "highlight"},
  {"op": "add", "page": 5, "rect": [0.12, 0.30, 0.68, 0.42], "color": "sky", "note": "core equation"}
]
JSON
hoja annot clear --active --by fx   # drop agent layer, human marks stay
```

**Exit codes:** Batches are all-or-nothing (add --dry-run to validate first). Exit 3 means no_match or no_live_reader (with closest page text printed); exit 4 means ambiguous match (retry with --occurrence K or --all).

## 2× crisp equation crops over OSC 52.

Drag a SNIP box over any equation or figure (or press y / @ to hand off the visible viewport). hoja renders the crop at 2x density in crisp paper ink (capped at 3600 px full-page width), writes region.png, selection.md, and meta.json under ~/.cache/hoja/handoff/<timestamp>-p<N>/, and copies the path via OSC 52 and pbcopy.
