From customgpt-ai-rag
Permanently remove a specific document (page) from the CustomGPT.ai agent's knowledge base by page ID. Requires confirmation. Use /list-pages to find page IDs.
How this skill is triggered — by the user, by Claude, or both
Slash command
/customgpt-ai-rag:delete-pageThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Permanently remove a document from the agent's knowledge base by its page ID. The agent will no longer reference this content when answering questions. Cannot be undone — re-upload with `/index-files` to restore.
Permanently remove a document from the agent's knowledge base by its page ID. The agent will no longer reference this content when answering questions. Cannot be undone — re-upload with /index-files to restore.
.customgpt-meta.json to get agent_idFollow the lookup procedure in skills/_shared/api-key.md. Store the result as $API_KEY.
Walk up from $PWD toward /, looking for .customgpt-meta.json. Extract agent_id.
If not found:
"No agent found in this directory tree. Run
/create-agentto set one up first."
If the user provided a numeric page ID: use it directly as $PAGE_ID.
If the user provided a filename or URL instead of an ID: search the pages list to find the matching document. Fetch pages until a match is found:
curl -s --request GET \
--url "https://app.customgpt.ai/api/v1/projects/${AGENT_ID}/pages?page=${PAGE}&limit=100&order=asc" \
--header "Authorization: Bearer ${API_KEY}" \
--header "accept: application/json"
Match filename or page_url (case-insensitive substring). If found, note the id, filename or page_url.
If not found after checking all pages:
"No document matching '{term}' found. Run
/list-pagesto browse all indexed documents."
If no identifier provided at all:
"Please provide a page ID or filename. Run
/list-pagesto see all documents and their IDs."
Present the details and ask for confirmation:
"About to permanently delete page {PAGE_ID} (
{filename or page_url}) from agent {agent_id}. This cannot be undone. The file must be re-uploaded to restore it.Continue? (yes/no)"
If not confirmed: "Cancelled. Page {PAGE_ID} was not deleted."
curl -s --request DELETE \
--url "https://app.customgpt.ai/api/v1/projects/${AGENT_ID}/pages/${PAGE_ID}" \
--header "Authorization: Bearer ${API_KEY}" \
--header "accept: application/json"
Read the response:
On success:
"Page {PAGE_ID} (
{filename or page_url}) deleted from agent {agent_id}.""To restore it, run
/index-files {filename}. To refresh a different version of the same file in one step, use/reindex-file {filename}."
On failure:
"Delete failed (HTTP {status}): {error message from response body}"
npx claudepluginhub adorosario/customgpt-skill-plugin --plugin customgpt-ai-ragRemoves Knowledge Base files from CLAUDE.md tables and optionally deletes them from disk. Supports direct path or interactive selection, with cross-reference cleanup and index updates.
Deletes specific observations or sessions from agentmemory via API after user confirmation. Use for privacy requests like 'forget this', 'delete memory', or targeted data removal.