CodexClaw is a Go daemon that turns Telegram, WhatsApp, and Discord into chat interfaces for Codex. It is built for private, allowlisted use: send a message from a configured chat transport, let Codex work in the configured workspace, and get progress plus the final answer back in chat.
- Codex app-server gateway through the Go
agent-cli-wrapper/codexclient - Telegram bot support with groups, supergroups, and forum topic threads
- Telegram command menu registered automatically with the supported slash commands
- WhatsApp support through
whatsmeowwith terminal QR login - Discord bot support with DMs, guild channels, threads, attachments, and native replies
- Sender allowlist for Telegram user IDs, WhatsApp phone/JID senders, and Discord user IDs
- Persistent chat sessions with
/new,/session, and configurable minimal or persistent Codex thread context - Model and reasoning controls per session or globally with
/modeland/reasoning - Graph memory per chat scope with
/remember,/memory,/memory graph,/link,/unlink, and/forget - Skills with
$skill-name,/skills,$memory,$skill-creator, and the built-in$skillsdictionary - Agent Browser integration with
$agent-browser,$browser,/browser, auto-injection for browser tasks, and mise install/doctor tasks - Self-management commands to refresh or fast-forward the daemon against
origin/main - Attachments for Telegram, WhatsApp, and Discord images and documents
- Tool progress messages while Codex runs commands, edits files, searches, compacts, and calls tools
- Pure-Go SQLite via
modernc.org/sqlite, so CGO is not required
- Go 1.25+
miseis optional but supported via.mise.toml- Codex CLI installed and authenticated
- Telegram bot token if Telegram is enabled
- A WhatsApp account for QR login if WhatsApp is enabled
- Discord bot token with the Message Content intent enabled if Discord is enabled
cp config.example.yaml ~/.codex-claw/config.yml
cp .env.example ~/.codex-claw/.envEdit ~/.codex-claw/config.yml:
- Set
telegram.tokenor setTELEGRAM_BOT_TOKENin~/.codex-claw/.env - Set
discord.tokenor setDISCORD_BOT_TOKENin~/.codex-claw/.env - Add your Telegram sender ID as
telegram:<user_id> - Add your WhatsApp sender as
whatsapp:<phone_number>orwhatsapp:<jid> - Add your Discord sender ID as
discord:<user_id> - Choose
service.mode: telegram,whatsapp,discord,both, orall
Run locally:
mise exec -- go run ./cmd/codexclaw serveFor WhatsApp, scan the QR code printed in the terminal or service logs. The authenticated WhatsApp session defaults to ./whatsapp-session/whatsapp.db. If QR pairing is unreliable from service logs, use phone-number pairing:
pm2 stop codex-claw
mise exec -- go run ./cmd/codexclaw whatsapp-login -phone 31612345678
pm2 restart codex-claw --update-envEnter the printed pairing code in WhatsApp under Linked devices > Link with phone number instead.
service:
mode: bothValid modes:
telegramwhatsappdiscordbothall
The mode selects which transports run. Each transport also has its own enabled flag. You can override the mode with:
CODEXCLAW_SERVICE_MODE=telegramCodexClaw loads .env from $HOME/.codex-claw and then the current directory. It then searches for config files in this order:
./config.yml
./config.yaml
$HOME/.codex-claw/config.yml
$HOME/.codex-claw/config.yaml
YAML values can reference environment variables with ${VAR}. Common settings can also be overridden with CODEXCLAW_* variables.
Default runtime paths:
$HOME/.codex-claw/config.yml
$HOME/.codex-claw/.env
$HOME/.codex-claw/sessions.db
$HOME/.codex-claw/media
./whatsapp-session/whatsapp.db
CodexClaw uses the Codex app-server protocol through the Go github.com/bazelment/yoloswe/agent-cli-wrapper/codex client. The gateway keeps a long-lived app-server process, creates or resumes Codex threads, streams tool and token events, and sends turns with model, reasoning, approval, sandbox, and workspace settings.
Agent Browser is optional but first-class. CodexClaw can inject compact agent-browser workflow guidance into turns that need browser automation, screenshots, login-state reuse, or page interaction. The integration follows the upstream agent-browser CLI workflow: open a page, inspect snapshot -i, interact by @e refs, re-snapshot after changes, and close the session when done.
When allowlist.enabled is true, CodexClaw ignores messages unless the sender is listed.
allowlist:
enabled: true
entries:
- telegram:123456789
- whatsapp:31612345678
- whatsapp:31612345678@s.whatsapp.net
- discord:123456789012345678Telegram authorization uses message.from.id. WhatsApp authorization uses the sender phone/user JID. Discord authorization uses the message author user ID. Sessions still map to the chat destination, so Telegram topics, WhatsApp DMs/groups, Discord DMs, Discord channels, and Discord threads each keep separate Codex sessions.
/new [name]
/session
/session <id|name>
/status
/model [model-name|default] [--global]
/reasoning [low|medium|high|xhigh|default] [--global]
/skills
/self_refresh
/self_update
/remember <text>
/memory
/memory graph
/link <from-memory-id> <relation> <to-memory-id>
/unlink <link-id>
/forget <id|all>
/browser
Session commands:
/new [name]creates a fresh Codex thread and makes it active./sessionlists stored sessions for the current chat scope./session <id|name>switches to a stored session.
Status, model, and reasoning:
/statusshows active session, thread ID, context mode, model, cumulative token usage, last-turn token usage, reasoning level, and compaction settings./model <model-name>changes the model for the active session./model <model-name> --globalupdatescodex.modelin the loaded config file and persists across restarts./model defaultresets the active session to the config default./reasoning <level>changes reasoning for the active session./reasoning <level> --globalupdatescodex.effortin the loaded config file and persists across restarts./reasoning defaultresets the active session to the config default.
Memory:
/remember <text>saves persistent memory for the current chat scope.- The memory skill is loaded by default, quietly remembers durable personal facts such as
I'm Dutch,my name is Dominic, orI prefer concise answers, and keeps replies natural. Add$memoryto explicitly inject selected saved memory graph context. /memorylists saved memory nodes./memory graphlists memory nodes plus graph links./link <from-memory-id> <relation> <to-memory-id>manually creates a typed edge between memories./unlink <link-id>removes one graph edge./forget <id|all>deletes one memory item or clears all memory for the current scope. Links are removed with deleted memories.- CodexClaw automatically links new memories to related existing memories and includes a tiny relevant graph neighborhood when the message matches saved memory. Add
$memoryor$memoriesfor manual graph context, or$memory allfor every memory.
Skills:
/skillslists available skills.$skill-nameattaches a matching Codex skill to the next turn.$skillsand$skill-dictionaryinject a compact dictionary of available skill names into the next turn.$memoryand$memoriesexplicitly inject selected saved memory graph context for the current chat; the memory skill itself is loaded by default.$skill-creatorinjects a compact dictionary entry for creating or updating Codex skills.$agent-browserand$browserinject compactagent-browserCLI guidance. Whenagent_browser.auto_injectis enabled, CodexClaw also adds this guidance automatically for URL/browser/page-interaction requests.$sttand$speech-to-textuse configured speech-to-text for attached Telegram voice/audio and WhatsApp audio messages.$ttsand$text-to-speechsynthesize the final answer into an audio message when text-to-speech is configured./browsershows whether the integration is enabled, which command is configured, auto-inject state, the shared browser session name, and whetheragent-browseris onPATH./speechshows whether STT and TTS are configured.
Self-management:
/self_refreshfetchesorigin/main, verifies the running checkout is aligned with it, and then schedules a process restart. If the checkout is behind, ahead, or diverged, it reports the state and leaves the process running./self_updatefetchesorigin/main, fast-forwards the localmainbranch when the worktree is clean, and then schedules a process restart. It refuses to run from another branch or with uncommitted changes.
Speech is built in as transport plumbing plus tiny dictionary skills. The default setup uses Edge TTS for text-to-speech and faster-whisper for speech-to-text through uv, so the runtime stays configurable without injecting provider docs into every prompt. Faster-whisper runs locally; Edge TTS uses Microsoft's online speech service.
speech:
timeout_seconds: 300
stt:
enabled: true
command: "uv run --with faster-whisper scripts/stt-faster-whisper.py --json {input}"
tts:
enabled: true
command: "scripts/tts-edge-tts.sh {text} {output}"
mime: audio/mpeg
file_name: reply.mp3
auto_for_audio: trueCommand placeholders are shell-quoted by CodexClaw:
- STT receives
{input}and should print JSON withtextandlanguagefields. Plain transcript stdout is still accepted. - TTS receives
{text}. If the command contains{output}, it must write audio to that path; otherwise stdout is treated as audio bytes. auto_for_audiosends a synthesized audio reply automatically when the incoming message contains voice/audio.$ttsstill forces audio replies for text messages.
Install or prime the speech dependencies with:
mise install
mise run speech:installUseful environment overrides:
CODEXCLAW_WHISPER_MODEL=baseselects the faster-whisper model.CODEXCLAW_WHISPER_DEVICE=cpuandCODEXCLAW_WHISPER_COMPUTE_TYPE=int8control inference.CODEXCLAW_EDGE_TTS_VOICE=en-US-AriaNeuralselects the Edge TTS voice.CODEXCLAW_EDGE_TTS_VOICE_NL=nl-NL-ColetteNeuraloverrides the Dutch voice used when faster-whisper detectsnl.
agent_browser:
enabled: true
command: agent-browser
auto_inject: true
session: codexclaw
max_output: 12000Use these tasks to install or repair the local browser tooling:
mise run browser:install
mise run browser:doctor
mise run browser:skill
mise run browser:core -- --fullbrowser:skill installs the upstream vercel-labs/agent-browser skill globally for Codex through skills.sh. browser:core prints the version-matched CLI skill from the installed agent-browser binary.
CodexClaw includes mise tasks for skills.sh discovery/installation and local skill/plugin creation.
mise run skills:find -- github
mise run skills:add -- vercel-labs/agent-skills
mise run skills:list
mise run skills:updateskills:add runs npx --yes skills add with telemetry disabled by default and installs globally for the Codex agent. Override the target with SKILLS_AGENT=<agent>.
Local scaffolds:
mise run skill:new -- repo-maintainer "Repository maintenance workflow"
mise run plugin:new -- repo-tools "Repository tools for Codex"New skills are created under ./skills/<name>/SKILL.md. New plugins are created under ./plugins/<name>/.codex-plugin/plugin.json with an empty skills/ directory ready for plugin-owned skills.
Telegram photos/documents and WhatsApp images/documents are downloaded to media.dir.
- Documents are saved locally and included in the text input as filesystem paths so Codex can inspect them with workspace tools.
- Images are saved locally and included in the Codex turn as local attachment paths. Their paths are also listed in the text input for traceability.
CodexClaw defaults to persistent context mode. A chat session keeps using the same Codex app-server thread ID until /new creates a new one or /session switches to another stored session.
Minimal context mode is available when you explicitly want every message to run in a fresh Codex thread with only the selected memory, skill dictionary entries, and current message.
sessions:
context_mode: persistentValid values are minimal and persistent. You can override the mode with:
CODEXCLAW_SESSIONS_CONTEXT_MODE=persistentThe Codex app-server wrapper does not expose an explicit compaction endpoint. When sessions.auto_compact is true and the threshold is reached, CodexClaw records the threshold as handled and reports that explicit compaction is unavailable for this backend.
sessions:
context_mode: persistent
auto_compact: true
auto_compact_after_tokens: 120000pm2 start /usr/bin/mise --name codex-claw --cwd "$PWD" -- exec -- go run ./cmd/codexclaw serve
pm2 status codex-claw
pm2 logs codex-clawThe active runtime gateway lives in internal/codexapp and uses the Codex app-server wrapper on every supported platform.
mise install
mise exec -- gofmt -w ./cmd ./internal
mise exec -- env CGO_ENABLED=0 go test ./...
mise exec -- env CGO_ENABLED=0 go build ./...GitHub Actions builds 0.0.0-alpha.1 artifacts for:
linux/amd64linux/arm64darwin/amd64darwin/arm64windows/amd64windows/arm64
Each artifact is named codexclaw_0.0.0-alpha.1_<os>_<arch> and includes a SHA256 file.
CodexClaw is intended for private, allowlisted operation. Do not commit real config.yml, .env, WhatsApp sessions, or runtime databases. The included .gitignore excludes those files by default.
CodexClaw is an independent, free open-source project and is not affiliated, associated, authorized, endorsed by, or in any way officially connected with OpenAI, OpenClaw, or any of their subsidiaries or affiliates. "OpenAI", "Codex", and "OpenClaw" are trademarks of their respective owners.
MIT License. You can use, copy, modify, merge, publish, distribute, sublicense, and sell copies under the MIT terms. Published versions of CodexClaw that are released under MIT remain available under those MIT terms for people who receive them; later project changes do not take those granted rights away from those copies.