From 624986b42682604b836a23888432e358fa018d74 Mon Sep 17 00:00:00 2001 From: Brett Heap Date: Fri, 13 Nov 2026 21:51:54 -0400 Subject: [PATCH 1/2] docs(claude-current): clarify resolver output streams --- claude-current | 3 +++ 1 file changed, 3 insertions(+) diff --git a/claude-current b/claude-current index 5656cbf1..3d8882fe 100755 --- a/claude-current +++ b/claude-current @@ -120,6 +120,9 @@ first when every installed copy is behind. Never resolved through PATH. (status is verified, ahead, unverified or stale) --offline no npm read and no update: the newest installed copy, unverified +On resolution, stdout is one absolute executable path (or the four porcelain +fields above). Diagnostics and update progress go to stderr. + Exit 0 resolved, 1 nothing runnable, 2 refused as stale, 64 usage or a malformed CLAUDE_CURRENT_* bound. CLAUDE_ALLOW_STALE=1 launches a stale copy anyway. The CLAUDE_CURRENT_* From 4ec0fbad0275cf85331fddc9cd63f8c768885108 Mon Sep 17 00:00:00 2001 From: Brett Heap Date: Fri, 13 Nov 2026 21:52:29 -0400 Subject: [PATCH 2/2] test(claude-current): cover help before malformed bounds --- tests/test_claude_current.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_claude_current.py b/tests/test_claude_current.py index b6794801..4954e468 100644 --- a/tests/test_claude_current.py +++ b/tests/test_claude_current.py @@ -1034,6 +1034,18 @@ def test_help_and_an_unknown_argument(box): assert "unknown argument: --bogus" in result.stderr +@pytest.mark.parametrize("flag", ["--help", "-h"]) +@pytest.mark.parametrize("name", ["TIMEOUT", "VERSION_TIMEOUT", "UPDATE_TIMEOUT", "LOCK_WAIT"]) +def test_help_precedes_malformed_bounds_without_running_tools(box, flag, name): + result = box.run(flag, **{f"CLAUDE_CURRENT_{name}": "not-a-number"}) + assert result.returncode == 0, result.stderr + assert result.stdout.startswith("claude-current [--porcelain] [--offline]\n") + assert result.stderr == "" + assert box.npm_log.read_text() == "" + assert box.node_log.read_text() == "" + assert box.claude_log.read_text() == "" + + @pytest.mark.parametrize("name", ["TIMEOUT", "VERSION_TIMEOUT", "UPDATE_TIMEOUT", "LOCK_WAIT"]) def test_a_malformed_bound_is_refused_before_anything_runs(box, name): """64, the usage status, and not 1: a launcher reports 1 as "no Claude