Repository navigation
Installation
| Antigravity CLI |
agy on your PATH, logged in (agy auth login) |
| Node.js | ≥ 18 for the MCP tools; ≥ 20.12 if you run the Telegram bridge |
| Claude Code or Codex | The host that loads the plugin |
| Docker (optional, recommended) | Needed for the read-only container and confined batches — see Isolation and Security Model |
Inside a session:
/plugin marketplace add KZvilla/lagrange-agent-runtime
/plugin install lagrange@kzvilla-lagrange
or from a terminal with claude plugin marketplace add … / claude plugin install ….
Then restart Claude Code. /reload-plugins picks up commands, agents and skills, but whether it re-registers
the MCP server has changed across Claude Code versions. Restarting is the reliable way to make run and the
other tools appear. Check with:
claude plugin list
claude plugin details lagrange@kzvilla-lagrangeclaude plugin marketplace update kzvilla-lagrange
claude plugin update lagrange@kzvilla-lagrangeRestart the sessions you had open afterwards: a running session keeps the code it started with.
Every release is pinned to the commit of its tag in the marketplace manifest, so you always install exactly
what was tagged — never whatever happens to be on main. Each version installs into its own directory and old
ones are not deleted; that is why anything that stores an absolute path (the bridge daemon, for example) must be
installed from a clone, not from the plugin copy. See ADR-004: The marketplace is the only channel.
codex plugin marketplace add KZvilla/lagrange-agent-runtime --ref <release-tag>
codex plugin add lagrange@kzvilla-lagrange-codexOr from a local clone:
git clone https://github.com/KZvilla/lagrange-agent-runtime.git
codex plugin marketplace add /absolute/path/to/lagrange-agent-runtime
codex plugin add lagrange@kzvilla-lagrange-codexThe local flow was verified with Codex CLI 0.154.0. Skills refer to semantic tool names such as plan and
run; Codex resolves the host-specific MCP namespace. Start a new thread afterwards; Codex gets the skills and
MCP tools while the /lagrange:* slash commands are Claude Code only. State is shared under ~/.claude/ so both
hosts see the same configuration and agent memory.
install.ps1 and install.sh were removed in 0.6.0. If you used them, remove ~/.claude/skills/antigravity
(after saving the .env inside it, if any) — otherwise the plugin loads twice. The scripts only cloned into that
directory, wrote nothing to settings.json and registered no MCP server, so removing it is the whole uninstall.
Two things need care: the .env inside it is git-ignored and exists nowhere else, and on Windows the bridge daemon
may be a scheduled task pointing into the directory you are about to delete.
Linux / macOS:
dir="$HOME/.claude/skills/antigravity"
if [ -d "$dir" ]; then
pkill -f "$dir/telegram-bridge/bot.js" 2>/dev/null
[ -f "$dir/.env" ] && cp "$dir/.env" "$HOME/antigravity.env.bak"
rm -rf "$dir"
echo "Uninstalled. Copy of .env kept at ~/antigravity.env.bak"
else
echo "No script install found."
fiWindows (PowerShell):
$dir = Join-Path $env:USERPROFILE '.claude\skills\antigravity'
if (Test-Path $dir) {
$t = Get-ScheduledTask -TaskName AntigravityTelegramBridge -ErrorAction SilentlyContinue
if ($t -and $t.Actions[0].WorkingDirectory -like "$dir*") {
Stop-ScheduledTask $t.TaskName -ErrorAction SilentlyContinue
Unregister-ScheduledTask $t.TaskName -Confirm:$false
}
if (Test-Path "$dir\.env") { Copy-Item "$dir\.env" (Join-Path $env:USERPROFILE 'antigravity.env.bak') -Force }
Remove-Item -Recurse -Force $dir
Write-Host "Uninstalled. Copy of .env kept at $env:USERPROFILE\antigravity.env.bak"
} else { Write-Host 'No script install found.' }Then restart Claude Code: /reload-plugins drops commands, agents and skills, but MCP tool schemas registered at
session start stay until a restart. A leftover pluginUsage entry in ~/.claude.json is harmless telemetry.
The MCP server is plain JSON-RPC over stdio: it does not depend on Claude Code and reads no CLAUDE_* variable.
Claude registers it through .mcp.json and ${CLAUDE_PLUGIN_ROOT}; Codex uses .codex-plugin/plugin.json and a
relative working directory. Both launch the same mcp-server/index.js.
Any other MCP client can run the server with node and the absolute path to mcp-server/index.js in a clone.
The server has no npm dependencies, so no npm install is needed for it. The Telegram bridge does need one
(npm install --prefix telegram-bridge).
{ "mcpServers": { "lagrange": { "command": "node", "args": ["/abs/path/lagrange-agent-runtime/mcp-server/index.js"] } } }These formats belong to each client and change more often than this page: check them against your client's docs.
This repository ships an .opencode/ directory plus a committed opencode.json, so running opencode inside a
clone gives you close to the Claude Code experience:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"lagrange": {
"type": "local",
"command": ["node", "/abs/path/lagrange-agent-runtime/mcp-server/index.js"],
"environment": { "LAGRANGE_HOST": "opencode" },
"timeout": { "startup": 10000, "catalog": 10000, "execution": 1800000 }
}
}
}
}LAGRANGE_HOST=opencode is a host marker used only by the opencode config: it makes the server fail closed
instead of falling back to a Claude session. Do not add it to a shared MCP config that Claude Code also uses. The
execution timeout is 30 minutes because summaries and audits can outlive the default.
The opencode plugin (id: lagrange) injects the current ses_... into session_summary and narrate, so
both read the opencode session without the model passing an id. It also neutralizes the Claude Code/Codex wording in
the tool descriptions. It runs as a global copy, inside the clone too: its source, .opencode/lagrange-plugin.js,
stays out of .opencode/plugins/ because opencode loads that folder by itself and refuses two plugins with the same
id. Inside the clone, the addon .opencode/plugins/lagrange-addon.js injects the ses_... only while the global copy
is missing (it does not touch descriptions). Without either, pass session_id: "ses_..." manually; without that, the
session tools fail closed instead of reading a Claude session. Do not copy the plugin by hand: run /lagrange:setup opencode (Track H), which uses
node scripts/opencode-setup.mjs. --diagnose is read-only and reports where you stand; --apply --yes copies the
plugin to ~/.config/opencode/plugins/ and merges an entry with an absolute MCP path and the host marker into your
opencode.json. It backs up what it replaces (.backups/, five of each kind), aborts before writing if the config
needs a human and never rewrites an opencode.jsonc (it prints a fragment to paste instead). Run from the clone,
the copy and the MCP path point at the clone; run from the installed plugin, they do not. If the TUI only says
lagrange@Plugin fail, opencode api get "/api/plugin?location[directory]=<clone>" shows each plugin's error. Restart or reload opencode before checking opencode mcp list, and run
the track again after each Lagrange release: the copy and the path stay at the version that ran the script.
The same plugin installs the guards and the damage preview in opencode. The guardas of
~/.claude/antigravity.json are shared with Claude Code and ask before a matching shell command with the
rule's reason (or deny with guardas_efecto: "deny"); if no rule matches, a destructive command is measured and
confirmed when it would follow a link, delete tracked files, lose commits in a forced push, or kill every node.
OpenCode's --auto auto-approves the ask, so use deny for an unattended session where the guard must hold. It
only sees opencode's shell tool, not run or MCP tools. A rule's raiz and the preview's relative paths
are resolved against the session directory, not the shell tool's workdir, so a relative path run from a
different workdir can pass unmeasured. The guards without raiz still apply in any workdir.
-
Slash commands (
/lagrange:*) remain Claude Code-specific. Codex loads the sharedskills/**; opencode is covered by its.opencode/integration; generic clients call the tools directly. -
Config and state stay in
~/.claude/(antigravity.json, usage, the agent registry), even if you never use Claude Code. One directory per client would split the persistent agents' memory. -
session_summaryandnarrateneed a host session source. Claude uses its project logs; Codex uses the trusted session hook and fails closed on missing or ambiguous pointers; opencode (>= 2) usesopencode session exportinside a clone, with the plugin or an explicit id. Generic MCP clients have no adapter, so use their native handoff andsay. -
The fan-out statusline relies on Claude Code's
statusLinecontract (foragy's own status bar with context, quota and pending requests, runnpm run agy:plugin -- --statusline,--statusline-stackor--statusline-off). -
Telegram: the outbound tools work from any client. The bot's
/claudecommand launches Claude Code only. -
fanoutcreates.claude/worktrees/in your repo. Add.claude/to your.gitignore. -
Host-specific names remain only where they are real contracts, notably
~/.claude/state and Claude session/statusline integrations.
/lagrange:setup walks you through each one and never asks for a secret in the chat:
| Track | What it sets up |
|---|---|
voicebox |
Local text-to-speech for narration — see Voice |
telegram |
Notifications, questions and voice notes to your phone — see Telegram Bridge |
daemon |
The bidirectional Telegram bot as a background service — see Telegram Bridge |
cuenta |
A second Claude account for the fallback — see Engines and Fallback |
opencode |
The global opencode plugin and MCP entry (opencode >= 2) — see above |
| node | A machine joined to a server — see Node Network |
Getting started
Operations
- Fan-Out, Watch and Confined Batches
- Sessions and Messages
- Session Summary and Usage
- Telegram Bridge
- Node Network
- Claude Code Mods
Agents and memory
Voice
Architecture
Decisions
- Decisions
- ADR-001: Contain, don't prohibit
- ADR-002: Isolation is verified, not assumed
- ADR-003: agy first, opt-in fallback
- ADR-004: The marketplace is the only channel
Contributing