[FEATURE] Delete Claude Code sessions

Open 💬 45 comments Opened Dec 10, 2025 by kalam-87

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

When using Claude Code (not CLI or chat) in the browser, smartphone app, or desktop, there is no way to delete sessions that I created. I can archive, but there is no way to delete sessions, which is worrisome.

Edit: this is not related to Claude Code cli or VSCode extension, this is related to the "online" IDE like experience available through the browser or desktop app.

Proposed Solution

The ability to delete sessions.

Alternative Solutions

NA

Priority

High - Significant impact on productivity

Feature Category

Other

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

45 Comments

github-actions[bot] · 7 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/2562
  2. https://github.com/anthropics/claude-code/issues/6084
  3. https://github.com/anthropics/claude-code/issues/10791

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

kalam-87 · 7 months ago

I don't think the possible duplicates are the same - I am referring to the entire session:

<img width="436" height="412" alt="Image" src="https://github.com/user-attachments/assets/89f64ff1-c26e-410d-ba9f-7bfd947135ef" />

<img width="1446" height="1067" alt="Image" src="https://github.com/user-attachments/assets/4efefa15-926a-41af-8572-4b7ba38e810f" />

wowitsjack · 6 months ago

The fact that this isn't already in place is absolutely wild.

Symbai · 6 months ago

Yup, I guess they want to keep the back door open to use the sessions (specifically the repos they pulled) for training purposes at some point. It's not enough for them that I pay for a service, they also want my data. At least this is what it looks like.

KunhuanLiu · 6 months ago

Seconding this. Claude Code with the VS Code UI creates a lot of 'empty' sessions (which technically still have a few hundred tokens of usage, AFAIK). A feature to automatically clean these up is needed.

The original post asks for a function to allow manual deletion, which is equally important.

duan-contek · 6 months ago

I was trying claude code for vscode today and found that the past sessions can't be deleted. That's insane, I could only guess they want to keep the sessions for training, unbelievable man.

duan-contek · 6 months ago

Ohhh, I figured out how to delete them. Run cmd rm -rf ~/.claude/projects/*, or if you only want to delete sessions for a specific directory, find the directory name in ~/.claude/projects and remove it.

mkalam-cloudzero · 6 months ago
Ohhh, I figured out how to delete them. Run cmd rm -rf ~/.claude/projects/*, or if you only want to delete sessions for a specific directory, find the directory name in ~/.claude/projects and remove it.

Does not work for Claude Code "online" (not Claude Code local/VSCode)

duan-contek · 6 months ago
> Ohhh, I figured out how to delete them. Run cmd rm -rf ~/.claude/projects/*, or if you only want to delete sessions for a specific directory, find the directory name in ~/.claude/projects and remove it. Does not work for Claude Code "online" (not Claude Code local/VSCode)

Well, I think the claude team need to add this feature

lunrenyi · 5 months ago

@duan-contek
Hi, regarding session management, we have implemented a wrapper in x-cmd that supports deleting, listing, and restoring claude-code sessions.
You can find the usage and examples here: https://www.x-cmd.com/mod/claude/cookbook-6

Hope this helps!

Palenoff · 5 months ago

Seems like they have added the deletion button, which eventually doesn't work. The HTTP request returns 404 error (not_found_error).

<img width="358" height="46" alt="Image" src="https://github.com/user-attachments/assets/5a764681-4717-4042-a2d4-fe572552eaa6" />

bradical · 5 months ago

What's the diff between what's in .claude/session-env/ and ./claude/projects?

Symbai · 5 months ago
Seems like they have added the deletion button, which eventually doesn't work

Confirmed, I cannot delete any of my archived sessions in WebUI. It always says failed and try again. I reported this as a bug 2-3 days ago but didn't got any reply so far. I can click on the sessions and see everything is still there. It doesn't even say WHY it fails. Its so frustrating to see such a basic feature isn't (properly) implemented.

Palenoff · 5 months ago
Confirmed, I cannot delete any of my archived sessions in WebUI.

And you cannot unarchive your sessions either.

smashedtoatoms · 5 months ago

fwiw, I nuked the git worktree, which eventually cleared it from the web client, and then nuked it from '/Users/<username>/Library/Application Support/Claude/claude-code-sessions'. It no longer appears in the app or in the web client. It is definitely harder than it should be, but it appears to at least be possible.

filipsedivy · 5 months ago

When you click on the trash can in the session in Claude Code UI, you can delete the chat.

A DELETE request https://claude.ai/session-proxy/{sessionId} is sent and a response is successfully returned.

Palenoff · 5 months ago

Okay, the Delete button seems to be working now in the Web UI.
However, it's still unclear how to unarchive a session.

Symbai · 5 months ago
Okay, the Delete button seems to be working now in the Web UI.

Yes, it worked for a few days, but now it's broken again. It looks like they're making changes to the WebUI every day. I wish I could just "freeze" an environment that I think is stable enough to work with, and they would create an opt-in beta WebUI to make daily changes to it.

acutype · 5 months ago

sorry. newbie here, so how can I delete a session on claude code extension? or there is no feature as that, is it a slash command? thank you for whoever is answering genuinely

duan-contek · 5 months ago
sorry. newbie here, so how can I delete a session on claude code extension? or there is no feature as that, is it a slash command? thank you for whoever is answering genuinely

https://github.com/anthropics/claude-code/issues/13514#issuecomment-3709753641

BB9z · 5 months ago

I found a third-party VS Code extension that can manage: https://marketplace.visualstudio.com/items?itemName=es6kr.claude-sessions

bradical · 5 months ago

Would be nice if there was a remove or archive slash command when working with sessions themselves without having to hunt around for the right file in ~/.claude.

paulrouget · 4 months ago

<img width="358" height="46" alt="Image" src="https://github.com/user-attachments/assets/664ab66d-20d7-4bb5-b866-ab17cdd086ba" />

Can't delete sessions still.

kadifeden-kesesi · 4 months ago

A threat actor who gained access to my GitHub account stole my account on the Claude AI Web platform, which I used to fix a bug, and downloaded the entire project from my company’s GitHub repository to their own computer. Because Anthropic failed to respond to the emails I sent for approximately one month and because the deletion function, one of the most basic features, was intentionally not working, my company filed a $10 million compensation lawsuit against Anthropic for failing to meet its GDPR obligations. This company is illegally downloading user repositories and training its models using customer conversations. Instead of wasting your time here, take legal action against this criminal organization.

enesduman · 4 months ago

<img width="406" height="62" alt="Image" src="https://github.com/user-attachments/assets/6d0c30c0-77b0-42f2-b704-d06ce166dc5f" />

Can't delete sessions still. How can i delete claude code cloud session ???
I will check inspect network
request example
Delete
https://claude.ai/session-proxy/sessionid
empty payload
and response
{
"type": "error",
"error": {
"type": "not_found_error",
"message": "Not Found"
},
"request_id": "req_id"
}

iulian0512 · 4 months ago

bump

Joan1211 · 4 months ago

same issue on my side, for the last month, unable to delete any previous sessions. on browser or on the mac app.

acutype · 4 months ago

anyone in charge? we want delete claude code sessions feature, thanks

davidassigbi · 4 months ago

@acutype just vide code a / command to do it

GooeyPancake · 4 months ago

I was able to delete it locally at C:\Users\USER\.claude\projects but is it really gone from their servers? Likely not.

A delete button could go a long way for trust and safety.

lucasfigueiredo · 4 months ago

This is really annoying. The worse is that there is no "unarchive". You basically have no idea what is going on with your data and where it is stored.

emadak47 · 4 months ago

for CLI users: a hacky workaround and not the exactly the /delete [session] we are all looking for, but one can configure auto-deletion via cleanupPeriodDays in ~/.claude/settings.json (see https://code.claude.com/docs/en/settings#available-settings)

bradical · 4 months ago

Thanks @emadak47 that could actually work well if I could pair with some ability to preserve specific sessions indefinitely (star them or something)

GravesXX · 4 months ago

Community Plugin: session-manager

Built a plugin that goes beyond just delete — full interactive session management TUI.

Repo: https://github.com/GravesXX/session-manager
Install: claude plugin marketplace add https://github.com/GravesXX/session-manager.git

Features

  • Full-screen terminal UI (alternate buffer, ANSI escape codes, zero deps)
  • Browse all sessions with metadata (date, size, msg count, first message)
  • Preview conversations, delete with confirmation
  • Filter by project / size / age, type-to-search
  • --clean-auto one-click cleanup of auto-generated local-command sessions
  • CLI fallback when no TTY (Claude mediates)

Controls

↑↓ Navigate · Enter Preview · Backspace Delete · Tab Filter · Type to search · Esc Quit

32 tests, vanilla Node.js, follows official plugin conventions.
Submitted to plugin marketplace. Feedback welcome.

samlayton99 · 3 months ago

Also bump, I have this workaround but it could easily be included as a /sessions command

#!/bin/bash

Manage Claude Code sessions for the current project.

#

Usage:

./claude-sessions.sh # list all sessions

./claude-sessions.sh --unnamed # delete all unnamed sessions

./claude-sessions.sh --name "Session X" # delete session named "Session X"

PROJ=$(echo "$PWD" | sed 's|/|-|g')
DIR="$HOME/.claude/projects/$PROJ"

if [ ! -d "$DIR" ]; then
echo "No sessions found for this project."
exit 1
fi

get_name() {
python3 -c "
import json, sys
name = ''
with open(sys.argv[1]) as f:
for line in f:
try:
d = json.loads(line)
if d.get('type') == 'custom-title':
name = d['customTitle']; break
if d.get('type') == 'agent-name':
name = d['agentName']; break
except: pass
print(name)
" "$1"
}

if [ $# -eq 0 ]; then
echo "Sessions for: $PWD"
echo "---"
for f in "$DIR"/*.jsonl; do
[ -f "$f" ] || continue
sid=$(basename "$f" .jsonl)
name=$(get_name "$f")
echo "${name:-(unnamed)} | $sid"
done
exit 0
fi

if [ "$1" = "--unnamed" ]; then
count=0
for f in "$DIR"/*.jsonl; do
[ -f "$f" ] || continue
sid=$(basename "$f" .jsonl)
name=$(get_name "$f")
if [ -z "$name" ]; then
rm "$f"
rm -rf "$DIR/$sid/" 2>/dev/null
echo "Deleted: $sid"
count=$((count + 1))
fi
done
echo "Deleted $count unnamed session(s)."
exit 0
fi

if [ "$1" = "--name" ]; then
if [ -z "$2" ]; then
echo "Usage: ./claude-sessions.sh --name \"Session Name\""
exit 1
fi
target="$2"
found=0
for f in "$DIR"/*.jsonl; do
[ -f "$f" ] || continue
sid=$(basename "$f" .jsonl)
name=$(get_name "$f")
if [ "$name" = "$target" ]; then
rm "$f"
rm -rf "$DIR/$sid/" 2>/dev/null
echo "Deleted: $target ($sid)"
found=1
fi
done
if [ $found -eq 0 ]; then
echo "No session found with name: $target"
exit 1
fi
exit 0
fi

echo "Unknown flag: $1"
echo "Usage:"
echo " ./claude-sessions.sh # list sessions"
echo " ./claude-sessions.sh --unnamed # delete unnamed sessions"
echo " ./claude-sessions.sh --name \"Name\" # delete named session"
exit 1

samlayton99 · 3 months ago

just kidding, I just made a repo. Go in and follow this and it will take care of it for you:

https://github.com/samlayton99/claude-sessions

d4n1b · 3 months ago

Bump

howermj · 3 months ago

+1. Same problem in Cowork on Windows.
Two additional dimensions this thread hasn't covered:

Archived chats also need deletion. Currently, archiving a Cowork session sends it into a black hole — it disappears from the active list but there's no reliable way to access it again (see #22931, #24534), and no way to permanently delete it. Archive is effectively a one-way trap, not a lifecycle stage. Users need a path from archive → delete, not just active → archive.
This is a data hygiene issue, not just a UX preference. Sessions accumulate project-specific context, file paths, and working decisions. Users should be able to permanently remove sessions they no longer need — not just hide them. "Archive only" means the data persists indefinitely with no user control over its lifecycle.

Platform: Windows, Claude Desktop with Cowork, Opus 4.6.

yurukusa · 3 months ago

A cleanup script (run as a Notification start hook) can manage old sessions:

SESSION_DIR="$HOME/.claude/sessions"
[ -d "$SESSION_DIR" ] || exit 0
TOTAL=$(ls "$SESSION_DIR" 2>/dev/null | wc -l)
DELETED=0
find "$SESSION_DIR" -name '*.json' -mtime +7 -exec rm {} \; 2>/dev/null
DELETED=$(($TOTAL - $(ls "$SESSION_DIR" 2>/dev/null | wc -l)))
[ $DELETED -gt 0 ] && echo "[Cleanup] Removed $DELETED sessions older than 7 days" >&2
exit 0

For manual session management, a wrapper script:

case "$1" in
    list)
        ls -lt ~/.claude/sessions/*.json 2>/dev/null | head -20
        ;;
    delete)
        rm -f ~/.claude/sessions/"$2"*.json
        echo "Deleted session matching: $2"
        ;;
    clean)
        find ~/.claude/sessions -name '*.json' -mtime +${2:-7} -delete
        echo "Cleaned sessions older than ${2:-7} days"
        ;;
esac

Usage: cc-sessions list, cc-sessions delete abc123, cc-sessions clean 14

dr5hn · 3 months ago

CCM has session management commands that cover this:

\\\bash
ccm session list # list all sessions with sizes
ccm session search "project" # find sessions by project name
ccm clean sessions --days 30 # clean sessions older than 30 days
ccm clean all --days 14 # clean everything (9 targets) older than 14 days
\
\\

The clean command targets: sessions, tmp files, logs, file history, output files, and more. Supports --dry-run to preview what would be removed.

\curl -fsSL https://raw.githubusercontent.com/dr5hn/ccm/main/install.sh | bash\

dotkrnl · 3 months ago

I asked Claude Code to identify a way to delete them and here is a working response:

- **Base URL**: `https://api.anthropic.com`
- **List**: `GET /v1/sessions` 
- **Delete**: `DELETE /v1/sessions/{session_id}`
- **Archive**: `POST /v1/sessions/{session_id}/archive`
- **Required headers**: `Authorization: Bearer {oauth_token}`, `anthropic-beta: ccr-byoc-2025-07-29`, `x-organization-uuid: {org_uuid}`

This is for the remote sessions.

urav06 · 3 months ago

I built a plugin that does this: github.com/urav06/claudestrophobic

It's a skill (not MCP, so no context window cost) that lets you list, delete, and prune sessions from within Claude Code. Session names come from transcript metadata so you're not staring at UUIDs. Deletion covers transcripts, subagent data, file-history, and session-env.

I cross-checked the cleanup paths against Claude Code's recently surfaced internals so nothing gets left dangling.

<img src="https://github.com/user-attachments/assets/9f6ad16c-1b13-4336-81d5-faea0eb3eedd" alt="demo" width="480"/>

BlazeinPortland · 3 months ago

Standalone script:
https://github.com/BlazeinPortland/cowork-session-manager/tree/main

Or skill:
https://github.com/BlazeinPortland/cowork-session-manager-skill

Claude Cowork Session Manager
A lightweight desktop tool for viewing and deleting your Claude Cowork chat sessions — no installation required beyond Python 3.

<img width="1304" height="762" alt="Image" src="https://github.com/user-attachments/assets/d5834c9d-da12-48cf-a486-16c03e126626" />

What it does
Runs a local web server and opens your browser to a clean dark-themed UI that lists all your Cowork sessions. You can select one or many sessions and permanently delete them, with a confirmation step before anything is removed.

Dark table listing Cowork sessions with checkboxes and a Delete Selected button

KenCheung-AIxFinance · 3 months ago
The fact that this isn't already in place is absolutely wild.

---
Repo:
https://github.com/KenCheung-AIxFinance/claude-code-session-manager

🔧 Claude Code Session Manager (CCSM)

A CLI + TUI utility designed to fully manage and safely delete Claude Code sessions with proper cleanup across all associated data.

---

💡 Why this matters

Deleting a session isn’t just removing a single file. It involves coordinated cleanup across:

  • ~/.claude/tasks/
  • ~/.claude/todos/
  • ~/.claude/sessions/
  • ~/.claude/history.jsonl
  • and several other linked directories

Missing any of these leads to:

  • orphaned data
  • bloated storage
  • inconsistent state

CCSM handles this correctly and safely.

---

✨ Key Features

  • 🔍 Inspect before delete (ccsm info <session-id>)
  • 🧪 Dry-run mode to preview deletions
  • 🗑️ Safe session deletion with full dependency cleanup
  • 📁 Project-level deletion
  • 🧹 Orphan session cleanup
  • 🖥️ Interactive TUI for fast navigation and management
  • 🤖 JSON output for automation pipelines

---

🎯 Target Use Cases

  • Heavy Claude Code users with many sessions
  • Developers building automation around Claude workflows
  • Anyone wanting clean, deterministic state management

---

🔗 Repository

Repo:
https://github.com/KenCheung-AIxFinance/claude-code-session-manager

---

Happy to answer questions or take feedback if you give it a try!

Alex-Momotov · 7 days ago

I've made a Rust cli tool that lists, deletes, renames claude code sessions. I know, it's a forth claude session manager in this thread, but here we go anyway 😄 I wanted something genuinely simple and git-cli like 👀 standalone Rust binary also.

https://github.com/Alex-Momotov/cs

Install: curl -fsSL https://raw.githubusercontent.com/Alex-Momotov/cs/main/install.sh | sh
Usage:

cs ls                       list sessions for the current directory: id + name
cs rename <id|name> <name>  rename a session
cs rm <id|name>             delete a session and its associated files — no prompt
cs rm --all                 delete every session for the current directory — prompts first

  -y, --yes    skip the confirmation prompt (only relevant with --all)
  --force      also act on a session that's currently open in another terminal