[BUG] v2.1.81 hungs at the end, without exiting

Resolved 💬 3 comments Opened Mar 24, 2026 by Somebi Closed Apr 23, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

From claude code router logs:

{ "level": 20, "time": 1774370600359, "pid": 748, "hostname": "3c3f40de2800", "reqId": "req-28", "request": { "method": "POST", "headers": {}, "body": "{\"model\":\"glm-5-turbo\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"<system-reminder>\\nThe following skills are available for use with the Skill tool:\\n\\n- update-config: Use this skill to configure the Claude Code harness via settings.json. Automated behaviors (\\\"from now on when X\\\", \\\"each time X\\\", \\\"whenever X\\\", \\\"before/after X\\\") require hooks configured in settings.json - the harness executes these, not Claude,
...
on or task you need help with. Be specific and include relevant details. Good: 'How to set up authentication with JWT in Express.js' or 'React useEffect cleanup function examples'. Bad: 'auth' or 'hooks'. The query is sent to the Context7 API for processing. Do not include any sensitive or confidential information such as API keys, passwords, credentials, personal data, or proprietary code in your query.\"}},\"required\":[\"libraryId\",\"query\"],\"$schema\":\"http://json-schema.org/draft-07/schema#\"}}],\"metadata\":{\"user_id\":\"{\\\"device_id\\\":\\\"1ec6d3ada42e1aaef656c2a831da163...\\\",\\\"account_uuid\\\":\\\"\\\",\\\"session_id\\\":\\\"cb3e8253-25cb-40af-a81f-ba30ca4ef743\\\"}\"},\"max_tokens\":32000,\"thinking\":{\"type\":\"adaptive\"},\"output_config\":{\"effort\":\"medium\"},\"stream\":true}", "signal": {} }, "headers": { "accept": "application/json", "accept-encoding": "gzip, deflate", "accept-language": "*", "anthropic-beta": "claude-code-20250219,interleaved-thinking-2025-05-14,prompt-caching-scope-2026-01-05,effort-2025-11-24", "anthropic-dangerous-direct-browser-access": "true", "anthropic-version": "2023-06-01", "authorization": "Bearer ...", "connection": "keep-alive", "content-type": "application/json", "sec-fetch-mode": "cors", "user-agent": "claude-cli/2.1.81 (external, sdk-cli)", "x-api-key": "...", "x-app": "cli", "x-stainless-arch": "x64", "x-stainless-lang": "js", "x-stainless-os": "Linux", "x-stainless-package-version": "0.74.0", "x-stainless-retry-count": "0", "x-stainless-runtime": "node", "x-stainless-runtime-version": "v22.22.1", "x-stainless-timeout": "600" }, "requestUrl": "https://api.z.ai/api/anthropic/v1/messages", "useProxy": "", "msg": "final request" } { "level": 30, "time": 1774370604440, "pid": 748, "hostname": "3c3f40de2800", "reqId": "req-28", "res": { "statusCode": 200 }, "responseTime": 4172.341067969799, "msg": "request completed" }

~/.claude/projects/-workspace-task/cb3e8253-25cb-40af-a81f-ba30ca4ef743.jsonl

{
  "parentUuid": "686af1c9-e410-4fe8-ab11-1e6a764d2453",
  "isSidechain": false,
  "message": {
    "id": "msg_202603250043001cb5bf9e46524c4a",
    "type": "message",
    "role": "assistant",
    "model": "glm-5-turbo",
    "content": [
      {
        "type": "text",
        "text": "Done. Here's a summary of what was fixed:..."
      }
    ],
    "stop_reason": "end_turn",
    "stop_sequence": null,
    "usage": {
      "input_tokens": 556,
      "cache_creation_input_tokens": 0,
      "cache_read_input_tokens": 67797,
      "output_tokens": 183,
      "server_tool_use": {
        "web_search_requests": 0,
        "web_fetch_requests": 0
      },
      "service_tier": "standard",
      "cache_creation": {
        "ephemeral_1h_input_tokens": 0,
        "ephemeral_5m_input_tokens": 0
      },
      "inference_geo": "",
      "iterations": [],
      "speed": "standard"
    }
  },
  "type": "assistant",
  "uuid": "c0e50d6d-2083-477f-be8b-5b14093407df",
  "timestamp": "2026-03-24T16:43:24.439Z",
  "userType": "external",
  "entrypoint": "sdk-cli",
  "cwd": "/workspace/task",
  "sessionId": "cb3e8253-25cb-40af-a81f-ba30ca4ef743",
  "version": "2.1.81",
  "gitBranch": "HEAD",
  "slug": "piped-riding-pillow"
}

There were sub-agents calls:
~/.claude/projects/-workspace-task/cb3e8253-25cb-40af-a81f-ba30ca4ef743/subagents

agent-ae0ae858bcc54cfb9.meta.json

{"agentType":"Explore","description":"Find node click handler"}

agent-ae0ae858bcc54cfb9.jsonl

{
  "parentUuid": "f6675b91-3489-406d-a634-889630ff1d52",
  "isSidechain": true,
  "agentId": "ae0ae858bcc54cfb9",
  "type": "progress",
  "data": {
    "type": "hook_progress",
    "hookEvent": "PostToolUse",
    "hookName": "PostToolUse:Read",
    "command": "callback"
  },
  "parentToolUseID": "call_5ccbc5e2d2e141bcbcad6938",
  "toolUseID": "call_5ccbc5e2d2e141bcbcad6938",
  "timestamp": "2026-03-24T16:41:18.410Z",
  "uuid": "aa9e088d-5445-4259-abef-7755f7a5529d",
  "userType": "external",
  "entrypoint": "sdk-cli",
  "cwd": "/workspace/task",
  "sessionId": "cb3e8253-25cb-40af-a81f-ba30ca4ef743",
  "version": "2.1.81",
  "gitBranch": "HEAD",
  "slug": "piped-riding-pillow"
}
{
  "parentUuid": "aa9e088d-5445-4259-abef-7755f7a5529d",
  "isSidechain": true,
  "agentId": "ae0ae858bcc54cfb9",
  "message": {
    "id": "msg_202603250040587e1e7769735d4dc1",
    "type": "message",
    "role": "assistant",
    "model": "glm-5-turbo",
    "content": [
      {
        "type": "text",
        "text": "Here is the complete..."
      }
    ],
    "stop_reason": "end_turn",
    "stop_sequence": null,
    "usage": {
      "input_tokens": 9609,
      "cache_creation_input_tokens": 0,
      "cache_read_input_tokens": 24767,
      "output_tokens": 1244,
      "server_tool_use": {
        "web_search_requests": 0,
        "web_fetch_requests": 0
      },
      "service_tier": "standard",
      "cache_creation": {
        "ephemeral_1h_input_tokens": 0,
        "ephemeral_5m_input_tokens": 0
      },
      "inference_geo": "",
      "iterations": [],
      "speed": "standard"
    }
  },
  "type": "assistant",
  "uuid": "15a28bf4-7305-40b4-97a5-4ba9009c10f7",
  "timestamp": "2026-03-24T16:41:36.805Z",
  "userType": "external",
  "entrypoint": "sdk-cli",
  "cwd": "/workspace/task",
  "sessionId": "cb3e8253-25cb-40af-a81f-ba30ca4ef743",
  "version": "2.1.81",
  "gitBranch": "HEAD",
  "slug": "piped-riding-pillow"
}

That json message has "msg": "final request", but claude process does not exit.

What Should Happen?

Claude should have died in the end, but it didn't.

Error Messages/Logs

Steps to Reproduce

no idea... probably due to subagents preventing it to exit

Claude Model

Other

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.81 (Claude Code)

Platform

Other

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗