Rerooting
reroot lets an agent move work into the correct project directory without asking the user to manually restart the session.
Start Codex through agentctl:
agentctl codex run --yolo
Or start Claude Code through agentctl:
agentctl claude run
From inside that wrapped session, run:
agentctl reroot /absolute/project/path "Implement the requested change here."
The wrapper exits the current child process and starts a new one in the target directory with the supplied prompt.
Requirements
- The target path must be an existing directory.
- The prompt must be non-empty.
- The session must have been started with
agentctl codex runoragentctl claude run.
Short alias
After agentctl setup, agents can use:
reroot /absolute/project/path "Implement the requested change here."
The alias is convenient for agent instructions, but documentation and scripts should prefer the full agentctl reroot form.