Skip to content

[FEATURE] --bare mode: option to preserve OAuth/keychain auth while skipping context #38022

Description

@dacharyc

Problem

--bare mode strips all auto-discovery, including OAuth and keychain authentication. This makes it unusable for tools that need clean, context-free API calls but rely on the CLI's built-in auth (e.g. team/company subscriptions where there is no explicit API key).

Use case

We maintain skill-validator, a CLI tool that scores Agent Skill files using an LLM-as-judge pattern. Each file is scored in isolation through a single prompt+response pair. We added a claude-cli provider that shells out to claude -p so users can score skills without managing API keys.

The scoring system is designed so that each call contains only a system prompt (the scoring rubric) and the file content. Local context like CLAUDE.md files, project memory, and rules act as hidden confounders that can bias scores and make them non-reproducible across environments.

--bare would solve this perfectly, except it also disables OAuth/keychain auth, which is the primary auth mechanism for users who don't have an explicit ANTHROPIC_API_KEY. This forces a choice between clean context isolation and working authentication.

Proposal

One of:

  1. A flag like --no-context that skips CLAUDE.md, memory, rules, hooks, and plugins but preserves the full auth chain (OAuth, keychain, API key).
  2. A --bare sub-option (e.g. --bare --auth) that re-enables auth discovery while keeping everything else stripped.
  3. Allow --bare to read OAuth/keychain credentials while still skipping all other auto-discovery.

Current workaround

We use claude -p without --bare and document that scores from the claude-cli provider may be less consistent than API-based providers due to injected local context.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions