Skip to content
Source
Sign inSign up
pingdotgg/t3code

update the claude entrypoint identifier for accuracy #28410

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/28410/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Claude processes started by T3 Code identify themselves with CLAUDE_CODE_ENTRYPOINT. Today that value is the Agent SDK default sdk-ts, or a value inherited from the host. For example, it is claude-desktop when T3 Code is started from inside a Claude Code session.

Change

  • mergeClaudeProcessEnvironment in ClaudeHome.ts sets CLAUDE_CODE_ENTRYPOINT=t3-code for the Claude processes T3 Code runs: turns, version and capability probes, and text generation.
  • A value set in the instance's environment wins over t3-code.
  • A value set in Claude's settings.json env wins over both. Claude Code 2.1.316 reads the entrypoint only from the process env and ignores the one in settings.json, so T3 Code reads it from there itself. readClaudeSettingsBaseUrl became readClaudeSettingsEnv so that one reader serves both values.
  • In-app terminals do not change. An interactive claude started there keeps its own entrypoint.

Verification

  • ClaudeHome.test.ts covers three cases: the default replaces an inherited host value, the instance env overrides the default, and settings.json overrides both.
  • I ran Claude Code 2.1.316 against a local fake API and captured the request headers:
    • With CLAUDE_CODE_ENTRYPOINT=t3-code in the process env, the request carries User-Agent: claude-cli/2.1.316 (external, t3-code) and cc_entrypoint=t3-code.
    • With t3-code in the process env and a different value in settings.json, the request still carries t3-code. This is why T3 Code applies the settings.json value itself.
  • vp run check:changed passes.

Made with Claude Opus 5.5 in Claude Code, running in T3 Code.

🤖 Generated with Claude Code

    1. Approvability

      Verdict: Needs Human Approval

      Macroscope's review found this PR requires human approval — Claude launches now default their entrypoint identifier to "t3-code", while allowing instance and settings overrides. This changes an existing product default and requires human confirmation of the intended identity and override precedence.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    2. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB5.0 KiB+35 B (+0.7%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.3 KiB+35 B (+2.8%)2.0 KiB✅
      CodexLive turn WebSocket decoded21.5 KiB21.6 KiB+41 B (+0.2%)24.4 KiB✅
      CodexLive turn messages12+1 (+100.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.3 KiB1.3 KiB0 B (0.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.9 KiB21.9 KiB0 B (0.0%)24.4 KiB✅
      ClaudeLive turn messages220 (0.0%)8✅

      Baseline: 575579d · PR result: 4d75fb8 · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 108.5 KiB
      • Claude decoded thread snapshot: 108.8 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    3. Review in Change Stack →

      No actionable comments were generated in the recent review.

      Recent review info
      Run configuration
      Commits

      Reviewing files that changed from the base of the PR and between 575579d68ac4bae09f8426a345d4a3eac1e90c67 and 4d75fb830717ef5d9b5671534a115141c56e9995.

      Files selected for processing: 6
      • apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts
      • apps/server/src/provider/ClaudeProvider.ts
      • apps/server/src/provider/Drivers/ClaudeDriver.ts
      • apps/server/src/provider/Drivers/ClaudeHome.test.ts
      • apps/server/src/provider/Drivers/ClaudeHome.ts
      • apps/server/src/provider/Drivers/ClaudeSkills.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

      Walkthrough

      Claude settings now provide both ANTHROPIC_BASE_URL and CLAUDE_CODE_ENTRYPOINT. Claude process-environment merging applies the entrypoint from settings when it is nonempty. The Claude driver and orchestration adapter use this merger.

      Changes: Claude environment resolution

      Layer / File(s)Summary
      Read and merge Claude settings environment
      apps/server/src/provider/Drivers/ClaudeSkills.ts, apps/server/src/provider/Drivers/ClaudeHome.ts, apps/server/src/provider/Drivers/ClaudeHome.test.ts
      The settings reader returns both environment values, with later settings files overriding earlier values for fields they specify. The merge function combines host and instance environments and applies a nonempty settings entrypoint. Tests cover entrypoint precedence and preservation of a host value.
      Use Claude environment resolution across provider paths
      apps/server/src/provider/Drivers/ClaudeDriver.ts, apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts, apps/server/src/provider/ClaudeProvider.ts
      The driver and orchestration adapter use the Claude-specific merger. The provider reads ANTHROPIC_BASE_URL through the expanded settings reader and retains its process-environment fallback.

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix

      Suggested reviewers: maria-rcks

      Merge Risk: Low · up to 4d75f

      Project-specific entrypoint overrides may be ignored, affecting attribution. This is a bounded merge risk.

      Pre-merge checks: Passed 3 · Failed 1
      Failed Failed checks: 1 warning
      Check nameStatusExplanationResolution
      Description checkWarningThe description explains the problem, implementation, behavior, and verification results. However, it omits the required "## Problem" and "## Scope and approval" sections, including an issue or mainta…Add the required "## Problem" and "## Scope and approval" sections. Include the triaged issue or explicit maintainer approval, or explain why this focused fix qualifies without prior approval. Keep the existing change and verification detai…
      Passed Passed checks: 3 passed
      Check nameStatusExplanation
      Title checkPassedThe title clearly identifies the main change: updating the Claude entrypoint identifier. It is concise and specific.
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Full details: Description check

      Explanation

      The description explains the problem, implementation, behavior, and verification results. However, it omits the required "## Problem" and "## Scope and approval" sections, including an issue or maintainer approval link or an explanation for why the focused fix qualifies without one.

      Resolution

      Add the required "## Problem" and "## Scope and approval" sections. Include the triaged issue or explicit maintainer approval, or explain why this focused fix qualifies without prior approval. Keep the existing change and verification details under their required headings.

      Finishing Touches
      Generate docstrings
      • Commit to this branch
      • Create a new PR
      Generate unit tests (beta)
      • Commit to this branch
      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
    4. Astra (AI assistant) writing on behalf of @RCXDd. Adding a measured CLIProxyAPI compatibility check for this entrypoint change.

      On November 2, I compared a genuine interactive Claude Code TUI (cli) with the same binary running headless through CLIProxyAPI with CLAUDE_CODE_ENTRYPOINT=t3-code. Both entrypoints were verified in the session transcripts.

      • Claude Code 2.1.316, CLIProxyAPI 8.0.50, Opus 5.5 at low effort.
      • Same account and organization, network egress, working directory, prompts, and generated 28 KB text fixture.
      • Three user turns per arm: read the fixture and return a marker, then return two further markers without tools. Four model requests per arm. Every expected response and the Read call succeeded.
      • One-hour caching; safe/restricted mode; Read was the only tool; no MCP servers.
      MeasurementNative TUIProxy with t3-code
      Total input tokens processed, including cache hits48,74648,184
      Output tokens110124
      Final-turn input served from cache99.713%99.710%

      Native usage was deduplicated by message/request identity from transcripts. Proxy totals came from the final cumulative modelUsage, avoiding partial streamed usage records. This small workload showed essentially equivalent input-token and warm-cache efficiency.

      Proxy-specific behavior: CLIProxyAPI 8.0.50's native entrypoint allowlist includes sdk-ts but not t3-code. With our default OAuth configuration, its source routes t3-code through the rewriting path, which emits cli upstream and adjusts system-prompt/cache handling. Thus the new label also changes the proxy's processing path; these tests exercised that path successfully.

      Scope: this reproduces the PR's environment-variable change, rather than testing an installed nightly or the full T3 instruction set. It is not proof of equal subscription quota accounting: the tested Ultra account reports five_hour: null, and the whole-percentage weekly meter cannot resolve this small workload. The proxy also began with 1,061 cached prefix tokens, so initial cache-write totals would not be a fair cost comparison. Longer sessions, compaction, and subagents were not tested.

      If further quota verification is needed, the missing evidence is a controlled run on an account that still has a five-hour cap. No credentials, account identifiers, private endpoints, or raw session logs are included here.

    5. He's the GOAT. Thank you!

    6. Confirming this resolved the issue on T3 Code v0.1.9 (Claude Opus 5.5, Claude Pro).

      Comparing local session logs on the same account between t3-code and cli entrypoints across 5-hour windows:

      • T3 Code (t3-code, v2.1.322): Window 1 hit 50% of the 5h meter at $20.98 list-cost equivalent ($42/100%); Window 2 went from 0% to 77% at $35.12 ($45.6/100%).
      • Claude Code CLI (cli, v2.1.325): Hit 100% of the 5h limit at $45.66 and $46.77 list-cost equivalent in two separate windows.

      Both drain the 5-hour window at the same ~$45–$47 equivalent rate now.

Sign in to join this conversation.