Skip to content

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

fix(wrap): drop -p short flag from wrap claude so claude's own -p/--print passes through (#2048)

Eyal Mizrachi14011b42dd75
diff --git a/headroom/cli/wrap.py b/headroom/cli/wrap.py
index a794542bb..614b32737 100644
--- a/headroom/cli/wrap.py
+++ b/headroom/cli/wrap.py
@@ -3871,7 +3871,11 @@ def unwrap() -> None:
@wrap.command(context_settings={"ignore_unknown_options": True})
@click.option(
- "--port", "-p", default=8787, type=click.IntRange(1, 65535), help="Proxy port (default: 8787)"
+ # no "-p" short alias here: claude's own -p/--print must fall through to CLAUDE_ARGS
+ "--port",
+ default=8787,
+ type=click.IntRange(1, 65535),
+ help="Proxy port (default: 8787)",
)
@click.option(
"--no-context-tool",
diff --git a/tests/test_cli/test_wrap_helpers.py b/tests/test_cli/test_wrap_helpers.py
index 68de4d098..10418a857 100644
--- a/tests/test_cli/test_wrap_helpers.py
+++ b/tests/test_cli/test_wrap_helpers.py
@@ -122,6 +122,16 @@ def test_claude_context_tool_is_opt_in_for_prepare_only(
assert prepare_rtk.call_count == 1
+def test_wrap_claude_allows_claude_print_short_flag_in_passthrough_args() -> None:
+ """Claude owns -p/--print; wrap claude must not parse it as --port."""
+ result = CliRunner().invoke(
+ main,
+ ["wrap", "claude", "--prepare-only", "-p", "Say only: hello"],
+ )
+
+ assert result.exit_code == 0, result.output
+
+
def test_claude_context_tool_opt_in_preserves_lean_ctx_selection(
monkeypatch: pytest.MonkeyPatch,
) -> None: