Skip to content

Document how to enable per-user Claude Code Connect (Features__Ai__Clis__ClaudeCode) and its prerequisites #324

Closed

Description

@sierragolflima

Summary

Per-user Claude Code Connect (each user connects their own Claude subscription via Settings → Models → Connect, billed to their personal account) is gated behind the Features__Ai__Clis__ClaudeCode flag, which is off by default. The backend is already present, but the enablement path and its prerequisites are not documented in one place. Document how to turn it on and what it requires, so a deployment can enable it without reverse-engineering the code.

Background

  • The documented per-user "own account" path for Claude is the Claude Code Connect flow (a CLI/subscription provider), not a personal API key — see src/MeshWeaver.Documentation/Data/AI/ModelProviderSetup.md: "Claude … is intentionally not wired as a shared org key. Each user connects Claude Code … in Settings → Models → Connect … on their own subscription."
  • This is independent of the shared org Anthropic key (Features__Ai__Providers__Anthropic) and coexists with it — enabling Connect ADDS the per-user card; it does not remove or change the shared key.
  • The Connect backend is already registered: ConnectSessionManager, ClaudeConnectStrategy, CopilotConnectStrategy (src/MeshWeaver.AI/Connect/).

What to document (enablement path)

The flag is gated in memex/Memex.Portal.Shared/MemexConfiguration.cs (~lines 206, 270). A portal that wants per-user Connect must:

  1. Run the CLI-enabled portal image (one that includes the claude CLI binary).
  2. Set Features__Ai__Clis__ClaudeCode=true in the portal config/env (independent of Features__Ai__Providers__Anthropic).
  3. Set a per-user config-dir root (ClaudeCode:ConfigDirRoot, e.g. a writable per-user mount) so each user logs in under their own .claude directory.
  4. Redeploy / roll out.

Steps to verify

  1. On a portal with the flag set, open Settings → Models → observe a "Claude Code" card with a Connect / Log in button (absent when the flag is unset).
  2. Complete Connect as a user and run a Claude model → the run uses that user's own subscription; a per-user encrypted-token node is created.
  3. Confirm the shared org Anthropic key path is unchanged and still serves users who have not connected.

Notes

  • The flag enables the feature portal-wide; each user self-connects (needs their own Claude subscription). No per-person admin activation.
  • The CLI provider is resolved by a per-user token (ResolveConnectToken), not by model id, so it does not collide with the shared catalog.

References

  • Docs: src/MeshWeaver.Documentation/Data/AI/ModelProviderSetup.md, .../AI/ModelProviderSettings.md
  • Skill: src/MeshWeaver.AI/Data/Skill/provider-keys.md
  • Code: memex/Memex.Portal.Shared/MemexConfiguration.cs (flag gating), src/MeshWeaver.AI/Connect/

Activity

  1. rbuergi commented on Jul 6, 2026

    @rbuergi
    Contributor

    Addressed by #335 (open, pending review — will auto-close on merge).

    New "Enabling per-user Claude Code Connect" section in ModelProviderSetup.md (what Connect is/is not, prerequisites, enablement steps, verification), grounded in code (ClaudeConnectStrategy, ChatClientCredentialResolver.ResolveConnectToken, ClaudeCodeConfiguration.ConfigDirRoot, deploy/base-images/portal-ai/Dockerfile). Precise nuance documented: the flag defaults true in code, but ships off via deploy configs (deploy/.env.example, Marketplace checkbox) and is **inert without the CLI-bundled portal-ai image. DocumentationLinkIntegrityTest` passes.

  2. added a commit that references this issue on Jul 6, 2026
  3. sierragolflima commented on Jul 7, 2026

    @sierragolflima
    CollaboratorAuthor

    Test result (to be tested): flags + mechanism verify; the documented Connect entry point is stale

    On a CLI-enabled portal the enablement checks out — flag (code default true), the portal-ai image with the claude binary, and the subscription-token mechanism ({user}/_Memex/ClaudeCode via ClaudeConnectStrategy).

    One doc correction in ModelProviderSetup.md: the UI entry point for Connect is out of date. The doc points to Settings → Models → Connect (lines ~192/200 and "Verifying it" step 1: "open Settings → Models: a 'Claude Code' card"), but that tab was retired in 68946fbf4 — AddModelsSettingsTab is no longer registered and the CLI card (ModelsSettingsTab.RenderCliBody) no longer renders.

    The current flow is a chat command: switch the active harness to Claude Code with /harness, then run /login (opens the login-method chooser). Suggested edits:

    • Replace "Settings → Models → Connect" → "switch to the Claude Code harness (/harness), then /login" throughout the section.
    • Rewrite "Verifying it" step 1: with the flag set, select the Claude Code harness and run /login; complete the dialog; confirm a per-user encrypted-token node at {user}/_Memex/ClaudeCode.

    The rest of the section (flag opt-in behaviour, CLI-image requirement, ConfigDirRoot, per-user token resolution, coexistence with the shared org key) is accurate.

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

    documentationImprovements or additions to documentationenhancementNew feature or requestto be testedFix landed; needs verification

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions