/claudemd:claudemd-statuslinefrom claudemd
Register, check or remove claudemd's statusLine (user@host:dir, branch, model, and context / 5h / weekly quota used %) in ~/.claude/settings.json, idempotently and never over another provider's slot without --force. Use when the user asks to add or set up a status line, or wants claudemd's segment beside or instead of another one.
Ships in claudemd. Installing the plugin adds it to Claude Code.
Usage: /claudemd-statusline | /claudemd-statusline --force | /claudemd-statusline check | /claudemd-statusline remove
Run: node ${CLAUDE_PLUGIN_ROOT}/scripts/statusline-adopt.js detect --json
Branch on verdict:
absent → slot is free. Continue to Step 1 (adopt).claudemd → already configured. Report the stable path ~/.claude/claudemd-statusline.sh and dest.matchesShipped. If false, offer to re-run adopt (refreshes the renderer copy). STOP unless the user wants a refresh.foreign → another provider owns the slot (report current). Do NOT write. Tell the user their existing statusline is untouched and that /claudemd-statusline --force will take it over (saving the current statusLine so remove can restore it). Continue to Step 1 ONLY if the user passed --force.host → the slot is owned by a composite host (host, e.g. code-graph) that renders multiple providers. Do NOT clobber it. Run detect --json and read providers, guestRegistered and rendererInUse:
guestRegistered: true → claudemd is already a segment. Report and STOP unless the user wants a refresh (re-run adopt). If rendererRunBy is non-empty, another provider runs the same renderer and claudemd's segment shows twice: say so; remove unregisters claudemd's own entry and keeps the renderer for that provider.guestRegistered: false, rendererInUse: true → the host already runs claudemd's renderer under another provider id, listed in rendererRunBy (code-graph keeps a slot it took over as _previous). Registering would show claudemd's segment twice. Report that id and STOP; register (Step 1) only if the user asks for a second segment. If dest.matchesShipped is false, offer adopt --empty-only, which refreshes the renderer copy and registers nothing.guestRegistered: false, rendererInUse: false → claudemd will register as a guest so both segments show (claudemd | code-graph). Read the psCandidates array from detect --json — each entry is a hand-made PS1 (a bash script under ~/.claude/ that isn't a plugin, e.g. user-ps1) claudemd can supersede. If it is non-empty, list those ids and ASK: supersede one (adopt --supersede=<id>, saved for restore) or keep both (adopt). Continue to Step 1.check mode (no writes)Run Step 0. Report verdict, current, and whether ~/.claude/claudemd-statusline.sh exists and matches the shipped renderer (dest.matchesShipped). STOP.
remove modeShow the transition first: run detect --json; if verdict is claudemd, state what settings.statusLine will become (the prior statusLine as it was saved — the whole object, padding included — if one was saved, else removed) and that ~/.claude/claudemd-statusline.sh will be deleted. If verdict is host and guestRegistered, remove unregisters claudemd from the host's registry (restoring a superseded provider if one was saved and the host has no provider with its id now) and deletes the renderer unless another provider runs it once the remove is done: one listed in rendererRunBy, or a superseded provider the remove restores; then the file stays and the result's rendererKept names that provider. The host keeps the slot. Then run:
node ${CLAUDE_PLUGIN_ROOT}/scripts/statusline-adopt.js remove --json
Report the action (removed / restored / unregistered / not-ours). For unregistered, cite restored if any, notRestored if set (saved providers left in ~/.claude/.claudemd-state/statusline-prev.json because the host already has a provider with that id), and rendererKept (the providers the renderer was kept for) if set. If not-ours, nothing was changed.
Writing ~/.claude/settings.json — or, for the host/guest path, the host's registry files (~/.cache/code-graph/statusline-registry.json + ~/.claude/statusline-providers.json) — is a §5 hard-AUTH action: both are user-global writes. BEFORE writing, show the user exactly what changes:
statusLine command that will be set: bash "$HOME/.claude/claudemd-statusline.sh"foreign + --force: the current statusLine that will be saved for restore~/.claude/claudemd-statusline.shbash "<abs>/.claude/claudemd-statusline.sh" written into the host's registry (~/.cache/code-graph/statusline-registry.json + ~/.claude/statusline-providers.json), and — if superseding — which provider is replacedPreview with --dry-run if useful: node ${CLAUDE_PLUGIN_ROOT}/scripts/statusline-adopt.js adopt [--force] --dry-run --json. Ask once, then proceed.
Run (add --force only for the foreign take-over the user approved; for the host case, pass --supersede=<id> only if the user chose to supersede):
node ${CLAUDE_PLUGIN_ROOT}/scripts/statusline-adopt.js adopt [--force] [--supersede=<id>] --json
If adopt exits 1 with statusline-adopt failed: statusline: <path> parses to null, not a JSON object (or to an array, a JSON string, a JSON number or a JSON boolean): nothing was written, and detect reads such a file as absent. Tell the user to replace the file's content with a JSON object ({} is valid) and re-run.
Re-run node ${CLAUDE_PLUGIN_ROOT}/scripts/statusline-adopt.js detect --json and cite verdict: claudemd as the completion evidence. Report: the action from Step 2 (set / replaced / refreshed), the settings backup path (if any), and — for a --force replace — that the prior statusLine was saved and is restorable via /claudemd-statusline remove. For the host case, cite guestRegistered: true from a re-run detect --json and the action (registered / already-registered), plus the superseded id if any. If adopt returned supersedeMissed, tell the user that supersede target was not in the registry (a stale id) so nothing was superseded — claudemd still registered.
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub sdsrss/claudemd --plugin claudemd11 commands in this plugin
/claudemd-auditAggregate claudemd rule-hits over the last N days. Shows top banned patterns, hook deny counts, per-spec-section heatmap, and bypass-escape-hatch usage./claudemd-clean-residueFind and remove claudemd leftovers — test sentinels and sandboxes in $TMPDIR, tool-exhaust in ~/.claude/tmp older than TMP_RETENTION_DAYS (default 7), orphaned per-session state files, and headless-probe project dirs. Dry-run by default; `--apply` deletes./claudemd-design-adoptGenerate a fact-based DESIGN.md from a UI project's existing design tokens and wire it into project CLAUDE.md, so agents stop inventing colors and spacing. Use when the user asks to configure design specs for agents (配置设计规范 / 设计规范), or a UI project has design tokens but no DESIGN.md. Modes — check, remove./claudemd-doctorHealth check of the claudemd install — dependencies, spec and hook drift, settings.json, backups, hook fail-opens and memory hygiene. Supports --prune-backups=N and --ack-fail-open./claudemd-installBootstrap claudemd in the CURRENT Claude Code session (copy spec into ~/.claude/, install hook manifest, evict legacy entries). Use right after `/plugin install claudemd@claudemd` to skip the wait-for-next-session restart./claudemd-refreshUpdate the installed claudemd plugin to the latest release in one step (marketplace update, uninstall, install). Use when the SessionStart banner reports a newer version or /claudemd-doctor flags a stale plugin cache; restart Claude Code afterwards.