termpair
CLAUDE.md1.8k starsChanged 4 years agoMITView on GitHub
ALWAYS work on a git worktree and branch. NEVER modify files directly on main. main must always remain clean. Every piece of work — features, bug fixes, docs, even CLAUDE.md edits — must happen on a dedicated branch in a worktree: Agents can work autonomously end-to-end: create worktrees, make changes, push branches, create PRs, monitor CI, and merge when green. You have push access to feature branches and merge access to PRs. Every PR must be seen through to completion…
- Commits and pushes
We split this CLAUDE.md into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 20
Create a worktree and branch
- Very specific: line 25
When ALL CI checks are green: gh pr merge <number> --squash --delete-branch — merge to main
- Distinctive: line 32
Never push to main directly: Always go through PRs.
- Very specific: line 60
All commands run from termpair-rs/.
≈ “Common” is an estimate: at least 1 in 5 of the 25,680 CLAUDE.md 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
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Worktree Rule
ALWAYS work on a git worktree and branch. NEVER modify files directly on main. main must always remain clean. Every piece of work — features, bug fixes, docs, even CLAUDE.md edits — must happen on a dedicated branch in a worktree:
git worktree add .worktrees/<name> -b <branch-name>
cd .worktrees/<name>
# do work, commit, then open a PRAutonomous PR Workflow
Agents can work autonomously end-to-end: create worktrees, make changes, push branches, create PRs, monitor CI, and merge when green. You have push access to feature branches and merge access to PRs.
- Create a worktree and branch
- Make changes, run
cargo test && cargo fmt --check && cargo clippyintermpair-rs/, commit git push origin <branch>— push to remotegh pr create— open a PRgh pr checks <number>— monitor CI. NEVER merge before all checks pass.- When ALL CI checks are green:
gh pr merge <number> --squash --delete-branch— merge to main - Clean up: return to repo root and
git worktree remove .worktrees/<name> - Pull main and continue with next task
Every PR must be seen through to completion — don't just open and walk away. Monitor CI, fix failures, merge when green, delete the remote branch, and remove the local worktree.
Never push to main directly. Always go through PRs.
What is TermPair
End-to-end encrypted terminal sharing. A Unix terminal is shared in real-time to web browsers via a server that acts as a blind relay (zero-knowledge — server never sees plaintext). AES-128-GCM encryption with key delivered via URL hash fragment (never sent to server).
Architecture
Three components:
- Server — routes encrypted WebSocket messages between terminal clients and browsers. Never decrypts.
- Terminal client (
termpair share) — forks a PTY, encrypts output with AES-GCM, sends via WebSocket. Decrypts browser input and writes to PTY. - Frontend — connects via WebSocket, decrypts terminal output for display, encrypts user input before sending.
Encryption flow: Three AES keys (bootstrap, unix_output, browser_input). Bootstrap key exchanged via URL hash. IVs are monotonic counters with per-browser windowing (2^20 messages per window). Key rotation after 2^20 messages.
Protocol: WebSocket subprotocol version "3". Messages are JSON {event, payload}. Key events: new_output, command, resize, num_clients, aes_keys, aes_key_rotation, new_browser_connected, start_broadcast.
Workspace layout (termpair-rs/):
crates/termpair-common/— shared lib: encryption, types, constantscrates/termpair/— client binary (termpair): PTY, AES key management, WebSocket broadcastcrates/termpair-server/— server binary (termpair-server): Axum handlers, session state, embedded frontendfrontend/static/— vanilla JS frontend (embedded into server binary viarust-embed)
Legacy Python implementation (termpair/, tests/) still exists in the repo but is not actively developed.
Build & Development Commands
All commands run from termpair-rs/.
cargo build # build both binaries
cargo build --release # release build
cargo run -p termpair-server -- --port 8000 # run server
cargo run -p termpair -- --host http://localhost:8000 # share a terminal
cargo test # run all tests
cargo fmt --check # check formatting
cargo clippy # lintKey Dependencies
axum, tokio, aes-gcm, nix (PTY), rust-embed (static files), clap, tracing
Releasing
Push a v* tag to trigger .github/workflows/release.yml, which cross-compiles for linux (x86_64, aarch64) and macOS (x86_64, aarch64), then creates a GitHub Release with tarballs and checksums.
git tag v0.5.0
git push origin v0.5.0install.sh at the repo root is a curl-installable script that downloads the latest release binary for the user's platform.
Trending
Quiet this year.thin dataabout the whole repository
Who's talking about cs01/termpair
- A Hacker News story“TermPair: Terminal sharing with AES-GCM 128 bit end-to-end encryption”Hacker News · May 31, 2021 · 118 points
- caprover/one-click-apps“App Suggestion: TermPair”GitHub · Dec 23, 2021
- pypa/pipx“Single source of truth for README.md”GitHub · Feb 7, 2020
The biggest 3 of 3 mentions linking to the repository that our crawl found. Each line is their own headline.
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.

