wu-cli AGENTS.md

Instructions for wu, a command-line WhatsApp client whose background service stores messages in SQLite and serves them to the CLI and an MCP server.

In plain words
What is it for?
Building, running, and testing wu; managing its daemon; querying stored messages; and working with its CLI or MCP interface.
Why use it?
They explain the system’s single-login design and prevent starting competing WhatsApp connections that could disrupt the session.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/ibrahimhajjaj/wu-cli/agents-md
Clone the repo
git clone --depth 1 https://github.com/ibrahimhajjaj/wu-cli

Made for: Codex, OpenCode.

Per session 1,280 This file is loaded in full into every session.
When invoked 1,280 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01280 $0.01280
Opus 5 $0.00640 $0.00640
Sonnet 5 $0.00256 $0.00256
Haiku 4.5 $0.00128 $0.00128

Measured 3d ago against content hash cfa4ce14f7a5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

wu-cli AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 98 lines

How it starts

The opening of the file, as written. The whole thing — 98 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

Orientation for anyone (human or assistant) working in this repo.

What this is

WhatsApp CLI ("wu"), built on @whiskeysockets/baileys. A daemon collects messages into SQLite; the CLI and an MCP server read/act through it.

Commands

  • Build: npm run build (tsc && chmod +x dist/cli/index.js)
  • Dev (run from source): npm run dev -- <args> (tsx src/cli/index.ts)
  • Test: npm test (tsx --test tests/*.test.ts, uses node:test)
  • Typecheck: no dedicated script yet; use npx tsc --noEmit

Architecture

  • Daemon: wu daemon (persistent) or wu listen (foreground) holds the only live WhatsApp socket and ingests messages into SQLite + FTS5. Both commands take the same lock file (src/core/lock.ts), so only one can run at a time. Source: src/core/listener.ts, src/core/store.ts, src/db/schema.ts (messages_fts virtual table), src/db/database.ts.
  • IPC: CLI and MCP reach a running daemon over a Unix domain socket (src/core/ipc.ts, newline-delimited JSON) to reuse the single login. Never open a second WhatsApp login while the daemon runs - Baileys treats a second socket as a competing session and can drop both.
  • MCP: stdio-only server (src/mcp/server.ts uses StdioServerTransport; no HTTP transport exists). Tools are registered in src/mcp/tools.ts - 35 tools as of this writing (grep -c 'server.tool(' src/mcp/tools.ts).
  • Run-mode ladder for write/media tools: in-process socket (getSock()) → daemon IPC (daemonIpcAvailable/daemonRequest) → remote SSH (sshWuExec). See the per-tool fallbacks in src/mcp/tools.ts and src/core/remote.ts.
  • Remote: sync of DB and media from a VPS over SSH - sqlite3-rsync when available, rsync (backup+rsync) fallback for the DB, plain rsync for media. Source: src/core/remote.ts.

Invariants (do not violate)

  • Baileys is pinned EXACT (7.0.0-rc13) on purpose - deterministic deploys of a reverse-engineered library (commit 31ea821). Do not widen the range; bump only deliberately and test against a real session.
  • Opt-in constraint model: the default constraint mode is none, meaning nothing is collected until a chat is explicitly set to full or read (src/core/constraints.ts, ConstraintMode in src/config/schema.ts). Respect the resolved mode (full/read/none) in any new read/write path - shouldCollect gates ingestion, assertCanSend/assertCanManage gate writes.
  • MCP is stdio-only. Do not add an HTTP transport without a reason.
  • Message content off the wire is untrusted data (a prompt-injection surface for MCP consumers reading chat history). Do not let it drive tool calls implicitly.
  • ~/.wu (WU_HOME) holds auth credentials, the message DB, and media - all sensitive. ensureWuHome (src/config/paths.ts) creates it and the auth dir 0700, and the daemon IPC socket is created 0600. Keep any new sensitive path you add under WU_HOME owner-only too.

Read the full file on GitHub · 98 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 98 lines · 1,280 tokens per session scan A cfa4ce14f7a5

Subscribe to this mod's changes

wu-cli AGENTS.md is an instructions file published in the GitHub repository ibrahimhajjaj/wu-cli (14 stars, last pushed 21d ago), licensed MIT. It adds 1,280 tokens to every session, about $0.0064 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.