When you write a wrapper function in fish, you can use the --wraps flag to inherit tab completions from the wrapped command:
function claude-minimax \
--wraps='claude' \
--description 'Run Claude Code against MiniMax M2.7 API'
ANTHROPIC_BASE_URL="https://api.minimax.io/anthropic" \
ANTHROPIC_MODEL="MiniMax-M2.7" \
claude $argv
endThe --wraps='claude' tells fish that claude-minimax is a wrapper around claude. This means that when you type claude-minimax -- and hit <Tab>, you get the same completion suggestions as claude --. Without it, fish has no way of knowing the relationship and you would get no completions at all.
You can stack multiple --wraps flags if your function wraps more than one command, and --wraps works even if the wrapped command is itself a wrapper. As the complete docs say:
The
-wor--wrapsoptions causes the specified command to inherit completions from another command, “wrapping” the other command. The wrapping command can also have additional completions. A command can wrap multiple commands, and wrapping is transitive: if A wraps B, and B wraps C, then A automatically inherits all of C’s completions.
The flag can also be set after the fact with complete --command claude-minimax --wraps claude but declaring it inline in the function definition is a nice way of self-documenting it.
The function docs cover this in more detail. The flag also pairs well with --description, which shows up when you list functions with functions or when fish suggests completions for the function itself.