[FEATURE] Make every slash command agent-invokable (and their output agent-readable) — /reload-plugins as a concrete AI-first blocker

Resolved 💬 4 comments Opened Apr 11, 2026 by ChanMeng666 Closed May 23, 2026

Summary

Some slash commands (most notably /reload-plugins, but also /clear, /compact, /doctor, /exit) have no CLI or tool equivalent, so an in-session Claude Code agent cannot run them on behalf of the human. When the agent could run them, their output is not captured back into the conversation. The combination makes it impossible to build plugins, skills, or workflows that are fully operable by Claude Code itself — every such feature ends up with at least one "now you (human) type this slash command" step.

Request: make every user-facing slash command reachable by the in-session agent, and pipe the command's output back into the agent's context.

Why this matters

The headline promise of plugins + skills + hooks is: "the human says what they want in natural language; Claude Code does the rest." Today that promise breaks the moment a workflow touches /reload-plugins, /clear, /compact, etc. — the human has to stop, read a README, type a slash command verbatim, watch for output, and resume. That one manual step fragments the AI-first experience and makes plugins/skills feel like thin wrappers around a human-driven CLI.

The agent already has Bash tool access. claude plugin marketplace add/install/uninstall/enable/disable/update/list/validate all work via Bash. But the moment the reload step is needed, we hit a wall:

$ claude plugin --help
# (no reload subcommand listed)

Related prior art showing this is a real pain point:

  • #36847 — feat: SIGHUP handler for config and plugin reload (headless-friendly alternative to /reload-plugins)
  • #35312 — [FEATURE] Expose /clear and /compact as callable tool actions
  • #28559 — Feature Request: Native /compact tool with customizable instructions for autonomous context management
  • #46377 — Agent SDK query() does not expand slash commands / skills

Each of these chips at one corner. I'm asking for the principle: no slash command should be "human-only" by design, and no slash command's output should be invisible to the agent that triggered it.

Concrete example — a real plugin blocked by this today

I maintain claude-code-audio-hooks, a Claude Code plugin that adds audio notifications to all 26 hook events. The project's entire design point is AI-first: a human says "install audio hooks for me" or "snooze audio for an hour" and the in-session Claude Code agent does the rest — installs, configures, enables/disables hooks, snoozes, troubleshoots, upgrades — via a single JSON-output CLI (audio-hooks), a SKILL that maps natural language to subcommands, NDJSON structured logs with stable error codes, and zero interactive prompts.

Every step of the install flow is agent-runnable via Bash except one:

| Step | Command | Who runs it today |
|---|---|---|
| 1 | claude plugin marketplace add ChanMeng666/claude-code-audio-hooks | ✅ Agent (Bash tool) |
| 2 | claude plugin install audio-hooks@chanmeng-audio-hooks | ✅ Agent (Bash tool) |
| 3 | /reload-plugins | ❌ Human must type this in the REPL |
| 4 | audio-hooks diagnose && audio-hooks test all | ✅ Agent (Bash tool) |

Step 3 is the only thing that breaks the natural-language promise. I had to ship a v5.0.3 documentation correction release specifically to stop overclaiming that the agent could handle the whole install — because /reload-plugins is a REPL-only command and there is no claude plugin reload CLI equivalent. My README now has to carry a yellow-highlighted block in a mermaid sequence diagram pointing at the one step the human has to do manually. It's a papercut that shouldn't exist.

This is not specific to audio-hooks. Any plugin that wants to be AI-installable will hit this same wall the moment a reload/clear/compact/doctor step enters the flow.

Proposed fix

Two things, either independently useful, both together solving the whole problem:

1. Every slash command gets a claude CLI equivalent or an in-session tool surface

Concretely:

  • claude plugin reload (or claude reload-plugins) — maps to /reload-plugins. Exits with structured JSON on completion.
  • claude session clear — maps to /clear.
  • claude session compact [--instructions …] — maps to /compact. (See #28559, #35312.)
  • claude doctor — maps to /doctor. Emits JSON.
  • General rule: every slash command listed in /help should be invokable either (a) as a claude … subcommand the in-session Bash tool can call, or (b) as a first-class in-session tool the agent can invoke directly (like TodoWrite, Edit, etc.), or (c) as a skill (so the agent can invoke it via the existing Skill surface).

Relatedly: claude plugin reload should be runnable from within an existing session and reload that session's plugin state without requiring a REPL restart — see also #36847 (SIGHUP-based reload) as a parallel implementation path.

2. Output of slash commands runs through the agent's context

When a slash command is invoked (whether by the human in the REPL or by the agent via tool/CLI), its stdout/stderr and any structured result should be captured and made available to the agent as tool output — in the same way Bash tool output is. Today, even when the human runs /reload-plugins, the agent can't see whether it succeeded, whether hooks registered, whether skills loaded — it can only ask the human to paste the output back. This is a second, subtler bottleneck: even if (1) is fixed, the agent still can't verify the outcome of a slash command it didn't directly run.

The fix is: slash command output should land in the conversation as a visible tool result, not as ephemeral REPL text only the human sees.

3. Nice-to-have: document which slash commands are reachable from where

A table in the docs showing every slash command × (REPL | claude CLI | in-session tool | skill) so plugin/skill authors can tell at design time whether their workflow will hit a human-only wall. Today I only discovered the /reload-plugins gap by shipping, watching a real user install fail, and grep'ing claude plugin --help.

Non-goals / what I'm not asking for

  • I'm not asking for all slash commands to be auto-run without human consent. Consent gating (approval prompts, permission modes) should stay in place — I just want the mechanism to exist so agents can propose and execute these commands through the normal tool-approval flow, rather than having the human retype them.
  • I'm not asking the agent to bypass interactive auth/login flows (/login, /logout). Those legitimately require a human.
  • I'm not asking to change the REPL UX for humans who prefer slash commands.

Impact

Without this fix, the "AI-first plugin" design pattern has a structural ceiling: every such plugin ends up shipping a README with a "now you type this slash command" step and a blog post explaining why the AI can't do it itself. With this fix, the ceiling disappears — a human can say "install plugin X" and the agent can do the entire dance end-to-end, including the reload/verify steps, with no human typing required beyond the initial natural-language request.

Happy to help test any proposed design against the audio-hooks plugin as a real-world reference workload.

---

Filed by @ChanMeng666, maintainer of claude-code-audio-hooks.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗