docs/windsurf.md
Windsurf supports two data sources: a web API backed by the current website session, and a local SQLite cache.
Usage source picker:
state.vscdb.devin_* session values from Chromium browsers.~/Library/Application Support/Windsurf/User/globalStorage/state.vscdb.windsurf.settings.cachedPlanInfo in ItemTable.quotaUsage but include usage counters. In that case CodexBar derives
usage windows from usedMessages/messages and usedFlowActions/flowActions.Preferences → Providers → Windsurf → Cookie source:
devin_session_token, devin_auth1_token, devin_account_id, and devin_primary_org_id.F12 or Cmd+Option+I).(() => {
const keys = [
"devin_session_token",
"devin_auth1_token",
"devin_account_id",
"devin_primary_org_id",
];
const read = (key) => {
const value = localStorage.getItem(key);
if (!value) return null;
try {
return JSON.parse(value);
} catch {
return value;
}
};
const payload = Object.fromEntries(keys.map((key) => [key, read(key)]));
const missing = keys.filter((key) => !payload[key]);
if (missing.length > 0) {
console.log("Missing Windsurf session keys:", missing.join(", "));
return;
}
const json = JSON.stringify(payload, null, 2);
console.log(json);
if (typeof copy === "function") {
copy(json);
console.log("Copied Windsurf session bundle to clipboard.");
}
})();
Browser localStorage (leveldb on disk)
↓ extract devin_session_token / devin_auth1_token / devin_account_id / devin_primary_org_id
POST https://windsurf.com/_backend/.../GetPlanStatus
↓ headers: x-auth-token + x-devin-*
↓ protobuf body: { auth_token, include_top_up_status: true }
UsageSnapshot (daily/weekly quota %)
~/Library/Application Support/<Browser>/<Profile>/Local Storage/leveldb/https://windsurf.comdevin_session_tokendevin_auth1_tokendevin_account_iddevin_primary_org_idPOST https://windsurf.com/_backend/exa.seat_management_pb.SeatManagementService/GetPlanStatusContent-Type: application/protoConnect-Protocol-Version: 1Origin: https://windsurf.comReferer: https://windsurf.com/profilex-auth-token: <devin_session_token>x-devin-session-token: <devin_session_token>x-devin-auth1-token: <devin_auth1_token>x-devin-account-id: <devin_account_id>x-devin-primary-org-id: <devin_primary_org_id>1 auth_token: string2 include_top_up_status: boolplan_status.plan_info.plan_nameplan_status.plan_endplan_status.daily_quota_remaining_percentplan_status.weekly_quota_remaining_percentplan_status.daily_quota_reset_at_unixplan_status.weekly_quota_reset_at_unix100 - daily_quota_remaining_percent).100 - weekly_quota_remaining_percent).usedMessages/messages).usedFlowActions/flowActions).plan_status.plan_info.plan_name.plan_status.plan_end.devin_session_token, devin_auth1_token, devin_account_id, and devin_primary_org_id.windsurf.com page.Sources/CodexBarCore/Providers/Windsurf/WindsurfStatusProbe.swift (local SQLite)Sources/CodexBarCore/Providers/Windsurf/WindsurfDevinSessionImporter.swift (Chromium localStorage extraction)Sources/CodexBarCore/Providers/Windsurf/WindsurfWebFetcher.swift (protobuf request + response parsing)Sources/CodexBarCore/Providers/Windsurf/WindsurfProviderDescriptor.swift (fetch strategies)Sources/CodexBar/Providers/Windsurf/WindsurfProviderImplementation.swift (settings UI)Sources/CodexBar/Providers/Windsurf/WindsurfSettingsStore.swift (settings persistence)