/matrix-client:check-loginfrom matrix-client
Check whether Element Desktop and the matrix-commander CLI are logged in to Matrix, and as which user. Use on "am I logged in to Matrix".
Ships in matrix-client. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Reports, for each client, whether a session exists, the user id, homeserver and device id. Read-only: changes nothing.
mx_user_id, mx_hs_url, mx_device_id from it:
for d in "${XDG_CONFIG_HOME:-$HOME/.config}/Element" "$HOME/.var/app/im.riot.Riot/config/Element" "$HOME/Library/Application Support/Element"; do
[ -d "$d/Local Storage/leveldb" ] || continue
echo "== $d"
strings "$d/Local Storage/leveldb/"* 2>/dev/null | grep -A1 -E '^(mx_user_id|mx_hs_url|mx_device_id)$' | grep -v -- '^--$'
done
The value is the line after each key; it can carry a one-byte prefix (e.g. !), strip it.
LevelDB keeps old values until compaction: if several user ids show up, the last pair printed
is usually the current one. Confirm visually in Element (avatar menu) if it matters.
No output = Element never logged in on this profile (or a different Element profile is used).MC_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/matrix-commander"
mc() { matrix-commander -c "$MC_DIR/credentials.json" -s "$MC_DIR/store" "$@"; }
if [ -f "$MC_DIR/credentials.json" ]; then
jq '{homeserver, user_id, device_id, room_id}' "$MC_DIR/credentials.json"
mc --whoami 2>&1 | tail -n 3
else
echo "CLI not logged in: no $MC_DIR/credentials.json"
fi
--whoami returning the user id proves the access token is still valid on the server; the file
existing alone does not. Never print access_token.mc --devices 2>&1 | tail -n 30 lists
every device of the account; the Element mx_device_id should appear there.--whoami / localStorage only). If the CLI is not logged in, offer cli-login.--whoami hits the server.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
matrix-client@danielrosehill is listed by danielrosehill/claude-code-plugins — review the source before installing
npx claudepluginhub danielrosehill/claude-code-plugins --plugin matrix-client6 skills in this plugin
/cli-loginLog the matrix-commander CLI in to a Matrix account (password or SSO) as a new device, then verify it. Use on "log the Matrix CLI in"./install-clientInstall a Matrix client on this computer: Element Desktop (GUI) and the matrix-commander CLI. Use on "install Matrix", "set up Element"./list-roomsList the Matrix rooms the logged-in account is in, with names, aliases, encryption and members. Use on "which Matrix rooms am I in"./read-messagesRead recent Matrix messages in a room (last N, incl. your own) or wait for new ones. Use on "what's new on Matrix"./send-messageSend a Matrix message (text, Markdown, notice or file) to a room via matrix-commander. Use on "send X on Matrix".