Shell startup command from ~/.zshenv rendered into Claude Code's input box on every new terminal session

Status Open
Reported on v2.1.218
Maintainer reply None cached
Activity 0 comments · opened Jul 23, 2026

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?

Every new Claude Code session, opened in a fresh terminal window, shows the
same line pre-filled in the message input box, sitting unsent with the cursor at the end:

source /Users/<user>/<project>/.venv/bin/activate

It is always this exact line, verbatim, regardless of what message was
actually last sent in the app — it does not vary with conversation history. This rules out
a "restore last sent message" explanation.

What Should Happen?

The input box should start empty regardless of what the underlying shell
executes on startup — shell startup output/commands should never leak into Claude Code's
own compose UI.

Error Messages/Logs

Steps to Reproduce

Steps to reproduce:

  1. Have a .venv in a project directory, with a shell rc file that auto-sources

.venv/bin/activate unconditionally on shell startup

  1. Open a new terminal window in that project directory and start a Claude Code session
  2. The message input box comes pre-filled with the exact source .../activate line,

unsent, cursor at the end

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.218

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗