[FEATURE] /alias command

Resolved 💬 8 comments Opened Dec 19, 2025 by aewing Closed Feb 28, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

I often wish I could compose slash commands, "@" references, etc... into simpler key inputs, create aliases for commands or directories, and otherwise simplify my use of Claude Code using short aliases that expand out to text I configure.

Proposed Solution

I propose an /alias command that modifies ~/.claude/aliases or .claude/aliases with configurable user aliases that when typed and followed by a whitespace character (tab, space, enter) expands into the configured text in the input element.

/alias add @foo @src/lib/foo
/alias edit /c /compact [...]
/alias list
/alias rm /c
/alias edit (external editor)
vi ~/.claude/aliases
vi ./.claude/aliases

Alias expansion in prompt inputs would solve a number of use cases that I have seen requested regarding alias support for commands, directories, or slash commands. They would also serve as a simpler alternative to simple slash commands or agent prompts for many use cases that would avoid context pollution while offering the same result to users.

Alternative Solutions

Type a lot more, create slash commands or agents that pollute context.

Priority

High - Significant impact on productivity

Feature Category

Interactive mode (TUI)

Use Case Example

Add a file/directory reference alias:
/alias add @foo @src/lib/foo
Add a slash command or action alias:
/alias edit /c /compact [...] $1 [...]:
List aliases:
/alias list
Remove an alias:
/alias rm /c
Edit aliases in an external editor:
/alias edit (external editor)
(global or project scoped)
vi ~/.claude/aliases
vi ./.claude/aliases

Additional Context

Bash aliases but for Claude Code

View original on GitHub ↗

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