RAP Servers
Infinity Code uses RAP (Reactive Agent Protocol) servers to provide tools to the agent. These are installed via infinity rap install and registered in your ~/.infinity/rap.json.
Sandbox
The core sandbox server that powers all the coding tools: clone_repo, execute_command, read_file, edit_file, create_file, grep, squash_sandbox, describe_overall_changes, and open_sandbox_direct. It handles Jujutsu workspaces and git worktrees, so each agent thread gets its own sandboxed copy of the repo with restricted filesystem writes.
This is installed during the quickstart setup.
infinity rap install --user --crate sandbox-local
A few behaviors worth knowing:
- Streaming output:
execute_commandstreams the output of long-running commands back to the agent as subscription events, so the agent can react to logs while the command is still running, and commands can be cancelled mid-flight. - Permission approvals: the sandbox restricts writes to the sandbox workspace. When the agent requests extra permissions (
write-origto write to your original repo directory, e.g. forgit push, orwrite:/some/pathfor a specific path), you get an approve/deny prompt in the TUI or web UI before anything runs. - Direct mode:
open_sandbox_directoperates on the original directory without a worktree, for repos where sandboxing is not possible (e.g. no commits yet). In this mode every file edit requires your approval.
Steering
Discovers and loads project steering files so the agent can follow your project's conventions automatically. Scans for:
INFINITY.md,CLAUDE.md,AGENTS.md,CONVENTIONS.md.kiro/steering/,.cursor/rules/,.ai/rules/,.claude/skills/.cursorrules,.windsurfrules,.claude/settings.json.github/copilot-instructions.md
Provides two tools: list_steering (find all steering files in the project) and load_steering (read a specific file's content).
infinity rap install --user --crate rap-steering-server
GitHub Event Poller
Subscribes to GitHub repository events via polling, so no webhooks or public endpoints are required. Provides the subscribe_github_events tool with filters for event type, action, actor, branch, PR number, issue number, and commit SHA.
Events are delivered as subscription events that wake the agent automatically. Useful for building agents that react to PRs, pushes, and issues in real time.
Set GITHUB_TOKEN in the daemon's environment; without it, GitHub's unauthenticated rate limit (60 requests/hour) makes polling impractical.
infinity rap install --user --crate rap-github-event-poller
Agent Mail
Lets agents message agents in other Infinity daemons, such as one on a remote dev server: open_inbox, list_agents, send_message, ask_agent (waits for the answer) and reply. It must run once per daemon, so install it with --daemon-lifetime, on every participating host. See Agent Mail.
infinity rap install --user --daemon-lifetime --git https://github.com/hydro-project/infinity --crate rap-agent-mail
Connecting a Running RAP Server
infinity rap install registers a command that the daemon spawns and manages. If you already have a RAP toolset server running somewhere (it serves /.well-known/rap-toolset), you can point the daemon at it directly by adding a toolset_server entry to your user-level (~/.infinity/rap.json) or project-level (.infinity/rap.json) config:
{
"tool_sets": [
{
"type": "toolset_server",
"server_url": "http://127.0.0.1:3001"
}
]
}
Installed servers appear in the same file as toolset_command entries, which spawn the server binary on demand and read its port from stdout. MCP servers use the mcp_server and http_mcp_server entry types in the same tool_sets array.
Server Lifetime
By default a toolset_command server runs per session: each session spawns its own process in <cwd>/.infinity, and the process stops whenever the session goes idle. A server that must keep receiving events while every session is idle can instead declare "lifetime": "daemon" (which infinity rap install --daemon-lifetime writes):
{
"type": "toolset_command",
"command": "rap-agent-mail",
"id": "rap-agent-mail",
"lifetime": "daemon"
}
A daemon-lifetime server is one process shared by every session. The daemon starts it at startup (for entries in ~/.infinity/rap.json), restarts it if it exits, and stops it only when the daemon exits. It runs in ~/.infinity with RAP_SERVER_LIFETIME=daemon and RAP_CALLBACK_URL (the daemon's current callback URL, which changes on every daemon restart) in its environment. Its stdin reaches end-of-file when the daemon exits, even by crashing, and the server should exit then. When a session is stopped, archived, or migrated away, the daemon sends the server /close_thread for the session's root thread.