Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/subprocess/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,17 @@ export class ClaudeSubprocess extends EventEmitter {
return new Promise((resolve, reject) => {
try {
// Use spawn() for security - no shell interpretation
// Remove CLAUDE_CODE_OAUTH_TOKEN from the subprocess environment so the CLI
// reads fresh credentials from the OS keychain instead of using a potentially
// stale token snapshot inherited when this proxy process was started.
// Without this fix, the proxy silently fails with "out of extra usage" errors
// when the original token's usage window expires, even though the keychain
// token (auto-refreshed by Claude Desktop) remains valid.
const subprocessEnv = { ...process.env };
delete subprocessEnv.CLAUDE_CODE_OAUTH_TOKEN;
this.process = spawn("claude", args, {
cwd: options.cwd || process.cwd(),
env: { ...process.env },
env: subprocessEnv,
stdio: ["pipe", "pipe", "pipe"],
});

Expand Down