Skip to content

[codex] Handle Claude plugin config token env names#13

Merged
hammadtq merged 1 commit intomainfrom
fix/plugin-token-config-env
Apr 2, 2026
Merged

[codex] Handle Claude plugin config token env names#13
hammadtq merged 1 commit intomainfrom
fix/plugin-token-config-env

Conversation

@hammadtq
Copy link
Copy Markdown
Collaborator

@hammadtq hammadtq commented Apr 2, 2026

Summary

This fixes the plugin token handoff for Claude Code plugin installs by accepting the manifest key form that Claude documents for userConfig environment variables.

What Changed

  • accept CLAUDE_PLUGIN_OPTION_socket_api_token in plugin/hooks/bootstrap.sh
  • keep the existing uppercase CLAUDE_PLUGIN_OPTION_SOCKET_API_TOKEN path as a compatibility fallback
  • add plugin tests that execute the bootstrap wrapper and verify both env var names map into SOCKET_API_TOKEN
  • clarify the README so the token prompt is described as an install/enable flow, and note that local claude --plugin-dir ./plugin development may require manually exporting SOCKET_API_TOKEN

Root Cause

The plugin manifest key is socket_api_token, but the bootstrap wrapper only checked the fully uppercased env var name. If Claude exposes the config using the documented <KEY> form without uppercasing, the wrapper misses the token and hard-fails even though the user supplied it.

Validation

  • go test ./plugin
  • go test ./...
  • go vet ./...
  • go build ./...
  • env -u SOCKET_API_TOKEN CLAUDE_PLUGIN_OPTION_socket_api_token=test-token plugin/hooks/bootstrap.sh version

@hammadtq
Copy link
Copy Markdown
Collaborator Author

hammadtq commented Apr 2, 2026

LGTM

@hammadtq hammadtq merged commit d24b2c4 into main Apr 2, 2026
2 checks passed
@hammadtq hammadtq deleted the fix/plugin-token-config-env branch April 2, 2026 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant