The task is smaller than the repository.
You’re working on authentication. The repository also contains HTTP routes, application settings, reports, and export tools. Pasting it all spends tokens on code the task doesn’t need.
Example repository
Focus authenticationBudget 560 tokens
app/auth.pyapp/routes.pyapp/session.pyapp/config.pytools/report.pytools/export.py
"""Authenticate API requests and refresh sessions."""
from app.session import Session
class Authenticator:
"""Validate tokens and manage authentication sessions."""
def authenticate(self, token: str) -> Session:
"""Verify a token before creating an authenticated session."""
if not token or token.startswith("expired:"):
raise ValueError("invalid token")
return Session(user_id=token, authenticated=True)
def refresh(self, session: Session) -> Session:
"""Keep an authenticated session active."""
if not session.authenticated:
raise ValueError("authentication required")
return Session(user_id=session.user_id, authenticated=True)