protocol-change
Skill4 starsChanged 17 days agoMITView on GitHub
Add or change a message or a field exchanged between the agent, the relay and the macOS app (shared/protocol.ts and its Swift mirror). Use for any change to what travels over the WebSocket or the hook endpoint, including new sealed payloads.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- J3vb/OwnCordtheir own version, first seen Oct 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- J3vb/OwnCord★ 11same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- check-swiftui-viewSkill
- local-stackSkill
- releaseSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Only ids, states, booleans, versions and sizes the relay needs for routing or limits may stay in clear.
- Very specific: line 53
Keep shared/ free of Node and Bun APIs: tsc -p shared fails otherwise.
- Distinctive: line 57
Write down, in the PR, what happens for each:
- Distinctive: line 65
If one of them breaks, either make it degrade gracefully (a missing field shows nothing, an action is greyed out) or add a Rollout section …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Changing the wire protocol
A message crosses three codebases in two languages, and the three never update at the same time. Go through every step, even when a change looks local to one side.
1. Decide what the relay may see
- Anything about what Claude is doing (text, names, paths, tool calls, errors from the machine) is sealed: a
plaintext interface in
shared/protocol.ts(under "Plaintext payloads, sealed before leaving the machine"), sent as aSealedstring. Its Swift twin goes at the bottom ofapp/Sources/TontonCore/Wire.swift. - Only ids, states, booleans, versions and sizes the relay needs for routing or limits may stay in clear.
2. Edit the protocol
shared/protocol.ts: the message unions areAgentMessage(agent → relay),RelayToAgent,HookPost(POST /api/hook),RelayToAppandAppMessage(app → relay).- New fields are optional. Never rename, retype or reuse a field: older agents, apps and relays are still out there.
3. Relay
relay/src/sockets.tsdispatches socket messages,relay/src/routes.tsHTTP requests. Check every field with the helpers inrelay/src/validate.ts(isSealed,isText…) before using it, and drop the message when a check fails.- Anything kept in memory or in SQLite needs a cap in
relay/src/limits.ts. Live session state is inrelay/src/sessions.ts; schema changes are a new entry at the end ofMIGRATIONSinrelay/src/registry.ts. - Unknown message types are already ignored: keep it that way.
4. Agent
- Socket messages go through
agent/src/channel/relay-connection.tsand are built inagent/src/channel/(the session conversation is inconversation.ts); hook posts are inagent/src/hook.ts. - Seal with
seal()fromshared/crypto.ts, open withopen().
5. App
- Decode in
app/Sources/TontonCore/Wire.swift:decodeIfPresentfor new fields, and a newcasein theswitchfor a new message type (thedefaultmaps unknown types to.unknown, which is what an older app does with yours). - Handle it in
app/Sources/TontonClaude/Data/SessionStore.swift; messages to the relay are thesocket.send([...])dictionaries there. - Open sealed fields with
E2EinTontonCore.
6. Client core
The web app and the other clients read the relay through shared/, which mirrors the app:
shared/wire.tschecks each relay → app message, likeWire.swift: a new message type or field goes there too.shared/payloads.tschecks a sealed payload once opened, like the Codable types;shared/vault.tsopens them into the models ofshared/session.ts, likeSessionVault.swift.- Keep
shared/free of Node and Bun APIs:tsc -p sharedfails otherwise.
7. Check every mix of versions
Write down, in the PR, what happens for each:
| Relay | Agent | App |
| old | new | new |
| new | old | new |
| new | new | old |
If one of them breaks, either make it degrade gracefully (a missing field shows nothing, an action is greyed out) or add a Rollout section saying which part must be updated first.
8. Test both languages
test/end-to-end.test.tsruns a real relay and agent with a socket standing in for the app: add a case that goes through the new message.relay/test/for validation and limits,agent/test/for agent logic.app/Tests/TontonCoreTests/: decode a JSON sample written exactly as the relay sends it. For a new sealed payload, open a blob sealed byshared/crypto.ts, likeagentBlobinE2ETests.swift. If the app seals or reads it, add it toVectorTests.swiftand writeshared/test/swift-vectors.jsonagain (TONTON_WRITE_VECTORS=1 swift test --filter VectorTests):shared/test/swift-vectors.test.tschecks the client core reads it the same way.- Then
bun run check && bun test, and inapp/:swift format lint --strict --configuration .swift-format --recursive Sources Tests ../agent/tray/macos && swift test.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

