agentafk
Surfaces

Interactive REPL

afk i launches a full-featured interactive REPL with slash commands, plan mode, background tasks, and streaming output.

The interactive REPL is Agent AFK's primary surface. Launch it with:

afk i
# or
afk interactive
# or just
afk          # interactive is the default command

The REPL gives you a persistent session with full tool access — bash, file ops, web fetch, subagents, MCP servers, memory — plus slash commands for built-in and plugin skills.

Common options

afk i --model opus           # pick a model
afk i --max-turns 200        # raise the turn limit (default 100)
afk i --resume <id>          # resume a saved session
afk i --continue             # continue the most recent session in cwd
afk i -w                     # create a git worktree for isolation
afk i -w my-feature          # worktree on a named branch
afk i --mcp-config ./mcp.json  # load an additional MCP config

Slash commands

Type / in the REPL to see available commands. Typos are caught automatically — type /mnt and AFK suggests /mint.

Session control

CommandDescription
/helpList all available slash commands
/exit, /quitLeave the REPL
/clearClear the screen
/resetStart a fresh session, discarding history
/compactManually compact conversation history
/saveSnapshot session state to disk
/resumeResume a saved session

Information

CommandDescription
/costRunning cost for the session
/tokensContext usage breakdown (total, categories, MCP tools, agents, skills)
/historyPrint prior turns
/modelShow or switch the active model
/toolsList registered tools
/mcpShow MCP server status
/limitsShow rate-limit and budget state
/debugToggle verbose debug output

Planning and state

CommandDescription
/planOpen the plan editor
/todoManage the persistent todo list
/initScan the current project and generate an AFK.md
/changelogRender CHANGELOG.md paginated

Background tasks

Press Ctrl+B to detach the current turn into a tracked background task. The status bar at the bottom of the REPL shows running task counts.

CommandDescription
/bgList backgrounded tasks
/tasksShow running/queued tasks with status
/attach <id>Re-attach to a backgrounded task

Built-in skills

CommandDescription
/mint <idea>End-to-end feature pipeline: spec → build → verify → ship
/diagnose <bug>Parallel root-cause analysis for bugs and failing tests

Maintainer-loop skills (/forge, /audit-fit) are hidden by default. Set AFK_INTERNAL=1 to surface them.

Plugins and discovery

CommandDescription
/skillsDiscover skills loaded from plugins and user scope
/agentsList subagents loaded by the SDK
/reload-pluginsRe-scan plugin and user directories after edits

Plan mode

/plan opens an in-REPL plan editor. You can write a multi-step plan, iterate on it, and then let the agent execute it. Plan state is saved to ~/.afk/state/ and survives session restarts.

Streaming output

The REPL streams model output token-by-token with markdown rendering. Tool calls render as collapsible lane entries showing the tool name, arguments, and result. Extended thinking renders as a summary lane (or live, depending on --thinking-ui).

Worktree isolation

-w / --worktree creates a git worktree for the session. Every bash command and file operation the agent runs lands in the isolated worktree, not your main working tree. On a clean exit (no uncommitted changes), the worktree and branch are removed automatically. On a dirty exit, the worktree is preserved so you can review or commit the changes.

afk i -w                     # auto-named worktree
afk i -w my-feature          # named branch
afk i -w --worktree-base HEAD  # base on local checkout instead of origin/main

Shell passthrough

Prefix a line with ! to run it directly in your shell without sending it to the model:

> !ls -la
> !git status

Disable with --no-shell-passthrough or AFK_SHELL_PASSTHROUGH=0.

Session persistence

Sessions are saved to ~/.afk/state/sessions/. Resume from the REPL with /resume, or at startup:

afk i --resume <session-id>
afk i --continue              # most recent session in cwd