Dev.to AI πŸ€– Ai πŸ‘ 0 πŸ“– 4 min read

HUDDLE: the corner window that shows which Claude Code agent is waiting on you

You ask Claude Code to fix a bug and jump into a meeting. You come back and nothing is done. It asked you one question, "can I run this?", and sat there waiting for you. Clicking through every tab is the slow way to cat

You ask Claude Code to fix a bug and jump into a meeting. You come back and nothing is done. It asked you one question, "can I run this?", and sat there waiting for you.

Clicking through every tab is the slow way to catch that. So I built a faster one: the huddle, a small window in the corner of my screen with a card for every Claude Code session. The code is free and open source: github.com/suren19113/agent-huddle (MIT).

This page walks through the setup step by step.

Why not agent view?

Claude Code has its own agent view, claude agents. It has 2 gaps:

  • it only lists background sessions, so interactive sessions in other terminals don't show up
  • it can't answer a permission prompt; to do that you attach to the session

I wanted every session in one place, and approvals in 1 click.

What it shows

Every Claude Code session gets a card, and each card says what it's doing:

  • working: still on the job
  • needs you: the card turns lime
  • done: ready for you to review

When a session asks for permission, you click Allow or Deny on its card, and the answer goes straight back to Claude.

How it knows

Claude Code fires a hook at each step of a session: when it starts (SessionStart), when it's about to use a tool (PreToolUse), when it needs a permission decision (PermissionRequest), when it finishes (Stop), and a few more. Every event carries the session's session_id and cwd, and that is how each session gets its own card.

I pointed all of them at the huddle. An HTTP hook POSTs the event as JSON to a local server; the window reads from that server.

Step 1: install

You need:

  • Node.js 18 or later
  • Claude Code
  • curl (macOS and most Linux systems have it)

There are no dependencies to install. You can run it straight from GitHub with npx, or clone it:

git clone https://github.com/suren19113/agent-huddle.git
cd agent-huddle

Step 2: start the huddle

npx github:suren19113/agent-huddle

or, from the clone:

npm start

It starts a local server on http://localhost:4777 and opens the window in the top-right corner of your screen (Chrome, Edge or Brave in app mode if you have one, your default browser otherwise). --port changes the port and --no-open skips the window.

Step 3: point Claude Code at it (once)

Print the hooks block:

npx github:suren19113/agent-huddle hooks

Merge it into the "hooks" key of ~/.claude/settings.json, the settings file in your home folder. That file applies to every project, so every session on your machine reports to the same huddle. (To try it on one repo first, put it in that project's .claude/settings.json instead.)

This is the full block:

{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "curl -s -m 2 -H 'content-type: application/json' --data-binary @- http://localhost:4777/hook >/dev/null 2>&1 || true",
            "timeout": 5
          }
        ]
      }
    ],
    "UserPromptSubmit": [
      {
        "hooks": [
          {
            "type": "http",
            "url": "http://localhost:4777/hook",
            "timeout": 5
          }
        ]
      }
    ],
    "PreToolUse": [
      {
        "hooks": [
          {
            "type": "http",
            "url": "http://localhost:4777/hook",
            "timeout": 5
          }
        ]
      }
    ],
    "PostToolUse": [
      {
        "hooks": [
          {
            "type": "http",
            "url": "http://localhost:4777/hook",
            "timeout": 5
          }
        ]
      }
    ],
    "PostToolUseFailure": [
      {
        "hooks": [
          {
            "type": "http",
            "url": "http://localhost:4777/hook",
            "timeout": 5
          }
        ]
      }
    ],
    "PermissionRequest": [
      {
        "hooks": [
          {
            "type": "http",
            "url": "http://localhost:4777/hook",
            "timeout": 600
          }
        ]
      }
    ],
    "Notification": [
      {
        "hooks": [
          {
            "type": "http",
            "url": "http://localhost:4777/hook",
            "timeout": 5
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "http",
            "url": "http://localhost:4777/hook",
            "timeout": 5
          }
        ]
      }
    ],
    "SessionEnd": [
      {
        "hooks": [
          {
            "type": "http",
            "url": "http://localhost:4777/hook",
            "timeout": 5
          }
        ]
      }
    ]
  }
}

SessionStart only accepts command hooks, so that one pipes the same JSON in with curl. Every other event is an HTTP hook. If the huddle isn't running, the hooks fail quietly and Claude Code carries on as usual.

Step 4: start a session

Start (or restart) a Claude Code session. Its card appears in the corner window as soon as it starts.

How approvals work

Approvals were the hard part. The PermissionRequest hook is an HTTP call that the huddle holds open until you click. Allow sends back:

{ "hookSpecificOutput": { "hookEventName": "PermissionRequest", "decision": { "behavior": "allow" } } }

and Deny sends "behavior": "deny" with a message Claude reads. The session carries on as if you'd answered it yourself.

Where you answer depends on the session:

  • Background sessions (claude --bg) show no prompt of their own, so you approve in the huddle, with no claude attach.
  • A normal terminal session still shows its own permission dialog at the same moment. The first answer wins: click in the huddle and the terminal reads "Allowed by PermissionRequest hook".
  • If you don't click, the huddle gives up after about 10 minutes and hands the question back to the terminal.
  • A hook's allow never overrides a deny rule in your settings.
  • In auto mode, most tool calls never reach a permission prompt, so you'll see fewer cards turn lime.

Safety

The server listens on 127.0.0.1 only, rejects requests addressed to any other host name, and only takes a decision from the page it served (a per-run token). A web page you visit can't click Allow for you.

Credits

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.