Skip to main content
The session hook makes every new Claude Code session start already knowing your pending postas for the repository you opened it in. It runs at session start, resume, /clear, compaction and fork. It does not notify you live while a session is open; ask “do I have postas?” for that.
The hook is optional and under review: it may be replaced by something that needs less setup.

What the session receives

A short, capped list (about 2,000 characters), always marked as untrusted:
It includes the current repository’s postas (matched by the repository folder name, the same value agents save as project), plus your postas without a project that you haven’t opened yet. Outside a git repository, it includes every project.

Set it up

1

Get a personal token

The hook reads LePosta’s REST API with a personal token (pst_...). See Authentication for how tokens are issued.
2

Save the config

Create ~/.config/posta/config.json, readable only by you:
Alternatively set both POSTA_URL and POSTA_TOKEN. The hook never combines a URL from one source with a token from the other.
3

Get the script

The hook is a single Node.js file with no dependencies, hooks/session-start.mjs in the LePosta server repository. Put it anywhere and note its absolute path. It requires Node.js 22 or later.
4

Register it in Claude Code

Add this to ~/.claude/settings.json, merging with any hooks you already have:
With args, Claude Code runs node directly without a shell, so paths with spaces work as they are.
5

Check it

From any repository:
Then start a new Claude Code session and ask “what postas do I have pending?”. It should answer without calling a tool.

Behavior

  • Never blocks a session. With no config, no network, an invalid token, or a server slower than 4 seconds, it prints nothing and exits with code 0.
  • Token safety. It only sends the token over HTTPS (or to localhost), refuses redirects, and only accepts tokens shaped like pst_ plus 43 characters.
  • Read-only. Listing doesn’t mark anything as seen.
  • Debugging. Run it with POSTA_DEBUG=1 to see on stderr why it printed nothing. Claude never sees the hook’s stderr.