Use Claude Code, Codex, VSCode, Pi, and OpenCode (and 6 other harnesses) for free (1.3B+ free tokens) from your terminal, app, IDE, or phone, and now from the browser with native browser sessions (multi-harness + multi-model) like OpenClaw (voice supported + ToS friendly)
Python
Restore Claude model discovery without enabling telemetry (#1118)
Ali Khokhar343e5674bfb5
diff --git a/README.md b/README.mdindex f93770e6..7aa49e07 100644--- a/README.md+++ b/README.md@@ -231,7 +231,10 @@ Install the [Claude Code extension](https://marketplace.visualstudio.com/items?i{ "name": "ANTHROPIC_AUTH_TOKEN", "value": "freecc" },{ "name": "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY", "value": "1" },{ "name": "CLAUDE_CODE_AUTO_COMPACT_WINDOW", "value": "190000" },- { "name": "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC", "value": "1" }+ { "name": "DISABLE_AUTOUPDATER", "value": "1" },+ { "name": "DISABLE_FEEDBACK_COMMAND", "value": "1" },+ { "name": "DISABLE_ERROR_REPORTING", "value": "1" },+ { "name": "DISABLE_TELEMETRY", "value": "1" }]```@@ -275,7 +278,10 @@ Set the environment for `acp.registry.claude-acp`:"ANTHROPIC_AUTH_TOKEN": "freecc","CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1","CLAUDE_CODE_AUTO_COMPACT_WINDOW": "190000",- "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"+ "DISABLE_AUTOUPDATER": "1",+ "DISABLE_FEEDBACK_COMMAND": "1",+ "DISABLE_ERROR_REPORTING": "1",+ "DISABLE_TELEMETRY": "1"}```diff --git a/pyproject.toml b/pyproject.tomlindex 3c3d5508..ceef9fb6 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -4,7 +4,7 @@ build-backend = "hatchling.build"[project]name = "free-claude-code"-version = "4.5.1"+version = "4.5.2"description = "Local proxy connecting coding agents to OpenAI-compatible AI providers"readme = "README.md"requires-python = ">=3.14.0"diff --git a/smoke/prereq/test_cli_prereq_live.py b/smoke/prereq/test_cli_prereq_live.pyindex d5411688..db058b39 100644--- a/smoke/prereq/test_cli_prereq_live.py+++ b/smoke/prereq/test_cli_prereq_live.py@@ -73,6 +73,9 @@ def test_claude_cli_prompt_when_available()server_log = server.log_path.read_text(encoding="utf-8", errors="replace")assert result.returncode == 0, result.stderr or result.stdout+ assert "GET /v1/models" in server_log, (+ "Claude CLI did not discover models from the local gateway"+ )assert "POST /v1/messages" in server_log, ("Claude CLI did not call the local Anthropic-compatible endpoint")diff --git a/smoke/product/test_client_product_live.py b/smoke/product/test_client_product_live.pyindex 138f4c66..b6ee1c10 100644--- a/smoke/product/test_client_product_live.py+++ b/smoke/product/test_client_product_live.py@@ -192,8 +192,8 @@ def test_claude_cli_provider_error_e2e(combined = f"{result.stdout}\n{result.stderr}"lower = combined.lower()- downstream_requests = sum(- "POST /v1/messages" in line and "HTTP/1.1" in line+ failed_downstream_requests = sum(+ "POST /v1/messages" in line and "400 Bad Request" in linefor line in server_log.splitlines())@@ -202,7 +202,7 @@ def test_claude_cli_provider_error_e2e(assert "proxy or gateway intercepting" not in lowerassert "api error" in lower or "selected model" in lowerassert "fcc smoke provider rejected the request deliberately" in lower- assert downstream_requests == 1, server_log+ assert failed_downstream_requests == 1, server_logassert provider_requests == ["/v1/chat/completions"]diff --git a/src/free_claude_code/cli/claude_env.py b/src/free_claude_code/cli/claude_env.pyindex 42c942b3..3be8010a 100644--- a/src/free_claude_code/cli/claude_env.py+++ b/src/free_claude_code/cli/claude_env.py@@ -5,7 +5,6 @@ from collections.abc import Mappingfrom free_claude_code.cli.proxy_auth import proxy_auth_tokenCLAUDE_CODE_AUTO_COMPACT_WINDOW = "190000"-CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1"CLAUDE_BINARY_NAME = "claude"@@ -17,16 +16,19 @@ def build_claude_proxy_env() -> dict[str, str]:"""Return the canonical environment for Claude Code proxy sessions."""+ # Claude's aggregate traffic flag also suppresses gateway model discovery.env = {key: valuefor key, value in base_env.items()if not key.startswith("ANTHROPIC_")+ and key != "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC"}env["ANTHROPIC_BASE_URL"] = proxy_root_urlenv["ANTHROPIC_AUTH_TOKEN"] = proxy_auth_token(auth_token)env["CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY"] = "1"env["CLAUDE_CODE_AUTO_COMPACT_WINDOW"] = CLAUDE_CODE_AUTO_COMPACT_WINDOW- env["CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC"] = (- CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC- )+ env["DISABLE_AUTOUPDATER"] = "1"+ env["DISABLE_FEEDBACK_COMMAND"] = "1"+ env["DISABLE_ERROR_REPORTING"] = "1"+ env["DISABLE_TELEMETRY"] = "1"return envdiff --git a/tests/cli/test_cli.py b/tests/cli/test_cli.pyindex 8bcdb224..eda69150 100644--- a/tests/cli/test_cli.py+++ b/tests/cli/test_cli.py@@ -621,7 +621,9 @@ class TestManagedClaudeSession:assert env["ANTHROPIC_AUTH_TOKEN"] == "proxy-token"assert env["CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY"] == "1"assert env["CLAUDE_CODE_AUTO_COMPACT_WINDOW"] == "190000"+ assert env["DISABLE_TELEMETRY"] == "1"assert "ANTHROPIC_API_KEY" not in env+ assert "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC" not in env@pytest.mark.asyncioasync def test_start_task_uses_sentinel_when_proxy_auth_blank(self):diff --git a/tests/cli/test_entrypoints.py b/tests/cli/test_entrypoints.pyindex 80827d8a..ac2e844c 100644--- a/tests/cli/test_entrypoints.py+++ b/tests/cli/test_entrypoints.py@@ -468,7 +468,12 @@ def test_claude_child_env_targets_current_proxy_config() -> None:"ANTHROPIC_BASE_URL": "https://api.anthropic.com","ANTHROPIC_AUTH_TOKEN": "old-token","ANTHROPIC_API_KEY": "official-key",- "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "0",+ "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "0",+ "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",+ "DISABLE_AUTOUPDATER": "0",+ "DISABLE_FEEDBACK_COMMAND": "0",+ "DISABLE_ERROR_REPORTING": "0",+ "DISABLE_TELEMETRY": "0",},)@@ -477,9 +482,13 @@ def test_claude_child_env_targets_current_proxy_config() -> None:assert env["ANTHROPIC_AUTH_TOKEN"] == "proxy-token"assert env["CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY"] == "1"assert env["CLAUDE_CODE_AUTO_COMPACT_WINDOW"] == "190000"- assert env["CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC"] == "1"+ assert env["DISABLE_AUTOUPDATER"] == "1"+ assert env["DISABLE_FEEDBACK_COMMAND"] == "1"+ assert env["DISABLE_ERROR_REPORTING"] == "1"+ assert env["DISABLE_TELEMETRY"] == "1"assert "ANTHROPIC_API_URL" not in envassert "ANTHROPIC_API_KEY" not in env+ assert "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC" not in envdef test_claude_child_env_uses_sentinel_for_blank_configured_auth_token() -> None:@@ -537,7 +546,11 @@ def test_launch_claude_passes_args_and_child_env(assert child_env["ANTHROPIC_AUTH_TOKEN"] == "proxy-token"assert child_env["CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY"] == "1"assert child_env["CLAUDE_CODE_AUTO_COMPACT_WINDOW"] == "190000"- assert child_env["CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC"] == "1"+ assert child_env["DISABLE_AUTOUPDATER"] == "1"+ assert child_env["DISABLE_FEEDBACK_COMMAND"] == "1"+ assert child_env["DISABLE_ERROR_REPORTING"] == "1"+ assert child_env["DISABLE_TELEMETRY"] == "1"+ assert "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC" not in child_envassert child_env["KEEP_ME"] == "yes"register_pid.assert_called_once_with(12345)unregister_pid.assert_called_once_with(12345)diff --git a/tests/cli/test_managed_claude.py b/tests/cli/test_managed_claude.pyindex debc63c7..7aa0fd1a 100644--- a/tests/cli/test_managed_claude.py+++ b/tests/cli/test_managed_claude.py@@ -68,7 +68,11 @@ def test_managed_claude_builds_new_task_command_and_env() -> None:assert invocation.env["ANTHROPIC_AUTH_TOKEN"] == "proxy-token"assert invocation.env["CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY"] == "1"assert invocation.env["CLAUDE_CODE_AUTO_COMPACT_WINDOW"] == "190000"- assert invocation.env["CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC"] == "1"+ assert invocation.env["DISABLE_AUTOUPDATER"] == "1"+ assert invocation.env["DISABLE_FEEDBACK_COMMAND"] == "1"+ assert invocation.env["DISABLE_ERROR_REPORTING"] == "1"+ assert invocation.env["DISABLE_TELEMETRY"] == "1"+ assert "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC" not in invocation.envassert "ANTHROPIC_API_URL" not in invocation.envassert "ANTHROPIC_API_KEY" not in invocation.envassert invocation.trace_metadata["client_cli_id"] == "claude"@@ -136,7 +140,8 @@ def test_managed_claude_env_only_adds_noninteractive_process_settings() -> None:"PATH": "keep","ANTHROPIC_API_URL": "https://api.anthropic.com/v1","ANTHROPIC_API_KEY": "official-key",- "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "0",+ "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",+ "DISABLE_TELEMETRY": "0",}proxy_env = build_claude_proxy_env(proxy_root_url="http://localhost:8082",diff --git a/uv.lock b/uv.lockindex 4b6a4672..a94b8ed0 100644--- a/uv.lock+++ b/uv.lock@@ -561,7 +561,7 @@ wheels = [[[package]]name = "free-claude-code"-version = "4.5.1"+version = "4.5.2"source = { editable = "." }dependencies = [{ name = "aiohttp" },