opencode-anthropic-fix 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -3
- package/cli.test.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Use your Claude Pro or Max subscription with [OpenCode](https://github.com/anomalyco/opencode). Supports multiple accounts with automatic rotation when you hit rate limits.
|
|
4
4
|
|
|
5
|
+
## Background
|
|
6
|
+
|
|
7
|
+
[AnomalyCo](https://github.com/anomalyco/opencode-anthropic-auth) originally published this as a built-in plugin shipped with OpenCode itself. The repo was archived following a legal request from Anthropic. Before it was archived, [rmk40](https://github.com/rmk40/opencode-anthropic-auth) — a frequent contributor unrelated to AnomalyCo — had developed multi-account support that never made it upstream.
|
|
8
|
+
|
|
9
|
+
This fork continues that work and extends it with deeper research into how the official Claude Code CLI identifies itself to the API. The mimicry was derived by analyzing [Claude Code's open source code on GitHub](https://github.com/anthropics/claude-code). This isn't just a system prompt injection — see the [full mimicry analysis](https://github.com/marco-jardim/opencode-anthropic-fix/blob/master/docs/mimese-http-header-system-prompt.md) for details.
|
|
10
|
+
|
|
11
|
+
> **Educational purpose.** This code exists to study how Anthropic's OAuth protocol and Claude Code's HTTP communication pattern work. It is not intended to be used in violation of Anthropic's Terms of Service.
|
|
12
|
+
|
|
13
|
+
> **Account risk.** There is a real risk of account suspension if Anthropic detects requests are not coming from Claude Code. The mimicry tries hard to make every request look as close as possible to a genuine Claude Code request, but that reduces rather than eliminates the risk. Use at your own risk.
|
|
14
|
+
|
|
5
15
|
## Quick Start
|
|
6
16
|
|
|
7
17
|
**Prerequisites:** [OpenCode](https://github.com/anomalyco/opencode) installed, a Claude Pro or Max subscription, Node.js 18+.
|
|
@@ -23,21 +33,33 @@ opencode
|
|
|
23
33
|
|
|
24
34
|
That's it. OpenCode will now use your Claude subscription directly. All model costs show as $0.00.
|
|
25
35
|
|
|
26
|
-
##
|
|
36
|
+
## What This Fork Adds
|
|
27
37
|
|
|
28
|
-
The [
|
|
38
|
+
The [original plugin](https://github.com/anomalyco/opencode-anthropic-auth) provided basic OAuth support. This fork adds:
|
|
29
39
|
|
|
30
40
|
- **Multi-account support** — add up to 10 Claude accounts and rotate between them
|
|
31
41
|
- **Automatic rate limit handling** — when one account hits a limit, the plugin switches to another
|
|
32
42
|
- **Health scoring** — tracks account reliability and prefers healthy accounts
|
|
33
43
|
- **Standalone CLI** — manage accounts without opening OpenCode
|
|
34
44
|
- **Configurable strategies** — sticky, round-robin, or hybrid account selection
|
|
35
|
-
- **Claude Code signature emulation** —
|
|
45
|
+
- **Claude Code signature emulation** — full HTTP header, system prompt, beta flag, and metadata mimicry derived from Claude Code's open source code
|
|
36
46
|
- **Adaptive thinking for Opus 4.6** — automatically uses `adaptive-thinking-2026-01-28` and maps `budgetTokens` to effort levels (`low`/`medium`/`high`/`max`)
|
|
37
47
|
- **1M context limit override** — patches `model.limit.context` so OpenCode compacts at the right threshold while `models.dev` catches up
|
|
38
48
|
|
|
39
49
|
## Installation
|
|
40
50
|
|
|
51
|
+
### From npm (recommended)
|
|
52
|
+
|
|
53
|
+
Add to your `opencode.json`:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"plugins": ["opencode-anthropic-fix@latest"]
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
OpenCode will install and load the plugin automatically on next start.
|
|
62
|
+
|
|
41
63
|
### Development (symlink)
|
|
42
64
|
|
|
43
65
|
Best for active development. Edits to source files take effect immediately.
|
package/cli.test.mjs
CHANGED