[FEATURE] Allow `skill-creator` `run_loop.py` to use other authentication methods besides API keys
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
The skill-creator plugin's description optimization process (run_loop.py / improve_description.py) calls anthropic.Anthropic() directly via the Python SDK, which requires an ANTHROPIC_API_KEY environment variable to be set. This creates a conflict for users authenticated via Claude Code's console subscription (OAuth): if they set ANTHROPIC_API_KEY in their shell environment, Claude Code itself detects it and switches from their console subscription to API key billing. There is no way to supply credentials to the script without risking this side effect. Also, not all Claude Code users in a team have access to API key creation.
Proposed Solution
The description improvement step (improve_description.py) should authenticate using the already-running Claude Code session rather than requiring a separate API key. The ideal approach would be to rewrite improve_description.py to invoke claude -p as a subprocess (as run_eval.py already does), eliminating the need for ANTHROPIC_API_KEY entirely. If extended thinking is required and can't be passed via claude -p flags, an alternative would be to accept an --api-key CLI argument and pass it directly to anthropic.Anthropic(api_key=...), so users can supply credentials without setting a global environment variable.
Alternative Solutions
- Setting
ANTHROPIC_API_KEYin~/.claude/settings.jsonunder theenvkey makes it available to Claude Code subprocesses without affecting Claude Code's own auth — but this is non-obvious, requires manual setup, and is easy to misconfigure. - Passing the key inline (
ANTHROPIC_API_KEY=... python -m scripts.run_loop ...) works but is awkward for users and doesn't scale to teams.
Priority
High - Significant impact on productivity
Feature Category
Developer tools/SDK
Use Case Example
- A team at an organization uses Claude Code with console subscriptions (OAuth login via
claude login). - They install the
skill-creatorplugin to build and optimize custom skills. - When they reach the description optimization step, the skill-creator instructs them to run
python -m scripts.run_loop, which fails becauseANTHROPIC_API_KEYis not set. - If they set
ANTHROPIC_API_KEYin their shell profile to fix this, Claude Code starts billing against their API key instead of their subscription. - The workaround (adding the key to
~/.claude/settings.jsonunderenv) is non-obvious and requires explanation outside the plugin itself. - If the optimization step used
claude -pinstead of the SDK directly, it would just work with zero additional setup.
Additional Context
run_eval.py (also in this plugin) already uses claude -p as a subprocess and works seamlessly without any API key. The inconsistency is only in improve_description.py, which uses the Anthropic Python SDK with extended thinking. It would be worth checking whether claude -p now supports extended thinking via flags, which would allow both scripts to use the same credential-free approach.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗