---
title: "@henryqw/pi-notes"
seo:
  description: "Persistent notes in a Pi widget, managed with /note commands."
---

<div class="not-prose my-6 flex flex-wrap items-center gap-3"><a href="https://www.npmjs.com/package/@henryqw/pi-notes" aria-label="View @henryqw/pi-notes version v3.4.0 on npm"><img alt="Version v3.4.0" height="20" src="https://img.shields.io/static/v1?cacheSeconds=7200&amp;color=1d4ed8&amp;label=version&amp;labelColor=6a7282&amp;style=flat-square&amp;message=v3.4.0" width="96"></a><div class="ml-auto flex flex-wrap items-center justify-end gap-3"><a href="https://www.npmjs.com/package/@henryqw/pi-notes" aria-label="View @henryqw/pi-notes on npm"><img alt="Monthly npm downloads" height="20" src="https://img.shields.io/npm/dm/%40henryqw%2Fpi-notes?cacheSeconds=7200&amp;color=1d4ed8&amp;label=downloads&amp;labelColor=6a7282&amp;style=flat-square" width="144"></a><a href="https://github.com/HenryQW/pi-harness/blob/main/extensions/pi-notes/LICENSE" aria-label="View the MIT license for @henryqw/pi-notes"><img alt="MIT license" height="20" src="https://img.shields.io/npm/l/%40henryqw%2Fpi-notes?cacheSeconds=7200&amp;color=1d4ed8&amp;label=license&amp;labelColor=6a7282&amp;style=flat-square" width="78"></a></div></div>

Keep worktree reminders above the Pi editor across sessions.

![Pi showing two persistent notes above the editor](https://raw.githubusercontent.com/HenryQW/pi-harness/2f18065a670bfe9845fb334653840ab7ad5e23e4/extensions/pi-notes/example.png)

## Install

```bash
pi install npm:@henryqw/pi-notes
```

## Use

Type `/note `, `/note-rm `, or `/note-clear ` to see `--project`, which selects a worktree path. After a path in `/note`, completion offers `--`, which separates the path from the note text. Completion keeps paths with spaces and does not suggest note text.

Run `/note Verify the migration rollback.` in a Git worktree. The reminder appears immediately and in later sessions.

| Surface | Type | Purpose |
| --- | --- | --- |
| `/note <text>` | command | Add a worktree note. |
| `/note-rm` | command | Select and remove a note. |
| `/note-clear` | command | Clear worktree notes. |
| Notes widget | ui | Show worktree notes. |

Each worktree has separate notes.

### Select a worktree

Use `--project`, which selects a project or worktree path for one command. Paths are absolute or relative to the session directory. Enter paths without shell quotes; spaces are allowed. For `/note`, `--` separates the path from the note text.

```text
/note --project first repo -- Verify the migration rollback.
/note-rm --project first repo
/note-clear --project first repo
```

Pi does not scan or select child repositories. Without a path, commands use the session directory and fail outside a Git worktree. An explicit selection does not change that default or select a project for other tools.

The widget stays with the session worktree. Explicit commands report the selected worktree's notes in a notification. Worktrees and symbolic links use the same canonical identity checks.

## State and storage

Commands save notes to `~/.pi/agent/config/pi-notes/<worktree-sha256>.json`.

Session start and note changes silently delete stale files for removed repositories and worktrees.

## Limits and recovery

Each worktree holds at most four notes. `/note` trims surrounding whitespace and replaces whitespace sequences with one space. It rejects remaining control characters with `Notes cannot contain terminal control characters.`

The extension validates files as untrusted data. Malformed files stay unchanged and block changes for their worktree. Fix the file or reset it with `/note-clear`.
