Skip to content

[TASK] Remove Claude Code subscription mode (claude_code config, CLI command, adapter, model service) #812

Closed

Description

@inference-gateway-maintainer

Summary

Remove all Claude Code subscription-based mode code from the CLI. This is a pure cleanup/refactoring task - no backward compatibility needed, no deprecation comments, just delete everything related to the claude_code config, the infer claude-code command, the Claude Code CLI client adapter, the static model service, and all the branching logic that checks IsClaudeCodeMode() throughout the codebase.

The Claude Code subscription mode (Claude Max/Pro) was an alternative to the gateway-based API mode. It shelled out to the claude CLI, parsed its JSONL stream output, and mapped it onto the SDK's SSE event model. It was complex, fragile, and poorly maintained. The gateway mode is the only supported path going forward.

Changes

Files to delete (5 files, ~1400 lines)

  • cmd/claude_code.go - The infer claude-code command with setup and test subcommands
  • internal/infra/adapters/claude_code_client.go - The 896-line ClaudeCodeClient adapter (spawns claude CLI, parses JSONL stream, transforms events)
  • internal/infra/adapters/claude_code_client_test.go - Tests for the above
  • internal/services/model_claude_code.go - The ClaudeCodeModelService with a static model list
  • internal/services/model_claude_code_test.go - Tests for the above

Test data to delete (2 files)

  • internal/infra/adapters/testdata/stream_events.jsonl - Claude Code stream event fixtures
  • internal/infra/adapters/testdata/todos_write.jsonl - Claude Code TodoWrite fixtures

Config to remove

  • config/config.go - Remove ClaudeCodeConfig struct, ClaudeCode field from Config, IsClaudeCodeMode() method, and the ~/.claude sandbox carve-out in isPathRestricted()
  • config/prompts.go - Remove SystemPromptClaudeCode field from PromptsAgentConfig

Command wiring to remove

  • cmd/root.go - Remove --claude-code-extra-args persistent flag and the claude_code.extra_args env var handling in initConfig()
  • cmd/config.go - Remove INFER_PROMPTS_AGENT_SYSTEM_PROMPT_CLAUDE_CODE env var binding

Container wiring to simplify

  • internal/container/container.go - Remove the IsClaudeCodeMode() branch in initializeDomainServices() (always use HTTPModelService), and remove the IsClaudeCodeMode() branch in createAgentSDKClient() (always use SDKClientAdapter)

Agent service to simplify

  • internal/agent/agent_utils.go - Remove IsClaudeCodeMode() branches in BuildSystemPrompt(), addSystemPrompt(), and injectDueReminders()
  • internal/agent/agent.go - Remove the ToolCallResultProvider type assertion in Run() (lines 460-462)

Headless agent session to simplify

  • cmd/agent.go - Remove:
    • claudeTask struct and all related fields/methods (feedTaskAccumulator, applyTaskUpdate, isClaudeTaskTool, renderTodoWriteView, claudeToolResultMessages)
    • IsClaudeCodeMode() checks in processSyncResponse() and outputMessage()
    • CanonicalClaudeModelID() calls in RunAgentCommand()
    • injectDueReminders() skip for Claude Code mode

UI to simplify

  • internal/ui/components/model_selection_view.go - Remove the "Claude Subscription" badge in viewContent() and the isModelSubscription() override for Claude Code mode
  • internal/ui/components/model_selection_view_test.go - Remove TestModelSelector_ClaudeCodeModeCategorizesAsSubscription

Plugin instructions to simplify

  • internal/services/plugins/instructions.go - Remove ClaudeCodeAppend() function
  • internal/services/plugins/instructions_test.go - Remove TestClaudeCodeAppend

Domain interfaces to simplify

  • internal/domain/interfaces.go - Remove ToolCallResult type, ToolCallResultProvider interface, and ToolResults field from ChatSyncResponse (only used by Claude Code)

Tests to remove/update

  • internal/agent/agent_test.go - Remove TestAgentServiceImpl_AddSystemPrompt_ClaudeCodeModePassthrough
  • cmd/agent_test.go - Remove TestInjectDueReminders_SkippedInClaudeCodeMode and the Claude Code mode test cases
  • internal/services/pricing_service_test.go - Remove TestPricingService_ClaudeCodeModelDefaults

Downstream impact

  • inference-gateway/docs - The configuration reference page documents claude_code.* settings and the infer claude-code command. These should be removed from the docs.
  • inference-gateway/schemas - No impact (the SDK client adapter remains, only the Claude Code-specific adapter is removed).

Activity

  1. added theissue type on Jul 9, 2026
  2. added
    refactor
    on Jul 9, 2026
  3. moved this to Todo in 2026on Jul 9, 2026
  4. changed the title [-]refactor: remove Claude Code subscription mode (claude_code config, CLI command, adapter, model service)[/-] [+][TASK] remove Claude Code subscription mode (claude_code config, CLI command, adapter, model service)[/+] on Jul 9, 2026
  5. changed the title [-][TASK] remove Claude Code subscription mode (claude_code config, CLI command, adapter, model service)[/-] [+][TASK] Remove Claude Code subscription mode (claude_code config, CLI command, adapter, model service)[/+] on Jul 9, 2026
  6. inference-gateway-maintainer commented on Jul 9, 2026

    @inference-gateway-maintainer
    ContributorAuthor

    Downstream impact: infer-action

    This change also has a downstream impact on inference-gateway/infer-action - the features being removed here (Claude Code subscription mode: claude_code config, infer claude-code command, the Claude Code CLI client adapter, and the static model service) should also be removed from infer-action if they are referenced or wired there.

    Please open a tracking issue on inference-gateway/infer-action to remove any Claude Code subscription mode references from that repo as well.

  7. edenreich commented on Jul 9, 2026

    @edenreich
    Contributor

    @infer Can you work on this? use /ponytail

  8. inference-gateway-maintainer commented on Jul 9, 2026

    @inference-gateway-maintainer
    ContributorAuthor

    Model: ollama_cloud/deepseek-v4-flash · View Job

    Todos

    • Get on working branch and add issue to project board
    • Delete 5 source files and 2 test data files
    • Remove config references (config.go, prompts.go)
    • Remove command wiring (root.go, config.go)
    • Simplify container wiring (container.go)
    • Simplify agent service (agent_utils.go, agent.go)
    • Simplify headless agent session (cmd/agent.go)
    • [~] Simplify UI (model_selection_view.go and test)
    • Simplify plugin instructions (instructions.go and test)
    • Simplify domain interfaces (interfaces.go)
    • Remove/update tests (agent_test.go, cmd/agent_test.go, pricing_service_test.go)
    • Commit, push, create PR, set status to QA
  9. moved this from Todo to In progress in 2026on Jul 9, 2026
  10. moved this from In progress to QA in 2026on Jul 9, 2026
  11. added a commit that references this issue on Jul 9, 2026
    ff71a40
  12. added a commit that references this issue on Jul 9, 2026
    47a0054
  13. moved this from QA to Done in 2026on Jul 9, 2026
  14. inference-gateway-releaser commented on Jul 10, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.141.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

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

    refactorreleased

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions