add-emacs
Skill4 starsChanged 6 months agoMITView on GitHub
Add Emacs as a channel. Opens an interactive chat buffer and org-mode integration so you can talk to NanoClaw from within Emacs (Doom, Spacemacs, or vanilla). Local HTTP bridge — no bot token or external service needed.
- Reads credentials
3 other projects use a version of this, 3 of them edited.
Adopted by
Most recently taken up by
- prathish-ks/isthmusedited, first seen Oct 6, 2026
- nanocoai/nanoclawedited, first seen Oct 4, 2026
- TomGranot/groupguardedited, first seen Sep 3, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 3
- nanocoai/nanoclaw★ 31k84% same
- TomGranot/groupguard★ 484% same
- prathish-ks/isthmus★ 284% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository51 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- container/CLAUDE.mdCLAUDE.md
- add-amplifier-agentSkill
- add-atomic-chat-toolSkill
- add-codexSkill
- add-dashboardSkill
- add-deltachatSkill
- add-discordSkill
- add-gcal-toolSkill
- add-gchatSkill
- add-githubSkill
- add-gmail-toolSkill
- add-imessageSkill
- add-karpathy-llm-wikiSkill
- add-linearSkill
- add-macos-statusbarSkill
- add-matrixSkill
- add-mnemonSkill
- add-ollama-providerSkill
- add-ollama-toolSkill
- add-opencodeSkill
- add-parallelSkill
- add-resendSkill
- add-rtkSkill
- add-signalSkill
- add-slackSkill
- add-teamsSkill
- add-telegramSkill
- add-vercelSkill
- add-webexSkill
- add-wechatSkill
- add-whatsapp-cloudSkill
- add-whatsappSkill
- clawSkill
- convert-to-apple-containerSkill
- customizeSkill
- debugSkill
- get-qodo-rulesSkill
- init-first-agentSkill
- init-onecliSkill
- manage-channelsSkill
- manage-mountsSkill
- migrate-from-openclawSkill
- migrate-from-v1Skill
- migrate-nanoclawSkill
- qodo-pr-resolverSkill
- setupSkill
- update-nanoclawSkill
- update-skillsSkill
- use-native-credential-proxySkill
- x-integrationSkill
The file
We split this skill into the rules it gives an agent
12 rules. 3 are common, 0 are distinctive, and 9 are very specific to this project.
3
Common
Most of the 3 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 61
No npm package to install — the adapter uses only Node builtins (http).
- Very specific: line 86
Run /init-first-agent — pick Emacs as the channel, use any short handle as the "user id" (e.g.
- Very specific: line 90
Run the register step directly.
- Very specific: line 151
If EMACS_AUTH_TOKEN is set, also add (any distribution):
- Very specific: line 157
If you changed EMACS_CHANNEL_PORT from the default:
- Common: line 165
Run from your NanoClaw project root:
- Common: line 218
Not applicable (design): multi-user channels, threads, cold DM initiation, typing indicators, attachments.
- Very specific: line 237
If grep "Emacs channel listening" logs/nanoclaw.log returns nothing, check that EMACS_ENABLED=true is in .env and that the adapter import …
- Very specific: line 250
If no messaging group row exists, run the register command above.
- Very specific: line 258
Must match EMACS_AUTH_TOKEN in .env.
- Very specific: line 270
If NanoClaw is cloned elsewhere, update the load/load-file path in your Emacs config.
- Common: line 284
If an agent outputs org-mode directly, markers get double-converted and render incorrectly.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add Emacs Channel
Adds Emacs support via a local HTTP bridge. Works with Doom Emacs, Spacemacs, and vanilla Emacs 27.1+.
What you can do with this
- Ask while coding — open the chat buffer (
C-c n c/SPC N c), ask about a function or error without leaving Emacs - Code review — select a region and send it with
nanoclaw-org-send; the response appears as a child heading inline in your org file - Meeting notes — send an org agenda entry; get a summary or action item list back as a child node
- Draft writing — send org prose; receive revisions or continuations in place
- Research capture — ask a question directly in your org notes; the answer lands exactly where you need it
Install
NanoClaw doesn't ship channels in trunk. This skill copies the Emacs adapter and the Lisp client in from the channels branch. Native HTTP bridge — no Chat SDK, no adapter package.
Pre-flight (idempotent)
Skip to Enable if all of these are already in place:
src/channels/emacs.tsexistsemacs/nanoclaw.elexistssrc/channels/index.tscontainsimport './emacs.js';
Otherwise continue. Every step below is safe to re-run.
1. Fetch the channels branch
git fetch origin channels2. Copy the adapter and Lisp client
mkdir -p emacs
git show origin/channels:src/channels/emacs.ts > src/channels/emacs.ts
git show origin/channels:src/channels/emacs.test.ts > src/channels/emacs.test.ts
git show origin/channels:emacs/nanoclaw.el > emacs/nanoclaw.el3. Append the self-registration import
Append to src/channels/index.ts (skip if the line is already present):
import './emacs.js';4. Build
pnpm run buildNo npm package to install — the adapter uses only Node builtins (http).
Enable
The adapter is gated by EMACS_ENABLED so the HTTP port isn't opened on hosts that aren't running Emacs. Add to .env:
EMACS_ENABLED=true
EMACS_CHANNEL_PORT=8766 # optional — change only if 8766 is taken
EMACS_AUTH_TOKEN= # optional — set to a random string to lock the endpoint
EMACS_PLATFORM_ID=default # optional — only change if you want a non-default chat idGenerate an auth token (recommended even on single-user machines — prevents other local processes from poking the endpoint):
node -e "console.log(require('crypto').randomBytes(16).toString('hex'))"Wire the channel
Emacs is a single-user, single-chat channel. One host = one messaging group with platform_id = "default".
If this is your first agent group
Run /init-first-agent — pick Emacs as the channel, use any short handle as the "user id" (e.g. your OS username), and the skill will create the agent group, wire the channel, and write a welcome message that the agent delivers back to your Emacs buffer.
Otherwise — wire to an existing agent group
Run the register step directly. The EMACS_PLATFORM_ID (default default) becomes the messaging group's platform id:
pnpm exec tsx setup/index.ts --step register -- \
--platform-id "default" --name "Emacs" \
--folder "<existing-folder>" --channel "emacs" \
--session-mode "agent-shared" \
--assistant-name "<existing-assistant-name>"agent-shared puts Emacs messages in the same session as any other channel wired to the same agent group — so a conversation you started in Telegram continues in Emacs. Use shared to keep an independent Emacs thread with the same workspace, or a new --folder for a dedicated Emacs-only agent.
Configure Emacs
nanoclaw.el needs only Emacs 27.1+ builtins (url, json, org) — no package manager.
AskUserQuestion: Which Emacs distribution are you using?
- Doom Emacs —
config.elwithmap!keybindings - Spacemacs —
dotspacemacs/user-configin~/.spacemacs - Vanilla Emacs / other —
init.elwithglobal-set-key
Doom Emacs — add to ~/.config/doom/config.el (or ~/.doom.d/config.el):
;; NanoClaw — personal AI assistant channel
(load (expand-file-name "~/src/nanoclaw/emacs/nanoclaw.el"))
(map! :leader
:prefix ("N" . "NanoClaw")
:desc "Chat buffer" "c" #'nanoclaw-chat
:desc "Send org" "o" #'nanoclaw-org-send)Reload: M-x doom/reload
Spacemacs — add to dotspacemacs/user-config in ~/.spacemacs:
;; NanoClaw — personal AI assistant channel
(load-file "~/src/nanoclaw/emacs/nanoclaw.el")
(spacemacs/set-leader-keys "aNc" #'nanoclaw-chat)
(spacemacs/set-leader-keys "aNo" #'nanoclaw-org-send)Reload: M-x dotspacemacs/sync-configuration-layers or restart Emacs.
Vanilla Emacs — add to ~/.emacs.d/init.el:
;; NanoClaw — personal AI assistant channel
(load-file "~/src/nanoclaw/emacs/nanoclaw.el")
(global-set-key (kbd "C-c n c") #'nanoclaw-chat)
(global-set-key (kbd "C-c n o") #'nanoclaw-org-send)Reload: M-x eval-buffer or restart Emacs.
Replace ~/src/nanoclaw/emacs/nanoclaw.el with your actual NanoClaw checkout path.
If EMACS_AUTH_TOKEN is set, also add (any distribution):
(setq nanoclaw-auth-token "<your-token>")If you changed EMACS_CHANNEL_PORT from the default:
(setq nanoclaw-port <your-port>)Restart NanoClaw
Run from your NanoClaw project root:
pnpm run build
source setup/lib/install-slug.sh
launchctl kickstart -k gui/$(id -u)/$(launchd_label) # macOS
# systemctl --user restart $(systemd_unit) # LinuxVerify
HTTP endpoint
curl -s http://localhost:8766/api/messages?since=0Expected: {"messages":[]}. With an auth token:
curl -s -H "Authorization: Bearer <token>" http://localhost:8766/api/messages?since=0From Emacs
Tell the user:
- Open the chat buffer with your keybinding (
SPC N c,SPC a N c, orC-c n c)- Type a message and press
C-c C-cto send (RET inserts newlines)- A response should appear within a few seconds
For org-mode: open any
.orgfile, position the cursor on a heading, and useSPC N o/SPC a N o/C-c n o
Log line
tail -f logs/nanoclaw.log should show Emacs channel listening at startup.
Channel Info
- type:
emacs - terminology: Single local buffer. There are no "groups" or separate chats — one host = one chat, addressed by a
platform_idstring (defaultdefault). - how-to-find-id: The platform id is whatever you set in
EMACS_PLATFORM_ID(defaultdefault). User handles are arbitrary; your OS username or first name is fine (e.g.emacs:<username>). - supports-threads: no
- typical-use: Single developer talking to the assistant from within Emacs, alongside whatever other channel they use (Slack, Telegram, Discord).
- default-isolation: Same agent group as the primary DM, with
session-mode = agent-sharedso a conversation started elsewhere continues in Emacs. Pick a separate folder only if you specifically want an Emacs-only persona.
Features
- Interactive chat buffer (
nanoclaw-chat) with markdown → org-mode rendering - Org integration (
nanoclaw-org-send) — sends the current subtree or region; reply lands as a child heading - Optional bearer-token auth for the local endpoint
- Single-user: the adapter exposes exactly one messaging group per host
Not applicable (design): multi-user channels, threads, cold DM initiation, typing indicators, attachments.
Troubleshooting
Port already in use
Error: listen EADDRINUSE: address already in use :::8766Either a stale NanoClaw is running or another app has the port. Kill stale process or change port:
lsof -ti :8766 | xargs kill -9
# or set EMACS_CHANNEL_PORT in .env and mirror in Emacs config (nanoclaw-port)Adapter not starting
If grep "Emacs channel listening" logs/nanoclaw.log returns nothing, check that EMACS_ENABLED=true is in .env and that the adapter import is present:
grep -q '^EMACS_ENABLED=true' .env && echo "enabled" || echo "not enabled"
grep -q "import './emacs.js'" src/channels/index.ts && echo "imported" || echo "not imported"No response from agent
- NanoClaw running:
launchctl list | grep "$(. setup/lib/install-slug.sh && launchd_label)"(macOS) /systemctl --user status "$(. setup/lib/install-slug.sh && systemd_unit)"(Linux) - Messaging group wired:
pnpm exec tsx scripts/q.ts data/v2.db "SELECT mg.platform_id, ag.folder FROM messaging_groups mg JOIN messaging_group_agents mga ON mg.id = mga.messaging_group_id JOIN agent_groups ag ON ag.id = mga.agent_group_id WHERE mg.channel_type = 'emacs'" - Logs show inbound:
grep 'channel_type=emacs\|Emacs' logs/nanoclaw.log | tail -20
If no messaging group row exists, run the register command above.
Auth token mismatch (401 Unauthorized)
M-x describe-variable RET nanoclaw-auth-token RETMust match EMACS_AUTH_TOKEN in .env. If you didn't set one server-side, clear it in Emacs too:
(setq nanoclaw-auth-token nil)nanoclaw.el not loading
ls ~/src/nanoclaw/emacs/nanoclaw.elIf NanoClaw is cloned elsewhere, update the load/load-file path in your Emacs config.
Agent Formatting
The Emacs bridge converts markdown → org-mode automatically. Agents should output standard markdown, not org-mode syntax:
| Markdown | Org-mode |
**bold** | *bold* |
*italic* | /italic/ |
~~text~~ | +text+ |
`code` | ~code~ |
```lang | #+begin_src lang |
If an agent outputs org-mode directly, markers get double-converted and render incorrectly.
Removal
Run from your NanoClaw project root:
rm src/channels/emacs.ts src/channels/emacs.test.ts emacs/nanoclaw.el
# Remove the `import './emacs.js';` line from src/channels/index.ts
# Remove EMACS_* lines from .env
pnpm run build
source setup/lib/install-slug.sh
launchctl kickstart -k gui/$(id -u)/$(launchd_label) # macOS
# systemctl --user restart $(systemd_unit) # Linux
# Remove the NanoClaw block from your Emacs config
# Optionally clean up the messaging group:
pnpm exec tsx scripts/q.ts data/v2.db "DELETE FROM messaging_group_agents WHERE messaging_group_id IN (SELECT id FROM messaging_groups WHERE channel_type='emacs'); DELETE FROM messaging_groups WHERE channel_type='emacs';"Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

