Thread Debugging Tools

June 18, 2026 ยท View on GitHub

Tools for managing and debugging multi-threaded SBCL applications.

Tools Overview

ToolPurposeApproval Required
thread_listList all threadsNo
thread_inspectInspect thread stateNo
thread_debugAttach debuggerYes (:modify-restarts)
thread_interruptSend interruptYes (:terminate-thread)
thread_killTerminate threadYes (:terminate-thread)
thread_createCreate new threadYes (:modify-running-code)
thread_dump_allGet all thread stacksNo

thread_list

Overview

List all threads with their status.

Tool Definition

{
  "name": "thread_list",
  "description": "List all threads with status"
}

Return Value

{
  "threads": [
    {
      "id": "T1-12345",
      "name": "worker-1",
      "state": ":running",
      "priority": 0
    },
    {
      "id": "T1-12346",
      "name": "repl",
      "state": ":waiting",
      "priority": 0
    }
  ]
}

thread_kill

Overview

Terminate a thread. Use with caution.

Tool Definition

{
  "name": "thread_kill",
  "description": "Terminate thread",
  "parameters": {
    "type": "object",
    "properties": {
      "thread_id": {
        "type": "string",
        "description": "Thread ID to terminate"
      }
    },
    "required": ["thread_id"]
  }
}

Approval Required

Requires :terminate-thread approval.

User Prompt

AI agent wants to terminate thread "worker-2":
Reason: Thread stuck in infinite loop

Allow? [Yes/No] Timeout: 30s

See Also

  • @prompts/debugging-workflows.md - Thread debugging scenarios