AgentRail integrates with Claude Code in two modes: a managed local runner whereDocumentation Index
Fetch the complete documentation index at: https://agentrail.app/docs/llms.txt
Use this file to discover all available pages before exploring further.
agentrail server start wakes Claude Code automatically whenever there is actionable work, and a manual debug mode where you trigger a single run yourself. In both modes, Claude Code edits code in the target repository while AgentRail owns task assignment, CI observation, review tracking, PR creation, and lifecycle state.
Managed mode
In managed mode you never launch Claude Code directly.agentrail server start reads managed agent env files from ~/.agentrail/agents/, starts an event-driven agentrail agent run loop for each configured local agent, and restarts those loops when they exit.
Initialize AgentRail
Run the interactive setup to create local config and your first agent profile.If you are running in a non-interactive shell, provide explicit defaults:
Create an agent profile
If The wizard creates scoped agent credentials, writes the managed agent env file, and configures starter routing for your repo.
agentrail init did not already create an agent, run:Start the server
Keep this running in a dedicated terminal. The server brings up the local API, starts provider delivery, and wakes configured agents automatically.Expected output includes:
You do not need to run
agentrail agent run yourself in managed mode. Reserve it for manual debugging or one-off validation.Manual debug mode
Use this when you want to trigger a single Claude Code run outside the server supervisor — for example, to test a new agent configuration or reproduce a specific task.Environment variables
AgentRail injects the following variables into the managed runner environment. Claude Code can read these at runtime — it should not attempt to discover them through other means.| Variable | Description |
|---|---|
AGENTRAIL_RUN_REPORT_PATH | Path to the local report file AgentRail reads after the child process exits. |
AGENTRAIL_HANDOFF_PATH | Path to the structured handoff file Claude should write before reporting completion. |
AGENTRAIL_RUN_CONTEXT_PATH | Path to the current run context snapshot. |
AGENTRAIL_TASK_ID | The task ID AgentRail already selected before starting Claude. |
AGENTRAIL_TASK_IDENTIFIER | The human-readable task identifier (for example, ENG-123). |
Run-scoped commands
Claude Code running as a managed child process should use only these run-scoped commands. They are scoped to the current run and do not expose task lists or provider credentials.Reporting completion
When Claude finishes its work, it must write the handoff file and report back to AgentRail before exiting.--status completed with a handoff file when work is done. Use --status progress for intermediate updates during long-running tasks.
What AgentRail owns
Claude Code edits files and reports back. Everything else belongs to AgentRail:- Task assignment and lifecycle state
- CI and review observation
- Provider PR creation, shipping, and rollback
- Relaunching Claude only when CI or review feedback requires further code changes
.png?fit=max&auto=format&n=TNCV8lxzL1ij3U4N&q=85&s=7345b71aa1c450c74f35b67c2655fc43)