Skip to content

Native claudecode LLM Provider Support via Local OAuth Session Bridge #254

Description

@antonkulaga

Category

Feature Request

Title

Feat: Native claudecode LLM Provider Support via Local OAuth Session Bridge

Is your feature request related to a problem?

Yes. Running autonomous cognitive loops in this fork of mettaclaw (using MeTTa and OpenCog Hyperon) gets incredibly expensive on developer API keys. Because the logical reasoning steps (including NAL/PLN processing) require high-intelligence frontier models, token bills add up rapidly.

Many of us already pay for a flat-rate $20/month Claude Pro (or $200/month Claude Max) subscription. Since Anthropic officially supports drawing from these subscription credits via the Claude Code CLI terminal tool (running under an active OAuth session), we should be able to route OmegaClaw’s model evaluations through this local CLI session instead of paying per-token on paid API keys.

Describe the solution you'd like

We should introduce support for a claudecode provider type in the local configuration.

When LLM_PROVIDER="claudecode" is configured:

  1. OmegaClaw should look for a valid local Claude CLI OAuth session (typically in ~/.claude/ on the host machine).
  2. Instead of directly querying the Anthropic API via HTTP, OmegaClaw's Python-MeTTa integration layer should spin up a local wrapper (such as launching a background instance of the open-source claude-code-openai-wrapper or using direct subprocess calls to claude -p).
  3. This allows the core MeTTa execution loop to continue targeting standard OpenAI-compatible /v1/chat/completions structures locally, while silently leveraging the flat-rate CLI subscription session.

Proposed Architecture & Configuration

We can configure this by introducing the following keys in the setup environment or config.json5:

LLM_PROVIDER="claudecode"
CLAUDE_CLI_PATH="/usr/local/bin/claude"  # Path to the globally installed Claude CLI
CLAUDE_OAUTH_DIR="~/.claude/"             # Host path to local Claude credentials

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