Skip to content

Pull in upstream CLAUDE_CODE_ENTRYPOINT fix for Claude 5-hour usage drain (pingdotgg#28410, #29169) #276

Closed

Description

@tannerpolley

Problem

Claude threads in T3 Code drain the Anthropic 5-hour usage meter faster than interactive Claude Code. Anthropic's 5-hour meter charges Claude Agent SDK and claude -p traffic about 1.6 to 1.7x more than the interactive app for the same tokens. T3 Code does not send extra tokens or break the prompt cache, and weekly limits are not affected.

Background: upstream pingdotgg/t3code#24649 (closed Nov 2), reported to Anthropic as anthropics/claude-code#97074. Source post that raised it: https://x.com/Screeendev/status/2116529668325351738.

Upstream fix

  • pingdotgg/t3code#28410 (merged Nov 1, upstream commit ddfc4a92ed): sets CLAUDE_CODE_ENTRYPOINT=t3-code in mergeClaudeProcessEnvironment (apps/server/src/provider/Drivers/ClaudeHome.ts) for every Claude process T3 Code starts. It also touches ClaudeAdapterV2.ts, ClaudeProvider.ts, ClaudeDriver.ts and ClaudeSkills.ts (readClaudeSettingsBaseUrl becomes readClaudeSettingsEnv). A commenter on Claude 5h limit drains about 1.7x faster in T3 Code than in the Claude Code CLI (Anthropic Agent SDK metering) pingdotgg/t3code#24649 tested it on a Pro plan: the 5-hour meter now drains at the same rate as the interactive app.
  • pingdotgg/t3code#29169 (merged Nov 2, upstream commit 47f2c8d29e): stops Claude threads from joining the session that launched T3 Code.
  • Not taken: PR #29408 (still open upstream) fixes "credit balance too low" for API-key Claude instances (issue #29393). This fork's owner uses subscription login only, so it does not apply; the daily upstream sync brings it in if it merges.

State of this fork

Neither commit is on main (checked 2026-11-02 against upstream/main at 0847a448fd). mergeClaudeProcessEnvironment does not exist in the fork, so Claude processes still send the SDK default entrypoint. The fork's ClaudeSkills.ts differs from upstream, so expect conflicts there.

Tasks

  1. Cherry-pick ddfc4a92ed and 47f2c8d29e onto a branch from main (with -x), resolving conflicts in favor of upstream behavior while keeping fork features.
  2. Run ClaudeHome.test.ts, ClaudeSkills tests and the Claude provider/adapter tests the commits touch, through agent-heavy.

After install (orchestrator and owner, not the worker)

  • Orchestrator: confirm a running T3 Code Claude process has CLAUDE_CODE_ENTRYPOINT=t3-code (/proc/<pid>/environ).
  • Owner, optional: from a fresh 5-hour window, run the same 5 to 8 turn prompt in T3 Code and in interactive claude, and compare the share of the 5-hour limit each uses.

Acceptance criteria

  • main contains both upstream commits, with their tests passing.
  • Claude processes started by the installed build show CLAUDE_CODE_ENTRYPOINT=t3-code.

Activity

  1. tannerpolley commented on Nov 2, 2026

    @tannerpolley
    OwnerAuthor

    T3 Code status: Done

    Issue: #276 Pull in upstream CLAUDE_CODE_ENTRYPOINT fix for Claude 5-hour usage drain (pingdotgg#28410, #29169)

    Thread: thread:delegated-task:command%3Amcp%3A15854dd9-6df9-47d6-884e-32e17422f0a9%3Adelegate-task%3Aissue-276-worker-20261102

    Model: claude-opus-5-5

    Branch: issue-276-pull-in-upstream-claude_code_entrypoint

    Updated: 2026-11-02T18:00:52.321Z

  2. tannerpolley commented on Nov 2, 2026

    @tannerpolley
    OwnerAuthor

    T3 Code closeout: done

    Issue: #276 Pull in upstream CLAUDE_CODE_ENTRYPOINT fix for Claude 5-hour usage drain (pingdotgg#28410, #29169)
    Thread: thread:delegated-task:command%3Amcp%3A15854dd9-6df9-47d6-884e-32e17422f0a9%3Adelegate-task%3Aissue-276-worker-20261102
    Model: claude-opus-5-5
    Branch: issue-276-pull-in-upstream-claude_code_entrypoint
    Completed: 2026-11-02T17:58:38.139Z

    Waiting on the Claude provider, driver, skills and adapter tests running in the background (task bba4u4u8p). Their results come back to me automatically.

  3. tannerpolley commented on Nov 2, 2026

    @tannerpolley
    OwnerAuthor

    T3 Code closeout: waiting_on_sub_issues

    Issue: #276 Pull in upstream CLAUDE_CODE_ENTRYPOINT fix for Claude 5-hour usage drain (pingdotgg#28410, #29169)
    Thread: thread:delegated-task:command%3Amcp%3A15854dd9-6df9-47d6-884e-32e17422f0a9%3Adelegate-task%3Aissue-276-worker-20261102
    Model: claude-opus-5-5
    Branch: issue-276-pull-in-upstream-claude_code_entrypoint
    Completed: 2026-11-02T17:58:45.545Z

    Waiting on check:changed (background task bd3plowk4). It reports back automatically when it finishes.

  4. tannerpolley commented on Nov 2, 2026

    @tannerpolley
    OwnerAuthor

    T3 Code closeout: done

    Issue: #276 Pull in upstream CLAUDE_CODE_ENTRYPOINT fix for Claude 5-hour usage drain (pingdotgg#28410, #29169)
    Thread: thread:delegated-task:command%3Amcp%3A15854dd9-6df9-47d6-884e-32e17422f0a9%3Adelegate-task%3Aissue-276-worker-20261102
    Model: claude-opus-5-5
    Branch: issue-276-pull-in-upstream-claude_code_entrypoint
    Completed: 2026-11-02T18:00:52.959Z

    I opened PR #279 with both upstream fixes; I did not merge it. Every Claude process T3 Code starts now gets CLAUDE_CODE_ENTRYPOINT=t3-code, and Claude threads no longer join the Claude session that launched T3 Code. All 319 targeted tests pass.

    What conflicted and how I resolved it

    Only ddfc4a92ed (upstream pingdotgg#28410) conflicted, and only in import lines:

    • ClaudeAdapterV2.ts: I kept the fork's t3OrchestrationInstructions import instead of upstream's T3_CODE_ORCHESTRATION_INSTRUCTIONS. I dropped the mergeProviderInstanceEnvironment import because nothing in the file uses it any more. Upstream's switch to mergeClaudeProcessEnvironment in the adapter applied without conflict.
    • ClaudeProvider.ts: I kept the fork's discoverClaudeSkillsAndPlugins import and replaced readClaudeSettingsBaseUrl with readClaudeSettingsEnv.
    • ClaudeSkills.ts, ClaudeHome.ts and ClaudeDriver.ts merged cleanly.

    47f2c8d29e (upstream pingdotgg#29169) applied with no conflicts.

    I checked for fork-only code that starts Claude without the new environment helper and found none:

    • The provider status check and Claude text generation get their environment from the driver, which now uses the helper.
    • The remaining callers of the old helper either match upstream or don't start Claude.

    I did not take PR pingdotgg#29408.

    Commit message flaw: git cherry-pick --continue rejected --no-verify, so I committed the first pick by hand, keeping the original author and date. I left out the blank line before the (cherry picked from commit ddfc4a92ed…) line, so it became part of commit c4e09ea641's subject. The traceability line is still there. Fixing it would need a force-push, which needs your approval; a squash merge would also cover it.

    Test results (each run through agent-heavy, with the newer Node first on PATH):

    • vp test run: 8 files, 319 tests passed. The files were ClaudeHome, ClaudeSkills (plus its fork tests), ClaudeDriver, ClaudeAdapterV2 (plus its fork tests) and ClaudeCapabilitiesProbe (plus its fork tests).
    • vp run check:changed: format, lint, knip 1/2, graphql, typecheck (3 packages) and tests (7 files, 317 passed) all pass.
    • Before testing I ran vp i, because the worktree setup had never run.

    PR #279, head 2534df8, checks and reviews: no checks reported yet, no reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions