/claw-mo:claw-mo-open file-or-dir | - | [--group name] [--stdin]from claw-mo
Opens a specific markdown file, directory, or piped content in the mo markdown viewer. Useful for quickly previewing documents or adding files to a running mo server.
Ships in claw-mo. 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.
Add a specific file, directory, or piped markdown content to the running mo server and open the browser directly on that file.
For config schema, HTTP API, deep-linking, and browser opening: read ${CLAUDE_PLUGIN_ROOT}/references/shared.md
$ARGUMENTS — one of:
docs/spec.mddocs/ (added as a watch pattern)- or --stdin: read markdown from stdin (e.g., cat notes.md | /claw-mo-open -)--group <name> to pin the target group (otherwise auto-detected)/claw-mo-open docs/spec.md/claw-mo-open plans/ --group planssome-tool | /claw-mo-open - --group scratchParse $ARGUMENTS:
--stdin or a bare - → stdin moderealpath--group; if absent, auto-detect from config (match the file path against each group's patterns, fall back to default)Prerequisites: command -v mo >/dev/null 2>&1.
Project key: git rev-parse --show-toplevel (fallback: $PWD).
Read config from ${CLAUDE_PLUGIN_DATA}/config.json.
Check running server: mo --status --json → is a server on $PORT?
If server is running AND config exists — verify sync before mutating:
shared.md)/claw-mo-up would clear+rebuild this runtime; ask whether to resync first or add into the drifted runtime/claw-mo-up unless config is updatedAdd the content based on mode:
(a) File path, server running:
curl -s -X POST "http://localhost:$PORT/_/api/groups/$GROUP/files" \
-H 'Content-Type: application/json' \
-d "{\"path\": \"$(realpath file.md)\"}"
(b) Directory, server running:
curl -s -X POST "http://localhost:$PORT/_/api/patterns" \
-H 'Content-Type: application/json' \
-d "{\"pattern\": \"$(realpath dir)/**/*.md\", \"group\": \"$GROUP\"}"
(c) Stdin, server running: mo's single-instance detection pushes stdin content to the running server automatically:
cat | mo --no-open -p $PORT -t "$GROUP"
(d) Server NOT running:
/claw-mo-up behavior first (restart if server reappears mid-flight), then retry step 7echo $((6300 + $(echo "$PROJECT_ROOT" | cksum | cut -d' ' -f1) % 100))mo --no-open -p $PORT "$(realpath file.md)"mo --no-open -p $PORT "$(realpath dir)" (mo converts dir → dir/*.md watch)cat | mo --no-open -p $PORT${CLAUDE_PLUGIN_DATA}/config.json:
{ "PROJECT_ROOT": { "port": PORT, "groups": { "default": ["*.md"] } } }
/claw-mo-setup to customize watch groups."Resolve deep-link URL — try to open directly on the added file, not just the group:
File mode:
FILE_ID=$(curl -s "http://localhost:$PORT/_/api/groups" | python3 -c "
import sys, json, os
target = '$(realpath file.md)'
for g in json.load(sys.stdin):
for f in g.get('files', []):
if f.get('path') == target:
print(f['id']); break
")
URL="http://localhost:$PORT/$GROUP"
[ -n "$FILE_ID" ] && URL="$URL?file=$FILE_ID"
Stdin mode: mo generates stdin-<hash>.md. Look up its ID the same way, matching by name prefix stdin-.
Directory mode: no single file to link to; use http://localhost:$PORT/$GROUP.
Open browser using the cmux-preferred logic from shared.md (reuse existing surface if one targets this port).
Report — what was added (path or stdin-<hash>.md), which group, whether the session was reused/resynced, the resolved URL.
realpath before sending./claw-mo-up unless persisted through /claw-mo-setup or /claw-mo-manage.dir/**/*.md) explicitly. mo's CLI does that conversion for free when you pass a dir as a positional arg — that's why quick-open uses the CLI form./GROUP still works and the new file will appear in the sidebar via SSE.stdin-<hash>.md).cat | mo requires stdin to not be a TTY. Fine when a pipe is present; fails silently if Claude somehow passes an interactive stdin. The shell pipe cat | mo forces non-TTY./claw-mo-up, /claw-mo-down, and /claw-mo-manage can find the session.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
5 skills in this plugin
/claw-mo-downStop the mo markdown viewer server for the current project. Use when the user says claw-mo-down, wants to stop mo, shut down doc viewer, or kill mo server./claw-mo-manageManage mo markdown viewer — check status, add/remove patterns and groups, refresh, stop servers, reset. Use when checking mo status, modifying watch patterns, or troubleshooting./claw-mo-setupConfigure mo markdown viewer for the current project. Use when the user wants to set up doc watching, configure mo patterns, initialize claw-mo for a project, or set up markdown viewer groups.npx claudepluginhub leejuoh/claude-code-zero --plugin claw-moOther plugins' skills for the same job