Skip to content

Instantly share code, notes, and snippets.

@Jalalx
Last active November 2, 2025 04:59
Show Gist options
  • Select an option

  • Save Jalalx/6b99f5ff4a0aef17b4e4eff37b0ad235 to your computer and use it in GitHub Desktop.

Select an option

Save Jalalx/6b99f5ff4a0aef17b4e4eff37b0ad235 to your computer and use it in GitHub Desktop.
Script to delete Claude AI conversations history without any dependency or using external tool.

What is this?

You want to delete all your conversations with Claude AI, but there is no button to clean them by one click (Like what ChatGPT has). Using this instructions, you can clean all conversations. No dependency or external tool is needed (except your Google Chrome browser!)

To delete all chats with the Claude AI:

  1. Open Google Chrome and go to https://claude.ai
  2. Login to your account and start a new chat conversation
  3. Open DevTools and go to the Network tab
  4. You need to find the origanization id. Paste the https://claude.ai/api/bootstrap in the Filter input to find the calls to that URL. If you could not find it, reload the page. Also make sure you are selecting the "All" type. You will see calls that contain a uuid in the url which is your organization id.
  5. Now move to the Console tab and then paste the following two functions:
    function deleteConversation(organizationID, uuid) {
      return fetch(`https://claude.ai/api/organizations/${organizationID}/chat_conversations/${uuid}`, {
        method: 'DELETE'
      })
        .then(response => {
          if (response.ok) {
            console.log(`Successfully deleted conversation: ${uuid}`);
            return true;
          } else {
            console.log(`Failed to delete conversation: ${uuid}`);
            return false;
          }
        })
        .catch(error => {
          console.error('Error:', error);
          return false;
        });
    }
    
    
    function fetchAndDeleteConversations(organizationID) {
      let deletedCount = 0;
    
      fetch(`https://claude.ai/api/organizations/${organizationID}/chat_conversations`)
        .then(response => response.json())
        .then(data => {
          const deletePromises = data.map(conversation => deleteConversation(organizationID, conversation.uuid));
          return Promise.all(deletePromises);
        })
        .then(results => {
          deletedCount = results.filter(result => result === true).length;
        })
        .catch(error => console.error('Error:', error));
    }
  6. And now run it like this: fetchAndDeleteConversations("put your organization uuid here")

Thank you ac1982 for the Chrome Extension, I took the 2 functions, because an extension for this was too much for me :D

@Chapoly1305
Copy link

Chapoly1305 commented Nov 2, 2025

Still working. It’s recommended to add a delay between requests to prevent the 429 Too Many Requests error. In fact, there is an (new) API to delete multiple at once.

async function deleteAllConversations(organizationID) {
  try {
    const response = await fetch(`https://claude.ai/api/organizations/${organizationID}/chat_conversations`);
    const data = await response.json();
    
    const totalConversations = data.length;
    console.log(`Found ${totalConversations} conversations to delete`);
    
    if (totalConversations === 0) {
      console.log('No conversations to delete');
      return 0;
    }
    
    const uuids = data.map(conv => conv.uuid);
    
    const deleteResponse = await fetch(`https://claude.ai/api/organizations/${organizationID}/chat_conversations/delete_many`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        conversation_uuids: uuids
      })
    });
    
    const result = await deleteResponse.json();
    
    if (deleteResponse.ok) {
      console.log(`Successfully deleted ${totalConversations} conversations`);
      return totalConversations;
    } else {
      console.error('Failed to delete conversations:', result);
      return 0;
    }
  } catch (error) {
    console.error('Error:', error);
    return 0;
  }
}

then,
deleteAllConversations("Org UUID")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment