[FEATURE]: Slash commands should preserve trailing input when no argument placeholders are defined #6920

Closed
opened 2026-02-16 18:05:36 -05:00 by yindo · 1 comment
Owner

Originally created by @Troyanovsky on GitHub (Jan 20, 2026).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Problem

Currently, when invoking a slash command without argument placeholders, any text written after the command is silently discarded.

Example:

/my-command please focus on performance

If /my-command has no $1, $2, or $ARGUMENTS placeholders, the trailing text (please focus on performance) is ignored instead of being passed along to the final prompt sent to the LLM.

This makes slash commands unnecessarily rigid and limits their usefulness for session-specific steering or ad-hoc refinement.

Expected / Proposed Behavior

If a slash command does not define any argument placeholders, then any trailing input after the command should be preserved and appended to the expanded command prompt.

Conceptually, this behaves like an optional final free-form string argument, similar to how many CLI tools work.

Example:

/my-command please focus on performance

Would result in:

<expanded command prompt> please focus on performance

Why This Is Useful

  • We can steer model behavior without modifying command definitions
  • Aligns with other AI coding tools (e.g. Claude Code, Gemini CLI), where trailing input is appended automatically
  • We don't need to over-parameterize commands with placeholders that may not always be needed

Other Notes

This change can be fully backward-compatible:

  • Existing commands with placeholders continue to behave exactly as they do today
  • The new behavior only applies when no placeholders are present
  • No changes required to command configuration, parsing, or client-side handling
Originally created by @Troyanovsky on GitHub (Jan 20, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request ### Problem Currently, when invoking a slash command **without argument placeholders**, any text written after the command is silently discarded. Example: ``` /my-command please focus on performance ``` If `/my-command` has no `$1`, `$2`, or `$ARGUMENTS` placeholders, the trailing text (`please focus on performance`) is ignored instead of being passed along to the final prompt sent to the LLM. This makes slash commands unnecessarily rigid and limits their usefulness for session-specific steering or ad-hoc refinement. ### Expected / Proposed Behavior If a slash command **does not define any argument placeholders**, then any trailing input after the command should be **preserved and appended** to the expanded command prompt. Conceptually, this behaves like an **optional final free-form string argument**, similar to how many CLI tools work. Example: ``` /my-command please focus on performance ``` Would result in: ``` <expanded command prompt> please focus on performance ``` ### Why This Is Useful * We can steer model behavior without modifying command definitions * Aligns with other AI coding tools (e.g. Claude Code, Gemini CLI), where trailing input is appended automatically * We don't need to over-parameterize commands with placeholders that may not always be needed ### Other Notes This change can be fully backward-compatible: * Existing commands **with placeholders** continue to behave exactly as they do today * The new behavior only applies when **no placeholders are present** * No changes required to command configuration, parsing, or client-side handling
yindo added the discussion label 2026-02-16 18:05:36 -05:00
yindo closed this issue 2026-02-16 18:05:36 -05:00
Author
Owner

@bitloi commented on GitHub (Jan 20, 2026):

@thdxr Can you please let me know if I can work on this issue?

@bitloi commented on GitHub (Jan 20, 2026): @thdxr Can you please let me know if I can work on this issue?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6920