# OAuth2 Automatic Token Refresh Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Implement automatic OAuth2 token refresh across all providers so expired access tokens are transparently refreshed using refresh tokens without user interaction.
**Architecture:** Add `get_valid_token_with_refresh()` method to all OAuth2 auth classes (KiloOAuth2, ClaudeAuth, CodexOAuth2, QwenOAuth2). Update provider handlers to call refresh-aware methods. Auth classes handle refresh internally with proper error messages when refresh fails.
Expected: FAIL - handler currently calls `get_valid_token()` not `get_valid_token_with_refresh()`
-[]**Step 3: Update ClaudeProviderHandler to use get_valid_token_with_refresh**
In `aisbf/providers/claude.py`, find the two locations where `get_valid_token()` is called (around lines 954 and 976) and replace with `get_valid_token_with_refresh()`: