Amazon Q CLI slows down zsh startup and every prompt on macOS: workaround?
On macOS 15.3.2 with zsh, the Amazon Q Developer CLI integration adds init scripts to both ~/.zshrc and ~/.zprofile and runs a q _ pre-cmd hook before every prompt, making new terminal sessions slow to start and the shell feel sluggish. Profiling shows the initialization runs twice and pre-cmd costs about 11ms per command. Is there a fix or workaround?
Originally asked on GitHub: https://github.com/aws/amazon-q-developer-cli/issues/844
3 answers
Status: still open. Maintainers acknowledged the slowdown and, as of 2025-05-27, said they were building a standalone binary for
q chatdecoupled from autocomplete andqterm, but no fix or ETA has been shipped in this thread.The reporter's profiling found two main costs on macOS 15.3.2. First, the official installer adds the same
q init zsh preblock to both~/.zprofileand~/.zshrc, so the integration initializes twice per shell startup (confirmed withzprofandset -x). Second,q _ pre-cmdruns before every prompt and measured about 11ms, andq _ should-figterm-launchadded about 13ms at startup while falling back to an old mechanism becauseqtermis not launched.The issue body proposes a workaround: wrap the sourcing block in
~/.zprofilein a guard variable so it does not run again from~/.zshrc, but only the snippet was posted; the thread contains no timing results after applying it, so effectiveness is unverified. A commenter also suggested lazily loading the shell integration on first use, but that was only an idea.One caution from the thread: a commenter reported that Q's MCP servers (github, brave_search, fetch, context_7_mcp, firecrawl) failed with "Operation timed out: recv for initialize" unless the shell integration scripts were present in the profile, and the fig_desktop logs showed the integration was not installed in
.zshrc/.zprofile. Removing the integration may therefore break MCP tool loading, although this is a reported observation, not a tested conclusion.Did this work for you?What a GitHub user tried on GitHub (Outcome unclear)
The reporter profiled zsh with zprof and set -x, finding the same q init zsh pre block runs twice from ~/.zprofile and ~/.zshrc. They proposed guarding the sourcing block in ~/.zprofile with an AMAZON_Q_INITIALIZED variable, and measured q _ pre-cmd at ~11ms per prompt and q _ should-figterm-launch at ~13ms at startup.
Source: https://github.com/aws/amazon-q-developer-cli/issues/844 (opens external site)
Did this work for you?What @sammcj tried on GitHub (Outcome unclear)
The reporter observed that Q's MCP servers failed with 'Operation timed out: recv for initialize' unless the slowdown shell integration scripts were sourced in the profile, and fig_desktop logs showed the integration was not installed in .zshrc/.zprofile.
Did this work for you?
Related questions
- Ghostty support for Amazon Q Developer CLI: version and autocomplete fix?
- Amazon Q CLI autocomplete popover renders at wrong position in Ghostty on macOS
- Amazon Q CLI failing with InternalServerException "trouble responding right now" — still open?
- Does amazon-q-developer-cli support MCP resources? resource:// URIs aren't read
- How to run Amazon Q Developer CLI (q chat) non-interactively in scripts?