AI Backend Issues

Troubleshoot issues specific to the Claude Code and Pi backends.

Claude Code Issues

"Claude Code auth not configured" / "cc_auth_missing"

No valid Anthropic authentication found.

bash
# Option 1: Set API Key
export ANTHROPIC_API_KEY=sk-ant-...
broski

# Option 2: Login via Claude CLI
claude login
# Follow the prompts

# Check existing auth
cat ~/.claude/settings.json
Rate Limiting / "Rate limit exceeded"

Too many requests to the Anthropic API.

  • Wait for rate limit to reset (usually 1 minute)
  • Check your plan limits on the Anthropic dashboard
  • Session shows "retry" status and auto-retries
  • Reduce request frequency if persistent
Context Length Exceeded

Session refuses new messages, "Context too long" error.

  • Use /compact command to summarize and reduce context
  • Start a new session (context is preserved in history)
  • Fork the session to create a branch with less history
Permission Issues / "User denied permission"

Tools won't execute, permission prompts timing out.

  • Check for pending permission prompts in the app
  • Permission prompt may be waiting on desktop - check there too
  • Configure permission mode in settings (default, plan, auto-edit)
  • Use "Allow Always" for trusted tools
"Claude OAuth token expired"

Your Claude login session has expired.

bash
# Re-authenticate
claude login

Common Mistakes - Claude Code

MistakeFix
Using wrong API key formatMust start with sk-ant-
API key not exportedAdd to shell config or pass via env
Claude CLI not installedcurl -fsSL https://claude.ai/install.sh | bash
Expired OAuth tokenRun claude login again
Denying all permissionsAllow some tools or use auto-edit mode

Pi Issues

Pi is an open-source multi-provider agent
Pi connects to any AI provider. Most issues relate to provider API key configuration.
"Pi not found"

Bridge can't find the Pi binary.

bash
# Check if Pi is installed
which pi

# If not found, install it
npm i -g @earendil-works/pi-coding-agent

# Then reload your shell
source ~/.bashrc  # or ~/.zshrc
No Models Available

Pi needs at least one AI provider API key to discover models.

bash
# Check your API keys
echo $ANTHROPIC_API_KEY
echo $OPENAI_API_KEY
echo $GEMINI_API_KEY

# Set an API key (add to ~/.bashrc or ~/.zshrc)
export ANTHROPIC_API_KEY=sk-ant-...
Context Limit / Auto-Compaction Issues

Session context exceeds model limit.

  • Use the compact command from the chat overflow menu
  • Enable auto-compaction in Pi settings
  • Fork the session to start fresh with a summary
  • Switch to a model with a larger context window
Extension Errors

A Pi extension is failing or not loading.

  • Check extension paths in Pi settings
  • Verify the extension package is installed
  • Check bridge logs for extension error messages

Common Mistakes - Pi

MistakeFix
No API key setSet ANTHROPIC_API_KEY, OPENAI_API_KEY, or another provider key
Pi not found on PATHRun npm i -g @earendil-works/pi-coding-agent
Wrong model nameUse the model picker in Broski — Pi auto-discovers available models
Context too longUse compact command or enable auto-compaction
Extension not loadingCheck extension paths and npm package installation

Environment Variables Reference

VariableBackendPurpose
ANTHROPIC_API_KEYClaude Code, PiAnthropic API key
OPENAI_API_KEYPiOpenAI API key
GROQ_API_KEYPiGroq API key

Setting Environment Variables Permanently

bash
# Add to ~/.bashrc or ~/.zshrc
echo 'export ANTHROPIC_API_KEY=sk-ant-...' >> ~/.zshrc
echo 'export OPENAI_API_KEY=sk-...' >> ~/.zshrc

# Reload shell config
source ~/.zshrc

Switching Between Backends

You can switch backends in the Broski app:

  1. Go to Settings → AI Backend
  2. Select Claude Code or Pi
  3. The bridge will reconnect with the selected backend
Sessions are backend-specific
Sessions created with one backend cannot be opened with another. Each backend maintains its own session history.

General Debugging

bash
# Backend-focused diagnostics
broski doctor --profile agents

# Follow bridge logs
broski logs --follow

# Export diagnostics bundle for support/AI
broski logs --export

# Check backend directly
# For Claude Code (check if authenticated):
claude --version
cat ~/.claude/settings.json | head -5

# For Pi:
which pi
pi --version

# Check what processes are running
ps aux | grep -E "(claude|pi|broski)"

Related