Separate Human Planning from AFK Implementation
Core Idea
The workflow has a deliberate handoff point. Alignment, research, prototyping, destination definition, and issue decomposition remain human-reviewed. Once a clear backlog of bounded AFK tasks exists, implementation can move to an autonomous loop. This creates a "day shift" for human judgment and a "night shift" for repeatable agent execution.
How It Works
A minimal implementation runner performs one iteration of the loop. It collects the information the coding agent needs and starts a fresh session. The demonstrated runner supplies:
- The local issue files from the backlog.
- A small amount of recent commit history.
- A focused implementation prompt.
- Repository access under a controlled permission mode.
The prompt tells the agent to work only on AFK issues. It also defines a stop signal to emit when no eligible tasks remain. Within a single iteration, the agent:
- Reads the backlog.
- Selects the next valid task according to the stated priorities and blockers.
- Explores the relevant repository area.
- Implements the task using test-driven development.
- Runs the required feedback loops.
- Creates a commit.
- Reports what was completed.
The one-iteration script is important because it exposes the agent's behavior. Before running an unattended loop, execute the single iteration repeatedly and inspect task selection, exploration, edits, tests, and summaries. Adjust the prompt when the agent chooses the wrong work, skips a feedback loop, or interprets issue metadata incorrectly.
The AFK version repeats the same fresh-session pattern. Each iteration starts from external state rather than accumulated conversation. Issues, code, tests, and commits carry the project forward. The agent does not need a single long context containing the full history.
The autonomous version also runs inside an isolated environment. The unattended version uses a sandboxed environment, while a branch or worktree preserves the resulting changes for later review and merge.
Why It Matters
Autonomy is safest after the uncertain decisions have been converted into bounded work. Sending an agent away with only a vague idea creates uncontrolled interpretation. Sending it away with a dependency-aware backlog, a task-selection rule, a test discipline, and a stop condition creates a constrained execution system.
The fresh-session loop also aligns with context management. Each issue can be completed in the smart zone, committed, and followed by a clean restart. The backlog provides continuity without relying on compaction.
Practical Application
Build the AFK workflow in stages:
- Maintain backlog items as local markdown files or work-tracking issues with clear scope
and dependencies.
- Write a runner that injects the backlog and a concise implementation prompt into a new
coding-agent session.
- Define how the agent identifies eligible work and what it outputs when no work remains.
- Require repository exploration before editing.
- Require TDD and named feedback loops.
- Require a commit and completion summary for each successful task.
- Run the process once with a human watching.
- Tune the prompt until one iteration behaves predictably.
- Only then place it inside an unattended loop and sandbox it.
Task prioritization can be explicit. A queue may prefer critical bug fixes, development infrastructure, tracer-bullet issues, polishing work, quick wins, and refactors in a defined order. The exact priority is less important than making the selection rule visible and controllable.
Trade-Offs and Limitations
Implementation is not the end of the workflow. Autonomous coding increases the amount of output that must be reviewed and manually tested. It can move the bottleneck from writing code to validating code.
Long loops also conflict with the desire for small, self-contained pull requests. One loop that completes many issues can create a large review burden. The process may need shorter loops, smaller tasks, or separate branches to preserve reviewability.
Sandboxing and permission design reduce risk but do not establish correctness. The agent can still implement the wrong behavior or create changes that pass automated checks while failing in real use.
Key Takeaway
Do not automate ambiguity. Automate a curated backlog. Validate one iteration under human observation, then run the same bounded, fresh-context implementation cycle unattended inside an isolated environment.