utils/leetcode_coach/leetcode_coach/leetcode
Krzysztof kuhy Rudnicki 96a0d8af07 leetcode launcher: stop exporting PYTHONPATH into the coached session
The REPL passes os.environ to `claude -p`, so a PYTHONPATH set by the
launcher reached every hook and every Bash call of the coached session. The
old launcher did not do that. The launcher now runs `/usr/bin/python3 -P -m
leetcode_coach.leetcode_repl` and relies on install.sh's editable install,
the same way the Stop-hook shim does. A test now pins that the launcher
sets no PYTHONPATH.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PjvF5DZG9JduSBYKxqyysi
2026-10-23 15:12:31 +02:00

18 lines
836 B
Bash
Executable File

#!/bin/bash
# ============================================================================
# leetcode — coaching session in print mode, on the cheapest model.
# Print mode matters: the no-solution Stop gate can only withhold a reply
# from a client that waits for hooks, and the interactive TUI streams first.
# leetcode <url-or-slug> [what you are stuck on...]
#
# Symlinked from ~/.local/bin/leetcode. The package is found through
# install.sh's editable install, like the Stop-hook shim; no PYTHONPATH here,
# because the REPL passes its environment on to `claude -p` and every hook and
# Bash call of the coached session would inherit it. -P keeps cwd off sys.path.
# ============================================================================
set -euo pipefail
exec /usr/bin/python3 -P -m leetcode_coach.leetcode_repl "$@"