target
Syntax
target: <dir>
What it does
target: names the working directory the runner operates in โ the root it plans, edits, and runs its done when command from. It's a config-tier line: it sits at the top of the file, before any loop or pipeline, and applies to every definition below it.
Why reach for it? Most of the time you run a .loop from the repo root and the target is implicit. You set target: when the loop shouldn't operate on the whole checkout โ a monorepo where the work lives in one package, a scheduled or unattended run that has no interactive cwd to inherit, or a method (like BMAD) whose stages should scope to a subtree instead of the entire tree. Pointing the runner at the smallest directory that still contains the work keeps its context tight and stops it from wandering into unrelated code.
target: is about where the runner stands, which is coarse; look at: is about which files it reads, which is fine-grained. They compose: target picks the subtree, look at: narrows the agent's attention within it. Quote paths exactly โ a relative path resolves against the loop file's own location.
Example
use the BMAD method
target: ./srcscope a method to a subtree
Example โ target with a schedule
schedule: every weekday at 7am
runner: claude code
target: ./services/billing
loop "keep billing deps current":
goal: no known-vulnerable dependencies in the billing service
done when "pnpm audit --audit-level=high" finds nothing
after 4 tries: stop and warn "needs a human"an unattended run scoped to one service
Common mistakes
- Putting
target:inside a loop body. It's a config-tier line โ it belongs at the top of the file, above the first definition. Nested under aloopit's out of place. - Confusing it with
look at:.target:sets the runner's directory;look at:lists the files the agent reads. Scoping the subtree does not replace pointing the agent at the right files. - A
done whencommand that assumes the repo root. The predicate runs from the target directory. If your command's paths were written for the repo root, they'll miss once the runner is scoped to a subtree โ write them relative to the target. - Relying on it interactively when the cwd already fits. Running from the repo root,
target:is redundant. Its real value is unattended and scheduled runs, or a monorepo subtree โ don't add it just to restate where you already are.