#custom slash command

1 messages · Page 1 of 1 (latest)

pearl kelp
#

Hi Krill — is there a way to register a custom slash command in openclaw.json that always routes to a specific agent, without going through the main agent or depending on workspace files like AGENTS.md? i am running version 2026.4.15

acoustic daggerBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

odd ibexBOT
glad shoalBOT
#

Short answer: not as an arbitrary Discord custom slash command in openclaw.json on 2026.4.15.

What is supported:

  1. Route a Discord channel/thread to a specific agent via bindings[]
  2. Then native slash commands in that conversation resolve on that agent, not main

The relevant bits are:

  • Discord slash commands run as agent:<agentId>:discord:slash:<userId>
  • They carry the routed conversation target session
  • Routing is config-driven, not AGENTS.md-driven

Example:

{
#
  agents: {
    list: [
      { id: "main", default: true },
      {
        id: "codex",
        runtime: {
          type: "acp",
          acp: {
            agent: "codex",
            backend: "acpx",
            mode: "persistent",
            cwd: "/workspace/openclaw"
          }
        },
        systemPromptOverride: "You are the coding agent."
#
      }
    ]
  },

  bindings: [
    {
      agentId: "codex",
      match: {
        channel: "discord",
        accountId: "default",
        peer: { kind: "channel", id: "222222222222222222" }
      }
    }
  ]
}
#

If you want a persistent ACP binding, use:

{
  bindings: [
    {
      type: "acp",
      agentId: "codex",
      match: {
        channel: "discord",
        accountId: "default",
        peer: { kind: "channel", id: "222222222222222222" }
      },
      acp: { label: "codex-main" }
    }
  ]
#
}

One important nuance:

  • AGENTS.md is not how routing happens
  • but it can still affect the target agent prompt if that agent’s workspace has bootstrap files
  • skipBootstrap only stops auto-creation, it does not disable existing file injection
  • if you want zero workspace-file dependence, use a clean dedicated workspace and/or agents.list[].systemPromptOverride

So the real answer is:

  • No generic openclaw.json feature for “register /mycmd -> agent X” on Discord
  • Yes deterministic slash-command-to-agent routing via bindings[] / type: "acp" bindings

Docs: