Coding Loop

The loop is an agnostic coding cycle: free-text task, pinned inputs, exit conditions, and post-PASS actions.

Profiles

Editable config lives in the project:

<cwd>/.memgrep/ (loop.json, input/exit/action manifests, and AGENTS.md)

The global template stays at ~/.memgrep/loop.base/. A thin named pointer is stored at ~/.memgrep/loops/<name>/project.json so loop use / active profile still work.

memgrep loop init launchpad --cwd ~/dev/project
memgrep loop use launchpad
memgrep loop status

Open <repo>/.memgrep/ in your IDE to edit defaults. Commit that folder if the team should share exits/actions.

AGENTS.md is the agent guide for how to add inputs, exits, and actions (CLI + MCP), artifact kinds, and required LOOP_* trailers. It is seeded from loop.base on init and planted again on resolve if missing (custom edits are kept).

Run

memgrep loop run --task "Ship the portal" --profile launchpad
# or via MCP: loop_run with optional profile

loop_run starts in the background. Telegram notifies on completion. Inspect with memgrep loop runs.

Upserts

memgrep loop input set --id outputDir --kind text --value examples/app --profile launchpad
memgrep loop exit set --id tests --kind text --value "All tests pass" --profile launchpad
memgrep loop action set --id github_pr --kind builtin --value github_pr --profile launchpad

Active profile: ~/.memgrep/loop.active or MEMGREP_LOOP_PROFILE.