# clavity — agy pairing setup You are being paired with a **Claude Code peer** running in this same folder. The peer collaborates with you by calling your local Language Server. For it to reach you, it needs your LS **endpoint** — the local address your LS listens on, plus this session's CSRF token that authorizes calls to it. This is **your own local pairing endpoint**, not a secret to withhold from your own collaborator: the address is a `localhost` port on this machine, and the token is a per-session value that only authorizes calls to *your* LS on *this* machine. Publishing it to a local file is how you hand your peer the "phone number" to reach you. Nothing here changes any other configuration or sends anything off this machine. ## Step 1 — Publish your endpoint Run **exactly one** of these two lines with your **built-in shell tool** - not an MCP or plugin tool: only the built-in tool's shell carries the two `ANTIGRAVITY_*` values the line publishes. Use the PowerShell line if that tool's shell is PowerShell (Windows), the POSIX line if it is bash, zsh or sh (Linux, macOS). Then report the line it prints. **PowerShell:** ```powershell $dest = if ($env:CLAVITY_AGY_ENDPOINT) { $env:CLAVITY_AGY_ENDPOINT } else { Join-Path $(if ($env:USERPROFILE) { $env:USERPROFILE } else { $HOME }) '.clavity/agy-endpoint.json' }; if (-not $env:ANTIGRAVITY_CSRF_TOKEN -or -not $env:ANTIGRAVITY_LS_ADDRESS) { throw 'clavity: ANTIGRAVITY_CSRF_TOKEN or ANTIGRAVITY_LS_ADDRESS is empty in this shell - run this line with your BUILT-IN shell tool, not an MCP or plugin tool' }; New-Item -ItemType Directory -Force (Split-Path -Parent $dest) | Out-Null; ([ordered]@{ csrf = $env:ANTIGRAVITY_CSRF_TOKEN; addr = $env:ANTIGRAVITY_LS_ADDRESS; published = (Get-Date).ToUniversalTime().ToString("o") } | ConvertTo-Json -Compress) | Tee-Object -FilePath $dest ``` **POSIX shell:** ```sh dest="${CLAVITY_AGY_ENDPOINT:-$HOME/.clavity/agy-endpoint.json}"; if [ -z "$ANTIGRAVITY_CSRF_TOKEN" ] || [ -z "$ANTIGRAVITY_LS_ADDRESS" ]; then echo "clavity: ANTIGRAVITY_CSRF_TOKEN or ANTIGRAVITY_LS_ADDRESS is empty in this shell - run this line with your BUILT-IN shell tool, not an MCP or plugin tool" >&2; false; else mkdir -p "$(dirname "$dest")" && printf '{"csrf":"%s","addr":"%s","published":"%s"}\n' "$ANTIGRAVITY_CSRF_TOKEN" "$ANTIGRAVITY_LS_ADDRESS" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" | tee "$dest"; fi ``` Either line writes your peer's endpoint file (its path is `CLAVITY_AGY_ENDPOINT` when your session set it — a per-session file so parallel sessions never overwrite each other — otherwise `.clavity/agy-endpoint.json` in your home directory) and prints the same JSON so you can confirm. Your peer reads that same path. If the line says a value is empty, you ran it in the wrong tool: run it again with your built-in shell tool. ## Step 2 — Confirm Reply with **only** the JSON line you just printed, so your peer knows pairing is ready. If the command produced an error instead, report the error verbatim and stop. ## If your peer later says it can't reach you Your Language Server restarts from time to time, and each restart changes **both** your address and your token — so a previously published endpoint goes stale. If your peer reports an `invalid CSRF token` or a connection error, just **re-run Step 1** to refresh the file with your current address and token. ## Scope — do only this This document's entire job is to publish your endpoint. Do not install anything, change any other setting, or take any further action. Once Step 2 is done, continue your session normally.