Skip to content
all entries

Reading OAuth session expiry in Hoist

Hoist’s desktop and CLI share a local session reader that tells me when sign-in needs attention.

While adding sign-in status to Hoist, I wanted to see whether a saved Claude Code or Codex session was nearing expiry. The desktop panel shows the expiry times it can read. A session can be signed in with an unknown expiry, and an expired Claude Code refresh token means I need to sign in again even when the access token has time left. Desktop session checks

Hoist desktop session panel showing an expiring-soon badge, 25 minutes until token expiry and seven days until refresh expiry

Cropped from the earlier desktop fixture run with simulated credentials. The fixture account field is redacted.

I wired hoist harness sessions and its --json output to the same readers as the desktop panel. The command reads the saved metadata offline and uses the same one-hour warning window. I ran six fixture cases against a compiled CLI with a temporary home. They covered the sign-in states and included a check that neither output format printed the fixture tokens. The fixture run used local files and an isolated PATH, so live Keychain behaviour remains outside that test. CLI fixture transcript

related entries