Your agents live in harnsy. Your programs live elsewhere: a ticket bot, a video renderer, a build script. H2A is the public contract that lets such a program talk to a project’s agents in plain text, over one WebSocket, without a terminal and without Claude Code on its side. The contract is short enough to read in one sitting.
Since harnsy 0.11.0 · harnsy Max
What it is, in one picture
Your service → one WebSocket to your harnsy (through access from outside, with your own domain or a relay of your own) → harnsy on your computer → the lead or a role → the answer back in the same conversation.
Your service holds one WebSocket to your harnsy, at wss://<your address>/h2a/v1. harnsy hands each message to a post in a project: the project’s lead, or one role. The agent that holds the post reads it and answers. The answer comes back to your service on the same WebSocket, in the same conversation.
What happens, step by step
Connect. You make a pass in harnsy (below). Your service opens the WebSocket and sends a hello frame with the token. harnsy answers welcome: the project, and the posts the service may write to.
Write. The service sends a message with text to one of those posts. harnsy answers accepted with a conversation id: the message is taken and handed to the post.
Answer. The agent reads your text, marked as coming from outside, and replies. The reply arrives on your WebSocket as a message with a number (seq) and the conversation id.
Confirm. The service sends an ack up to the last number it received. harnsy then removes those replies and erases their text.
Carry on. More messages into the same conversation, as many as the day allows. The agent on the post can change; the conversation stays.
Resume. If the connection drops, the service reconnects, says where it stopped (resume_after), and gets what it missed, in order.
The pass: what you control
Settings › Services: a pass names the project, the service and the posts it may write to. The token is shown once. Revoke, pause and the journal are in the same window. The service’s text reaches the agent marked as data from outside, not as an order.
In harnsy, Settings › Services, “Add service”: you pick the project, name the service and tick the posts it may write to. The token is shown once; harnsy keeps only a hash. From the same window you can pause the service, make a new token (the old one stops), read the journal, revoke or delete it.
One conversation over time
A conversation over time: the agent on the post can change, the conversation stays; a dropped connection resumes from the last number; replies wait 24 hours; after 6 replies in a row without a message from the service it pauses until the service writes again or the person presses “Continue”.
A conversation has a number and lives 30 days from its last message. While it lives:
A change of agent keeps it. If the holder of the role changes (a handover), the next message goes to the new holder, who answers in the same conversation.
A dropped connection resumes. Replies wait for your service for 24 hours. Reconnect with resume_after and they come, in order.
A loop stops itself. After 6 agent replies in a row without a message from your service, the conversation pauses. Your next message, or the person’s “Continue”, resumes it.
What the agent sees
Your text, marked as coming from outside under the name you gave the service, with the conversation and how to reply. By design, a reply never carries the agent’s name, session or machine.
Scenarios
Examples, not promises.
Your own support bot hands a ticket to the lead, and the lead’s answer comes back to the ticket.
A video renderer or a CI job says “done” or “failed” and gets an instruction in reply.
An internal service gives agents a text task and collects the result.
Any program of yours talks to the agent team with nothing but a WebSocket.
What you need
harnsy Max, and access from outside turned on for your harnsy (your own domain, or a relay of your own).
Limits
Text up to 16 KB; 100 messages a day per service; replies wait 24 hours for a connection; a conversation pauses after 6 agent replies in a row without a message from the service. The full table is in the contract.
What it is not
A way for an outside program to run your team. A service writes and reads messages; it does not list, wake or create anything in harnsy.
Python example: a short program, in section 8 of the contract page: connect, sign in, send a task, print the reply, acknowledge it, reconnect from the last number.
Your own client: the contract is public; any language that speaks WebSocket and JSON can follow it.
Docs footer line goes under the page.
Anthropic, Claude Code, OpenAI, ChatGPT, Codex, OpenCode, Telegram, Discord, GitHub, Apple, macOS, iOS, iPhone, Safari, Google, Android, Chrome, Microsoft, Windows, Windows Security, Defender and QR Code are names of their owners’ products. harnsy is not affiliated with or endorsed by them. iOS is a trademark of Cisco used under licence by Apple; QR Code is a registered trademark of DENSO WAVE INCORPORATED. No logos. Python and Go are names of their owners’ products. Python is a trademark of the Python Software Foundation. Go is a trademark of Google LLC.