Blog / claude code
Is Claude Code still working, or is it stuck?
A session looks busy but nothing moves. How to check what Claude Code is really running, when it last did anything, and how to stop what's hung.
On this page
- 1. Read the status under the conversation
- 2. Look at the background tasks
- 3. Check from outside the session
- What to do with a stuck session
- Where Joxo fits
- Frequently asked questions
- How do I know if Claude Code is finished?
- Why does Claude Code say a shell is still running?
- Where does Claude Code keep session transcripts?
- How do I stop a hung Claude Code command?
- Try it with your team
You come back to a Claude Code session after twenty minutes. It still says it's running, the output hasn't moved, and you can't tell whether it's halfway through a long build, waiting on something, or hung. With one session you can usually tell by looking. With five, in five windows, you can't.
There are three places to look: the session's own status, the background task list, and, from outside, the processes and the transcript file. Everything below was checked on Claude Code 2.1.316 on macOS.
1. Read the status under the conversation#
While a turn runs, Claude Code shows a spinner line with a word and a timer, such as ✻ Cogitated for 24s. When the turn ends, the same line gains the time it finished:
✻ Sautéed for 5s · done 7:45 PMIf you see done with a time, the turn is over and the session is waiting for you, even if the last message reads as though more is coming. Type your next message.
If the line ends with · 1 shell still running, or the footer under the prompt shows 1 shell · ↓ to manage, the turn is over but a command it started is still going in the background. That is the usual "it says running but nothing happens" case: a dev server, a watcher, a long test run, or a sign-in waiting for a browser.
2. Look at the background tasks#
Type /tasks. It lists every shell command and subagent still running in the session. Pick one to see its output so far: a build shows its progress, a server shows its log, a sign-in shows the URL and code it's waiting on. Press x to stop it.
A command lands there in two ways: Claude starts it in the background, or it runs past the command time limit (two minutes by default) and Claude Code moves it there. Our post on the 120-second timeout covers the second case.
Background commands stop when you exit Claude Code. In a session you work in, they have no time limit of their own, so a watcher started on Monday is still there on Tuesday if the session is.
3. Check from outside the session#
When the session window itself is frozen, or you have many sessions and want one answer, look from a separate terminal window.
What each session is running right now. This script lists every Claude Code session on the computer, the folder it works in, and the commands under it with how long they have run:
#!/bin/sh
# What each Claude Code session on this computer is running right now
for pid in $(pgrep -x claude); do
dir=$(lsof -a -p "$pid" -d cwd -Fn 2>/dev/null | sed -n 's/^n//p')
echo "claude $pid up $(ps -o etime= -p "$pid" | tr -d ' ') in $dir"
for shell in $(pgrep -P "$pid"); do
for cmd in $(pgrep -P "$shell"); do
ps -o pid=,etime=,command= -p "$cmd" | cut -c1-90 | sed 's/^/ /'
done
done
doneOn our test machine it printed:
claude 29756 up 02:52 in /private/tmp/b3-nov4/p
11218 00:40 /bin/sh ./wait.shA session with nothing under it is idle or thinking. A session with a command that has run for an hour is a good place to look first. Tool servers and helpers a session started also show up here, so a long-running entry isn't always a problem: check what it is before you stop it.
When the session last did anything. Claude Code writes every session to a transcript file under ~/.claude/projects/, in a folder named after the project path with every character that isn't a letter or digit turned into -. The file's last change tells you when the session last did something. Run this in the project folder:
#!/bin/sh
# Minutes since each Claude Code session in this folder last wrote to its transcript
dir=$(pwd -P | sed 's|[^A-Za-z0-9]|-|g')
for f in $(ls -t "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/projects/$dir"/*.jsonl 2>/dev/null | head -5); do
age=$(( ( $(date +%s) - $(date -r "$f" +%s) ) / 60 ))
echo "$(basename "$f" .jsonl) last write $age min ago"
doneb17b4e1e-01c6-430b-9248-b6f36038e114 last write 3 min ago
55d7c568-ced9-4d81-bd84-20de1061f150 last write 6 min agoThe name is the session id, the one claude --resume takes. A session that says it is working but hasn't written for fifteen minutes, with no command under it in the first script, is stuck. We ran this script on macOS and on Debian.
What to do with a stuck session#
- A turn that is over but you missed it: type your next message.
- A background command you don't need: stop it from
/taskswithx. - A command waiting for you (a password, a code, a browser sign-in): finish it yourself in a separate terminal window, then stop the waiting copy. Our post on agents stuck on login prompts shows how to stop that happening.
- A turn that has really hung: press
Escto interrupt it. If the session doesn't respond at all, end the process and start again withclaude --resume, which picks up from the transcript.
Where Joxo fits#
The checks above work for the sessions on the computer in front of you. With Joxo, every session on your computers, and your teammates' agents on the same project, shows in one list on your phone or desktop: which are working, which are quiet, and which are waiting for an answer. Setup is one line pasted into your agent.
Frequently asked questions#
How do I know if Claude Code is finished?#
The status line under the conversation shows done and a time when the turn ends. Until then it shows a spinner and a timer.
Why does Claude Code say a shell is still running?#
A command it started, such as a dev server or a long test run, is still going in the background. Type /tasks to see it and press x to stop it.
Where does Claude Code keep session transcripts?#
In ~/.claude/projects/, one folder per project path, one .jsonl file per session. The file name is the session id.
How do I stop a hung Claude Code command?#
Press Esc to interrupt the current turn, or stop a background command from /tasks. If the whole session is frozen, end the process and resume it with claude --resume.