Created
January 28, 2026 08:32
-
-
Save LordOfPolls/5ca16c65bc25dc4f3c3de409ab1eae6a to your computer and use it in GitHub Desktop.
Paste this in dev console on claude.ai, and it will delete all chats on your claude account.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function bulkDeleteClaudeChats() { | |
| const DELAY_MS = 500; | |
| const orgMatch = document.location.pathname.match(/org\/([a-f0-9\-]+)/); | |
| let orgId = orgMatch ? orgMatch[1] : null; | |
| if (!orgId) { | |
| const orgResp = await fetch("https://claude.ai/api/organizations", { credentials: 'include' }); | |
| const orgs = await orgResp.json(); | |
| orgId = orgs[0]?.uuid; | |
| } | |
| if (!orgId) throw new Error("Could not find Organization ID. Run this while logged into Claude.ai."); | |
| const listResp = await fetch(`https://claude.ai/api/organizations/${orgId}/chat_conversations`, { | |
| credentials: 'include' | |
| }); | |
| if (!listResp.ok) { | |
| console.error("Failed to fetch chats. HTTP Status:", listResp.status); | |
| return; | |
| } | |
| const chats = await listResp.json(); | |
| const count = chats.length; | |
| if (count === 0) { | |
| console.log("No conversations found."); | |
| return; | |
| } | |
| const totalSeconds = Math.ceil((count * DELAY_MS) / 1000); | |
| const minutes = Math.floor(totalSeconds / 60); | |
| const seconds = totalSeconds % 60; | |
| const timeString = minutes > 0 ? `${minutes}m ${seconds}s` : `${seconds}s`; | |
| const proceed = confirm( | |
| `Found ${count} chats.\n` + | |
| `Estimated runtime: ${timeString}\n\n` | |
| ); | |
| if (!proceed) return; | |
| const delay = (ms) => new Promise(r => setTimeout(r, ms)); | |
| const startTime = Date.now(); | |
| for (let i = 0; i < count; i++) { | |
| const chat = chats[i]; | |
| try { | |
| const res = await fetch(`https://claude.ai/api/organizations/${orgId}/chat_conversations/${chat.uuid}`, { | |
| method: 'DELETE', | |
| credentials: 'include', | |
| headers: { 'Content-Type': 'application/json' } | |
| }); | |
| if (res.ok || res.status === 204) { | |
| console.log(`🗑️ [${i + 1}/${count}] Deleted: ${chat.name || chat.uuid}`); | |
| } else if (res.status === 429) { | |
| console.warn("Rate limited. Waiting 10 seconds..."); | |
| await delay(10000); | |
| i--; | |
| continue; | |
| } else { | |
| console.warn(`[${i + 1}/${count}] Failed: ${res.status}`); | |
| } | |
| } catch (err) { | |
| console.error(`Error on ${chat.uuid}:`, err); | |
| } | |
| await delay(DELAY_MS); | |
| } | |
| const actualTime = ((Date.now() - startTime) / 1000).toFixed(1); | |
| console.log(`Finished. Deleted ${count} items in ${actualTime}s. Refresh the page.`); | |
| } | |
| bulkDeleteClaudeChats(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment