DEV Community

brian austin
brian austin

Posted on

Claude Code rate limits: how ANTHROPIC_BASE_URL removes the ceiling

Claude Code rate limits: how ANTHROPIC_BASE_URL removes the ceiling

You're in the middle of a big refactor. Claude Code is tearing through your codebase, making changes across 12 files, when it stops.

Error: Rate limit exceeded. Please wait before making more requests.
Enter fullscreen mode Exit fullscreen mode

Your session is dead. Context is gone. You have to start over.

This is the Claude Code rate limit problem — and there's a clean fix.

Why rate limits happen

Claude Code's default setup routes every request through Anthropic's API with a shared rate limit pool. When you're doing heavy work — long sessions, parallel agents, rapid iteration — you hit the ceiling fast.

The rate limit resets, but by then:

  • Your session context is cleared
  • Your multi-step task is interrupted mid-flow
  • You lose the mental state of what you were doing

This isn't a bug. It's a feature of shared infrastructure. The solution is to route through a different endpoint.

The ANTHROPIC_BASE_URL environment variable

Claude Code has a built-in escape hatch that most developers don't know about:

export ANTHROPIC_BASE_URL=https://your-proxy-endpoint.com
Enter fullscreen mode Exit fullscreen mode

When this is set, Claude Code sends all requests to your specified URL instead of api.anthropic.com. The proxy handles authentication and forwards to Anthropic.

This means:

  • Your rate limits are separate from the shared pool
  • Long sessions don't hit ceilings mid-task
  • Parallel agents can run without competing for the same quota

Setting it up permanently

Add to your shell profile so it persists across sessions:

# ~/.bashrc or ~/.zshrc
export ANTHROPIC_BASE_URL=https://simplylouie.com/api/proxy
export ANTHROPIC_API_KEY=your-key-here
Enter fullscreen mode Exit fullscreen mode

Then reload:

source ~/.zshrc  # or ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

Verify it's working:

echo $ANTHROPIC_BASE_URL
# https://simplylouie.com/api/proxy
Enter fullscreen mode Exit fullscreen mode

Now start Claude Code normally. It automatically picks up the env var.

What changes

Before ANTHROPIC_BASE_URL:

Session start → 45 min of work → rate limit hit → restart → lose context → repeat
Enter fullscreen mode Exit fullscreen mode

After ANTHROPIC_BASE_URL:

Session start → work until done → no interruptions
Enter fullscreen mode Exit fullscreen mode

The difference is most visible in:

Long refactoring sessions

claude "refactor the entire auth module to use JWT, update all tests, update all routes that depend on it"
Enter fullscreen mode Exit fullscreen mode

This is a 30-40 minute task with dozens of API calls. Without a proxy, it hits limits partway through. With a proxy, it runs to completion.

Parallel agent workflows

# Terminal 1
claude "implement user dashboard" &

# Terminal 2  
claude "implement admin panel" &

# Terminal 3
claude "implement API endpoints" &

wait
Enter fullscreen mode Exit fullscreen mode

Three parallel Claude Code sessions all competing for the same rate limit = guaranteed hits. Through a proxy with separate quota, they run in parallel without interference.

CI/CD integration

# .github/workflows/claude-review.yml
- name: Claude Code review
  env:
    ANTHROPIC_BASE_URL: ${{ secrets.ANTHROPIC_BASE_URL }}
    ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
  run: claude "review this PR for security issues and suggest fixes"
Enter fullscreen mode Exit fullscreen mode

Running Claude Code in CI means predictable, uninterrupted execution. Rate limits in CI pipelines cause flaky workflows that are hard to debug.

The OpenClaw situation

A lot of developers were using OpenClaw as their proxy layer. Anthropic recently blocked Claude Code from using it (and OpenClaw has an active CVE — CVE-2026-33579, a privilege escalation vulnerability).

If you were relying on OpenClaw, you need a replacement. The ANTHROPIC_BASE_URL approach still works — you just need a different proxy endpoint.

SimplyLouie offers a compliant Claude proxy at $2/month. No CVE. No local server to maintain. Anthropic-approved approach.

Per-project configuration

If you want different proxy settings for different projects:

# project-a/.env
ANTHROPIC_BASE_URL=https://simplylouie.com/api/proxy

# project-b/.env  
ANTHROPIC_BASE_URL=https://simplylouie.com/api/proxy
Enter fullscreen mode Exit fullscreen mode

Or use direnv to auto-load env vars when you cd into a directory:

# Install direnv
brew install direnv
echo 'eval "$(direnv hook bash)"' >> ~/.bashrc

# Create .envrc in your project
echo 'export ANTHROPIC_BASE_URL=https://simplylouie.com/api/proxy' > .envrc
direnv allow
Enter fullscreen mode Exit fullscreen mode

Now the proxy is automatically used whenever you're in that directory.

Monitoring your usage

A good proxy gives you visibility into your usage:

# Check current usage via API
curl https://simplylouie.com/api/usage \
  -H "Authorization: Bearer your-key"
Enter fullscreen mode Exit fullscreen mode
{
  "requests_today": 247,
  "tokens_today": 1847293,
  "rate_limit_hits": 0
}
Enter fullscreen mode Exit fullscreen mode

Zero rate limit hits. That's the goal.

The bottom line

Claude Code rate limits are not a fundamental constraint — they're a routing constraint. ANTHROPIC_BASE_URL routes around them.

If you're doing serious work with Claude Code (long sessions, parallel agents, CI integration), you need a proxy. The default shared pool wasn't designed for heavy usage patterns.

Setup takes 2 minutes:

  1. export ANTHROPIC_BASE_URL=https://simplylouie.com/api/proxy
  2. Start Claude Code
  3. Work without interruptions

SimplyLouie — $2/month, 7-day free trial, no credit card tricks.


Questions about the setup? Drop them in the comments.

Top comments (0)