Skip to content

Instantly share code, notes, and snippets.

@panicoenlaxbox
Created March 19, 2026 08:25
Show Gist options
  • Select an option

  • Save panicoenlaxbox/2a30dde81a033d774e83a85e2dd853a3 to your computer and use it in GitHub Desktop.

Select an option

Save panicoenlaxbox/2a30dde81a033d774e83a85e2dd853a3 to your computer and use it in GitHub Desktop.
deleteAllClaudeChats
// === BULK DELETE CLAUDE.AI CHATS ===
// Replace ORG_ID below with your own
const orgId = "YOUR_ORGANIZATION_GOES_HERE";
async function deleteAllClaudeChats() {
// Fetch all chats
const resp = await fetch(`https://claude.ai/api/organizations/${orgId}/chat_conversations`, {
credentials: 'include'
});
const chats = await resp.json();
if (!Array.isArray(chats) || chats.length === 0) {
console.warn("No chats found.");
return;
}
console.log(`Found ${chats.length} conversations.`);
const proceed = confirm(`⚠️ This will permanently delete ${chats.length} chats.\n\nDo you want to continue?`);
if (!proceed) {
console.log("Aborted by user.");
return;
}
// Rate limit: 1 delete every 500ms to stay safe
for (const [i, chat] of chats.entries()) {
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) {
console.log(`✅ [${i + 1}/${chats.length}] Deleted: ${chat.name}`);
} else {
console.warn(`⚠️ [${i + 1}/${chats.length}] Failed: ${chat.name} (${res.status})`);
}
// Delay to avoid rate limits
await new Promise(r => setTimeout(r, 500));
}
console.log("🎉 All deletions attempted. Refresh your page to verify.");
}
deleteAllClaudeChats();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment