Skip to content

Commit 34bce09

Browse files
feat(posts): add "How to manage Claude Code sessions"
Post: 2026-02-27-how-to-manage-claude-code-sessions.md
1 parent cb260eb commit 34bce09

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
layout: post
3+
title: How to manage Claude Code sessions
4+
date: 2026-02-27 17:21:00
5+
excerpt: How to manage Claude Code sessions in the command-line.
6+
categories: claude code cli bash
7+
---
8+
9+
This post goes over how to manage [Claude Code](https://github.com/anthropics/claude-code) sessions in the command-line:
10+
11+
- [List](#list)
12+
- [Resume](#resume)
13+
- [Clear](#clear)
14+
- [Delete](#delete)
15+
16+
## List
17+
18+
Claude Code stores session data in `~/.claude/projects/`:
19+
20+
```sh
21+
ls ~/.claude/projects/
22+
```
23+
24+
Each session is a [JSON Lines](https://jsonlines.org/) file:
25+
26+
```sh
27+
find ~/.claude/projects -type f -name '*.jsonl'
28+
```
29+
30+
Print an example output:
31+
32+
```sh
33+
cat $(find ~/.claude/projects -type f -name '*.jsonl' | head -n 1)
34+
```
35+
36+
## Resume
37+
38+
Resume a session:
39+
40+
```sh
41+
claude --resume
42+
```
43+
44+
## Clear
45+
46+
You can clear the current conversation context inside a session:
47+
48+
```
49+
/clear
50+
```
51+
52+
But the session file does not get deleted.
53+
54+
## Delete
55+
56+
Delete all project sessions:
57+
58+
```sh
59+
rm -rf ~/.claude/projects/
60+
```
61+
62+
Remove all sessions from a specific project:
63+
64+
```sh
65+
rm -rf ~/.claude/projects/<PROJECT>/*.jsonl
66+
```
67+
68+
> Replace `<PROJECT>` with your project path.

0 commit comments

Comments
 (0)