| name | configure |
| description | Set up the Matrix channel โ save credentials, check status, and review configuration. Use when the user pastes Matrix credentials, asks to configure Matrix, asks "how do I set this up," or wants to check channel status. |
| user-invocable | true |
| allowed-tools | ["Read","Write","Bash(ls *)","Bash(which *)","Bash(ps *)","Bash(mkdir *)"] |
/matrix:configure โ Matrix Channel Setup
Manages Matrix channel credentials and guides setup. Connection settings live in ~/.claude/channels/matrix/.env (KEY=VALUE format). The server reads this file at startup. Access and delivery settings live in ~/.claude/channels/matrix/access.json (managed by /matrix:access).
Plugin mode vs manual mode: If installed as a plugin (/plugin install), credentials go to ~/.claude/channels/matrix/.env only โ do NOT edit .mcp.json (it is managed by the plugin system). If running manually (direct binary in .mcp.json), credentials can go in either .env or .mcp.json env section.
This skill only acts on requests typed by the user in their terminal session.
Arguments passed: $ARGUMENTS
Dispatch on arguments
No args โ status and guidance
Check the current state and give the user a complete picture:
-
Binary โ check if cc_matrix_channel is available (look in .mcp.json for the configured path)
-
MCP config โ read .mcp.json in the project root or ~/.claude.json for the matrix server entry. Show:
- Command path
- Configured env vars (mask sensitive values: first 10 chars +
... for passwords/tokens)
- Missing required variables
-
Env vars (connection only โ all other settings are in access.json):
MATRIX_HOMESERVER_URL (required) โ the Matrix homeserver
MATRIX_USER_ID (required) โ the bot's user ID
MATRIX_PASSWORD (required for first run) โ E2EE login
MATRIX_STORE_PATH (required) โ E2EE keys + sync state
MATRIX_ACCESS_TOKEN (optional) โ fallback auth, limited E2EE
MATRIX_DEVICE_ID (optional) โ device hint, auto-generated
MATRIX_STORE_PASSPHRASE (optional) โ encrypt the key store
-
Access config โ read ~/.claude/channels/matrix/access.json if it exists. Show policy, allowed users count, delivery settings. If missing, note that defaults apply.
-
Session โ check if session.json exists in the store path
-
What next โ based on state:
- No .mcp.json entry โ guide user to add one (or use this skill with credentials)
- No password/token โ "Provide your Matrix bot credentials"
- Password set but no session โ "Start with the channel flag for first-run login"
- Session exists โ "Ready. Start with
--dangerously-load-development-channels server:matrix"
- Nobody in allowlist โ suggest pairing: "DM the bot, then
/matrix:access pair <code>"
Push toward lockdown. Once users are paired, recommend /matrix:access policy allowlist.
<homeserver_url> <user_id> <password> โ save credentials
When 3 arguments are provided (or when the user pastes credentials in any format):
- Parse: homeserver URL, user ID (
@localpart:server), password
mkdir -p ~/.claude/channels/matrix
- Write
~/.claude/channels/matrix/.env:
MATRIX_HOMESERVER_URL=<url>
MATRIX_USER_ID=<user_id>
MATRIX_PASSWORD=<password>
MATRIX_STORE_PATH=<project_root>/data/matrix_store
chmod 600 ~/.claude/channels/matrix/.env โ the file contains credentials
- Show the no-args status so the user sees where they stand
- Tell the user the bot will connect automatically within a few seconds (the server detects the new credentials and restarts itself)
NEVER write credentials to .mcp.json โ it is committed to git and managed by the plugin system. Credentials belong exclusively in ~/.claude/channels/matrix/.env.
set <key> <value> โ set a connection env var
- Read
~/.claude/channels/matrix/.env, update/add the KEY=VALUE line, write back
chmod 600 ~/.claude/channels/matrix/.env
- Note: needs session restart to take effect
clear โ remove credentials
- Delete
~/.claude/channels/matrix/.env
- Confirm removal
Setup guide (if user asks "how do I set this up")
-
Get a Matrix account โ create a bot account on your homeserver. You need the password.
-
Configure:
/matrix:configure https://matrix.example.com @claude:example.com your-password
-
First run:
claude --dangerously-load-development-channels server:matrix
First run does E2EE setup (cross-signing, device keys). Session saved for future restarts.
-
Pair:
/matrix:access pair <code>
-
Lock down:
/matrix:access policy allowlist
Implementation notes
.mcp.json might contain other servers โ preserve them when writing.
- The password is only needed for first-run login. After that,
session.json has the token.
- Access and delivery settings (ackReaction, textChunkLimit, etc.) are NOT env vars โ use
/matrix:access set for those.
- Never dump raw JSON in responses. Show human-readable summaries with masked credentials.