[BUG] Desktop: start_session refuses a user_asked start with the 10-session limit error though no session was started since the user pressed yes

Open
#111,496 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
26/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Nothing in the report points at a file: the refusal comes from the start_session guard that counts sessions started since the last user message, and the report only describes behaviour from the Desktop Code tab, not a code path. The first step is to find where that limit message is produced and how the per-message session counter is incremented and reset, then check whether a reply-button press and a detach_session to top level with an archived parent affect the counter. Done means a reproduction where a user_asked start after a button press succeeds below both limits, or the error names the real blocking cause. Note the reproduction was never reduced to a minimal case, so expect time spent reproducing before any edit.

Written by the indexing model from the issue text.

Description

area:agents area:desktop bug platform:macos
Preflight Checklist
  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code
What's Wrong?

In the Desktop Code tab, start_session with initiation: "user_asked" was refused twice in a row. Each time the turn had been opened by the user pressing a next-step box reply button that said yes to starting that session (first "Yes, at xhigh", then "Yes, try again"). Both calls returned:

Not started: For this work the app starts at most 10 sessions without a card after each message from the user, 5 of them working at once, and it can't start another now. Say in your last message what's left to start, and propose it (initiation "own_initiative"): the user can start it from its card.

No session had been started since either button press, and list_sessions showed none of the user's sessions running. So neither number in the error was reached.

The session calling the tool had itself been started by another session with start_session, was moved to top level with detach_session early on, and the session that started it had been archived since.

What Should Happen?

A reply button press counts as a message from the user, so a user_asked start right after it goes through while fewer than 10 sessions were started since that press and fewer than 5 are working. If something else blocks the start, such as the session having been started by another session, the error names that cause instead of a count that wasn't reached.

Error Messages/Logs
Not started: For this work the app starts at most 10 sessions without a card after each message from the user, 5 of them working at once, and it can't start another now. Say in your last message what's left to start, and propose it (initiation "own_initiative"): the user can start it from its card.
Steps to Reproduce

What led to it here; not yet reduced to a minimal case:

  1. In the Desktop Code tab, session A starts session B with start_session (initiation: "user_asked"). B calls detach_session with self. A is archived later.
  2. B does its task over several turns, starting no sessions. One of its turns ends with a next-step box (wrap_up) whose question offers to start a new session, with "Yes, at xhigh" as a reply button.
  3. The user presses the button.
  4. B calls start_session with initiation: "user_asked", context: "fresh", model, effort, prompt and background. It is refused with the error above.
  5. B ends the turn with a next-step box asking whether to try again. The user presses "Yes, try again", and the same call is refused with the same error.
Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.328 (Claude desktop app 6.28899.2)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

Desktop app 6.28899.2 on macOS 27.2.1, whose session ran Claude Code 2.1.328 (npm lists 2.1.330). The app's plan limits were not the cause: the 5-hour limit was at 8%.

Related but different: #109329 asks to make the 10 per message and 5 working at once limits a setting; this report is about the limit refusing when neither number was reached. #103073 is about refusals after a side-session event, with a different error message.

Prompts behind this issue

Model: claude-opus-5-5, effort: xhigh

4. (answer to: shall I start the session on Opus at high or xhigh effort?)

Yes, at xhigh

Reply: start_session was refused with the 10-session error. [Details about a downstream project left out.]

5. (answer to: shall I try starting the session again?)

Yes, try again

Reply: The app refused the session a second time, with the same 10-session message.

7.

just paste it to claude code issues. we cant use feedback at [the user's employer] because we cant train models with customer data

Reply: The issue form is filled in and waits unsubmitted. [Details about a downstream project left out.]

9. (answer to: shall I tick the latest-version box and submit the issue?)

Yes, submit it

Dominant language
TypeScript
Stars
156k
Forks
25k
Avg merge
16h 19m
Merged PRs (30d)
5

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anthropics/claude-code

All issues in anthropics/claude-code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.