Add Matrix Channel (add-matrix)
Wires a Matrix channel into a NanoClaw project: copies the adapter, registers it, pins the dependency, and configures bot credentials.
AutomationAdvanced★ 30,471⑂ 12,865AI score 7/10Last updated: Aug 9, 2026
What it does
Adds Matrix messaging support to the NanoClaw agent runtime. Channels don't ship in trunk, so the skill pulls the Matrix adapter from the channels branch and then:
- Copies
src/channels/matrix.tsplus its registration test - Appends the single self-registration import to
src/channels/index.ts - Installs
@beeper/chat-adapter-matrixat an exact pinned version (ranges andlatestare rejected by policy) - Patches
matrix-js-sdkESM imports so they resolve under Node 22 strict ESM - Runs
pnpm run buildand the registration test to prove the wiring - Walks you through creating a dedicated bot account and storing
MATRIX_*env vars
Every mechanical step is expressed as an idempotent nc: directive, so an agent or a parser can apply the same document and re-running is always safe.
Who it's for
- NanoClaw users who want to talk to their agent over Matrix instead of Slack/Discord
- Teams running their own homeserver (Synapse) or using matrix.org
- Developers who like reproducible, single-document install procedures
Note: this is tightly coupled to the NanoClaw repo layout and won't transfer to other projects as-is.
Examples
- First-time setup — ask "use add-matrix to enable the Matrix channel"; the agent copies the adapter, installs the pinned dep, prompts for homeserver URL, bot user ID and display name, then writes
.env. - Recovering a broken build — after a
pnpm installwipes the ESM patch andERR_MODULE_NOT_FOUND: matrix-js-sdk/lib/...appears, just re-run step 4. - Debugging auth — an
M_FORBIDDENlogin error is usuallyMATRIX_USERNAME(localpart) swapped withMATRIX_USER_ID(full ID); the troubleshooting section walks through it.
· · · Install guide · · ·
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the .claude/skills/add-matrix folder from the GitHub repo nanocoai/nanoclaw into my ~/.claude/skills/add-matrix/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/nanocoai/nanoclaw.git && mkdir -p ~/.claude/skills && cp -r nanoclaw/.claude/skills/add-matrix ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and clone the repo:
git clone https://github.com/nanocoai/nanoclaw.git - Create the skills folder:
mkdir -p ~/.claude/skills - Copy the skill in:
cp -r nanoclaw/.claude/skills/add-matrix ~/.claude/skills/ - Change into the project:
cd nanoclaw(the skill only works inside this repository). - Register a separate Matrix account for the bot at app.element.io (Matrix cannot DM your own account) and note its user ID, e.g.
@andybot:matrix.org. - Start Claude Code and say: "Use the add-matrix skill to add a Matrix channel."
- Answer the prompts (homeserver URL, bot user ID, display name, and either password or access token); they are written to
.env. - Confirm
pnpm run buildandpnpm exec vitest run src/channels/matrix-registration.test.tspass, then run/manage-channelsto attach the channel to an agent group.
View source on GitHub ↗License: MIT