How Lax uses every Claude Code extension point

Hooks, an MCP server, channels, headless runs, skills and git worktrees: a tour of every place Lax plugs into Claude Code.

Lax is a pixel companion for Claude Code that lives on an old phone. It watches every session on my Mac, carries my approvals to the phone, answers me out loud, remembers how we fixed things, and changes its own code. It has no agent framework and no vector database, and it calls no API with its own key. Claude Code already is the agent loop: tools, permissions, resuming, MCP, skills and hooks. Lax plugs into every place Claude Code lets you plug in, and this is a tour of them.

1. Hooks: seeing every session without opting in

npm run setup adds one script, hooks/lax-hook.mjs, to ~/.claude/settings.json on nine events. Every Claude Code session on the Mac reports to Lax from then on, whether it's in a terminal, the desktop app or a headless run.

Event What Lax does with it
SessionStart Returns additionalContext: a page of what Lax knows about this project and about you (2.5k + 1k characters at most). Every new session starts briefed.
UserPromptSubmit The prompt goes into the feed on the phone, and into the journal Lax learns from.
PreToolUse, PermissionRequest The approval goes to the phone as a bubble with ✓ / ✗ and ⋯ for the full command. Whichever answers first wins, the phone or the terminal.
PostToolUse, PostToolUseFailure The live feed, XP, and the tool counts its traits grow from.
Notification, Stop "Waiting for you" and "done" bubbles, read aloud if you want.
Stop, SessionEnd (and every event's transcript_path) The session's tab closes, and once it's quiet its transcript is copied to Lax's archive with secrets scrubbed, so it outlives Claude Code's 30 days.

Two details made hooks work in real life:

The same hook is also a fence. When Lax runs Claude Code on its own (see 5), lax-hook.mjs decides each tool call: reading is free, Lax's secrets and its database are refused outright, and anything that changes something asks the phone.

2. The status line

hooks/lax-status.mjs is the status line, installed only if you don't already have one. It shows your plan's usage under the prompt, and it's also how Lax learns that usage: Claude Code passes it the rate limits, Lax keeps them for the phone, and it slows its own background work as you get near your limits. It also passes on each session's model and how full its context is, which the phone shows under the session's tab.

3. An MCP server in every session

channel/lax-channel.mjs is a user-level MCP server called lax, so every session gets its tools:

4. Channels: talking into a running session

Channels are a research preview, and they're the most fun extension point. lax is a wrapper for claude --dangerously-load-development-channels server:lax. In a session started that way, what you say to the phone arrives in the terminal as ← lax: …, Claude does the work, and its reply tool sends the answer back to be read aloud. Approvals in that session go to the phone too.

Two things are worth knowing:

5. Headless claude -p: Lax's own thinking

Everything Lax "thinks" is a claude -p run with your normal Claude Code login, which is why it needs no API credits:

Each run gets a prompt, a folder, a time limit and the fence from 1. The mind folder's .claude/settings.json does the rest: your repos and Lax's own code are readable, editing outside the mind asks the phone, and its secrets are denied.

Background work is budgeted: a few runs a day, paused near your plan's limits. "Its own work: light or normal" in the Life menu sets how much.

6. Skills, in both directions

7. Self-modification: worktrees, tests and a yes

Lax's code is a clone it may change, but never on main:

What I'd tell someone building on Claude Code


Lax is open source: github.com/diogodebastos/lax. git clone, npm run setup, and it's talking in about four minutes.