Files
mystuff/devel/crush/patches/patch-internal_config_config_go
2026-07-08 11:07:34 +02:00

24 lines
679 B
Plaintext

--- internal/config/config.go
+++ internal/config/config.go
@@ -177,6 +177,22 @@ func (c *ProviderConfig) SetupGitHubCopilot() {
maps.Copy(c.ExtraHeaders, copilot.Headers())
}
+func (c *ProviderConfig) SetupClaudeCode() {
+ c.FlatRate = true
+ c.SystemPromptPrefix = "You are Claude Code, Anthropic's official CLI for Claude."
+ if c.ExtraHeaders == nil {
+ c.ExtraHeaders = make(map[string]string)
+ }
+ c.ExtraHeaders["anthropic-version"] = "2023-06-01"
+ const want = "oauth-2025-04-20"
+ if v := c.ExtraHeaders["anthropic-beta"]; !strings.Contains(v, want) {
+ if v != "" {
+ v += ","
+ }
+ c.ExtraHeaders["anthropic-beta"] = v + want
+ }
+}
+
type MCPType string