[BUG] Tab completion broken for ! prefix bash commands

Status Open
Reported on v2.0.76
Maintainer reply None cached
Activity 21 comments · opened Dec 30, 2025

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Tab completion no longer works when typing bash commands with the ! prefix. When I press Tab while typing a command or path after !, nothing happens. Previously, Tab would complete command names and file paths.

What Should Happen?

Pressing Tab after ! should complete shell commands and file paths, like it did in previous versions.

Steps to Reproduce

  1. Start Claude Code
  2. Type !npm in (partial command)
  3. Press Tab
  4. Observe: No completion happens
  5. Expected: Should complete to !npm install

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

Not certain of exact version, but worked before Tab was repurposed from "Toggle Thinking mode" to completing suggested prompts.

Claude Code Version

2.0.76

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

Tab completion for !-prefixed input is contextually distinct from suggested prompt completion. When input starts with !, we're in "bash mode" and Tab should complete shell commands/paths. These two uses don't conflict, so both could work based on context.

View original on GitHub ↗

20 Comments

github-actions[bot] · 8 months ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/15598

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

unsafe9 · 8 months ago

+1 Additionally, it would be good to follow the zsh or bash setup for auto completion

alanhe421 · 7 months ago

any update?

github-actions[bot] · 6 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

AbdelrahmanHafez · 6 months ago

Still needed.

leighewarner · 6 months ago

Still needed.

ecancino · 6 months ago

Still needed.

self-reality · 5 months ago

Seeing a lot of duplicates of this issue which seem to point at one another in a loop. All of them are closed 🤷‍♂️. While the issue is there.

enterthematric · 5 months ago

Still needed, hope this is the right Issue to comment as there are many duplicates pointing at each other in a loop and closed.
Small things matter :)

XueyanZhang · 5 months ago

Still needed. It avoids interleaving b/w cc and terminal.

corby · 5 months ago

+1

brunoguindani · 4 months ago

Still needed. Following.

finikorg · 4 months ago

+1

jjoepayne · 3 months ago

+1

rgourique-olibra · 2 months ago

+1 still needed

alwinlin23 · 2 months ago

+1 still needed

donnybeelo · 2 months ago

+1 still needed

fenil-tss · 1 month ago

+1 still needed

berwynhoyt · 1 month ago

+1

mulka · 1 month ago

Still reproducing on 2.1.217 (macOS, iTerm2, zsh) — and it's broader than just command names.

File paths don't complete either. #71458 states that v2.1.193 added live file path autocomplete to bash mode, but on 2.1.217:

! cat CLA   <Tab>   →  nothing

run in a directory containing both CLAUDE.md and CLAUDE.local.md. No expansion, no menu, no-op. So either that shipped and regressed, or it never covered this case — worth confirming, since the docs issue is being tracked on the assumption it works.

Command names — the original repro is unchanged: !npm in + Tab completes nothing unless npm install is already in this project's ! history. History-based completion only helps after you've typed a command in full at least once, which is backwards from how every shell behaves.

Concrete cost: I drive a Raspberry Pi over SSH from Claude Code, running things like !scp teslausb.local:/mutable/TeslaCam/SentryClips/<long path> ~/Movies/TeslaCam/. With neither path nor command completion, those get typed by hand or I drop to a real terminal and lose the session context — exactly the interleaving another commenter mentions above.

Not asking for full zsh compsys integration (that's #7738). Local path completion plus $PATH binary names would remove most of the friction.

Showing cached comments. Read the full discussion on GitHub ↗