whiff

module
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: MIT

README

whiff

Small services and agents that talk to each other, and to you, by sending messages. whiff runs them locally, keeps their state across restarts, and records every message so you can see what happened.

Services are written in puff, a small lisp with immutable values, Results and Options. Agents have mailboxes too: they can use services as tools, ask you questions, and hand work to other agents. Their writes through whiff wait for your review unless you grant them trust.

Use it for a TODO list shared by your CLI and agents, a daily brief of your repositories, dev servers you can start from a browser, or a team of agents that builds and reviews code in git worktrees.

Get started

From a checkout, install the binaries with Go:

go install ./cmd/...

Make sure Go's bin directory is on your PATH. The binaries are:

Binary What it does
whiff The daemon and CLI: call services, read your inbox, review agents' writes
sniff The web UI: follow messages, inspect state, answer questions and review work
puff Run puff on its own: a file, -e an expression, or a REPL
huff whiff's agent harness: runs a model through OpenRouter, OpenAI or a local server, with file tools as claude -p's, on its own, as an agent's turn, or as a pipeline developer or reviewer

There's no config file. whiff starts on first use and loads the files in ~/.whiff/services/. Create your first service:

mkdir -p ~/.whiff/services
cat > ~/.whiff/services/greet.puff <<'EOF'
(service greet
  (on (hello name) "Greets name."
    (ok (string/concat "hello, " name))))
EOF

whiff call greet/hello ann
# hello, ann

Save a change to the file and whiff reloads it. If it doesn't load, the previous version keeps running and whiff tells you where the error is. Stateful services keep their state in ~/.whiff/whiff.db.

whiff ls                  # available functions and their :read / :write marks
whiff services            # service health and what needs your attention
whiff history -f          # messages as they happen
sniff -open               # open the web UI

To try the language without the daemon:

puff examples/hello.puff ann
puff -e '(+ 1 2)'
puff                      # REPL

Use the included services

The services are small puff files you can read, change and combine. From this checkout, link the ones you want:

ln -s "$PWD"/services/git.puff "$PWD"/services/gh.puff "$PWD"/services/todo.puff ~/.whiff/services/

whiff call git/status
whiff call todo/add "try whiff"
whiff call todo/open

These act on the directory you call them from; gh uses your logged-in GitHub CLI. Or try a service without installing it:

whiff try services/git.puff status

Services can keep state, subscribe to topics, run jobs, and send messages later. Long work returns a pending ID; whiff wait <id> gets its answer. A service can ask you a question too: it waits in whiff inbox until you answer with whiff reply.

Functions can return views with actions. sniff shows them as pages with buttons; the CLI prints them as lines you can pick with fzf:

whiff call todo/view | fzf | whiff act

Compose services in puff

A greeting is one function. Here's a service that combines a few pieces: ask gh for pull requests, keep the ones ready for review, and turn them into a clickable list. It also listens for changes and tells you in your inbox.

(service reviews
  (on (view) "Open, non-draft pull requests that need review."
    (let [prs (try (call :gh/prs))
          waiting (vector/filter prs
                    (fn ({:draft draft :review r})
                      (and (not draft) (= r :review-required))))]
      (ok (view/items (vector/map waiting
                        (fn ({:title title :url url})
                          {:label title :url url}))))))

  (on :gh/changed (event)
    (let [{:dir dir} event]
      (call :me/tell (str "Pull requests changed in " dir)))))

With gh installed as above, link this example and watch the current repository:

ln -s "$PWD"/examples/reviews.puff ~/.whiff/services/
whiff call reviews/view    # sniff shows the titles as links
whiff call gh/watch       # checks for changes every five minutes
whiff inbox               # notifications when the pull request list changes

try unwraps a successful Result or returns the error to the caller. The map patterns in fn pull out just the fields needed. The subscriber runs when gh publishes a change; it doesn't need its own polling loop. The same reviews/view function is callable from the CLI, sniff or an agent through MCP, and its calls to gh appear in message history.

Agents

Connect an agent over MCP

Give an MCP client access to whiff's services. For Claude Code:

claude mcp add whiff -- whiff mcp

Each session gets an address (:agent/1) and service functions as tools. Reads go through; writes wait for your review:

whiff pending              # messages waiting for review
whiff accept 12            # or: whiff reject 12 "why"
whiff trust agent/1 todo   # let this session's writes to :todo through
whiff session agent/1      # its writes and how they were allowed

The review gate covers messages through whiff. An agent's other tools, such as its shell, have their own permissions.

Run a resident agent

An agent can also live in whiff, with its own mailbox and conversation. The included agents use the Claude CLI. Install the assistant:

ln -s "$PWD"/services/assistant.puff ~/.whiff/services/
whiff call assistant/tell "the release is on Friday; remind me what's left"
whiff inbox                # its answer arrives here
whiff reply <id> "and the docs?"

Save another .puff file in ~/.whiff/services/ to add an agent. Choose its prompt, tools and spending limits in dollars:

(agent helper
  :prompt "Help the user track work. Read the open tasks before answering."
  :can [:todo/open :todo/add]
  :limits {:turn 0.5 :day 2})

Agents can queue work, pause, schedule a later turn, and ask other agents for help. The included digest briefs you on a repository; pipeline runs a developer, a check and a reviewer in a git worktree; board and lead coordinate tickets and a team of models, with limits on concurrent runs and daily spending. See the service catalog for setup and the use cases for worked examples.

sniff

sniff -open opens whiff in a browser. Activity shows each request as a card: what it asked, who answered, what it cost, and every message it caused, as steps or as lanes:

The Map draws who talks to whom, one band a project, with the project's team and what it spent today:

The Board shows what is being built in a project, ticket by ticket, beside the team that builds it:

Status and docs

v0.8. Services, resident agents, MCP access, durable state and message history, the sniff UI, peers over ssh, huff and the sandbox are implemented. The project is small and evolving; the included services are used to develop whiff itself.

  • From scratch: whiff on a laptop and a VPS, coding work, a PR comment poller and a plan, end to end
  • Learn puff: values, patterns, errors and scripts
  • Follow a message: a service, its state, events and a background job
  • Agents: MCP, resident agents, delegation and budgets
  • Troubleshooting: diagnose failures and recover work
  • Use cases: worked examples and writing your own service
  • Design: messages, persistence, supervision and the review gate
  • Process management: dev servers and containers
  • Tasks: work that answers later
  • waft: hosts described in puff, planned and applied over ssh
  • Standard library: puff and daemon functions

Inspirations

  • Erlang/OTP: addresses, mailboxes, plain-data messages, supervision.
  • Clojure: immutable values, [...] and {k v} literals, keywords, ->.
  • Rust: Result and Option, try and catch.
  • vrs: a lisp runtime for personal services, where whiff started.

License

MIT, see LICENSE.

Directories

Path Synopsis
cmd
huff command
Command huff runs a model with tools, a turn at a time: on its own, a question and its answer, with file tools as claude -p's if you name them; in a whiff job that holds an agent's session, a turn of that agent, whose tools are also the whiff functions it may use.
Command huff runs a model with tools, a turn at a time: on its own, a question and its answer, with file tools as claude -p's if you name them; in a whiff job that holds an agent's session, a turn of that agent, whose tools are also the whiff functions it may use.
puff command
Command puff runs puff code without a whiff daemon.
Command puff runs puff code without a whiff daemon.
sniff command
sniff is whiff's web UI: a page, served on 127.0.0.1, that shows what goes on between whiff's addresses as it happens, and each address's functions and state.
sniff is whiff's web UI: a page, served on 127.0.0.1, that shows what goes on between whiff's addresses as it happens, and each address's functions and state.
waft command
Command waft provisions Ubuntu hosts over ssh from a puff file that describes them: plan shows what differs, apply changes the host to match.
Command waft provisions Ubuntu hosts over ssh from a puff file that describes them: plan shows what differs, apply changes the host to match.
whiff command
Command whiff is the whiff daemon and its clients.
Command whiff is the whiff daemon and its clients.
examples
shop/api command
Command api is the shop's API, a demo for docs/procs.md: orders, kept in redis, on :8080.
Command api is the shop's API, a demo for docs/procs.md: orders, kept in redis, on :8080.
shop/web command
Command web is the shop's web UI, a demo for docs/procs.md: a page on :3000 that shows an order from the API, which it asks on :8080.
Command web is the shop's web UI, a demo for docs/procs.md: a page on :3000 that shows an order from the API, which it asks on :8080.
internal
daemon
Package daemon is whiff's daemon: it serves clients on the per-user socket and runs the services they talk to.
Package daemon is whiff's daemon: it serves clients on the per-user socket and runs the services they talk to.
huff
Package huff is whiff's own agent harness: a model, a transcript and tools, a turn at a time (run.go), the tools files and commands in a directory, as claude -p's (local.go), or what its caller gives it.
Package huff is whiff's own agent harness: a model, a transcript and tools, a turn at a time (run.go), the tools files and commands in a directory, as claude -p's (local.go), or what its caller gives it.
puff
Package puff is a small lisp for whiff's services: immutable values, and Results and Options instead of nil and exceptions.
Package puff is a small lisp for whiff's services: immutable values, and Results and Options instead of nil and exceptions.
rpc
Package rpc is how whiff's clients talk to the daemon: JSON lines over a per-user unix socket.
Package rpc is how whiff's clients talk to the daemon: JSON lines over a per-user unix socket.
sandbox
Package sandbox finds the container runtime whiff confines commands with, and builds the image they run in: Apple's container on macOS, rootless Podman on Linux.
Package sandbox finds the container runtime whiff confines commands with, and builds the image they run in: Apple's container on macOS, rootless Podman on Linux.
tools
Package tools describes whiff functions as tools for a model, and reads its calls and their answers: what whiff mcp offers Claude, and what huff offers the models it runs.
Package tools describes whiff functions as tools for a model, and reads its calls and their answers: what whiff mcp offers Claude, and what huff offers the models it runs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL