feat(zshrc): skip interactive shell setup for Claude Code sessions

Add CLAUDECODE=1 environment variable check to bail early from full
interactive shell setup, matching behavior for Cursor and VSCode.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Jim Myhrberg
2026-01-20 16:21:30 +00:00
parent c0694b0494
commit ab9042fbae

4
zshrc
View File

@@ -16,10 +16,12 @@
# Cursor's agent setup, which is used when the agent runs terminal commands. # Cursor's agent setup, which is used when the agent runs terminal commands.
# Though it does also set a proper `TERM` value sometimes, hence the check for # Though it does also set a proper `TERM` value sometimes, hence the check for
# `CURSOR_AGENT` as well. # `CURSOR_AGENT` as well.
# - Claude Code's shell sessions, identified by `CLAUDECODE=1`.
# #
if [[ -n "$VSCODE_RESOLVING_ENVIRONMENT" ]] || if [[ -n "$VSCODE_RESOLVING_ENVIRONMENT" ]] ||
[[ "$TERM" == "dumb" ]] || [[ "$TERM" == "dumb" ]] ||
[[ "$CURSOR_AGENT" == "1" ]]; then [[ "$CURSOR_AGENT" == "1" ]] ||
[[ "$CLAUDECODE" == "1" ]]; then
return return
fi fi