Remote script. A goal loop runs commands in your project folder on its own, so set your approval level and rules before you start it, and avoid Full access for unattended loops.
Who it is forA developer with a project that has a test suite, who wants a coding agent to finish a fix without typing keep going after every turn.
The problemA coding agent usually stops after one turn, so you have to keep prompting it until the tests pass.
The outcomeThe agent keeps working turn after turn and counts the task as done only when the check passes, with a chip above the composer showing the current turn.
What you need first
- The Bloks desktop app installed on your machine
- At least one provider you can use: a Claude Code, Codex or Gemini CLI you already signed in to, or an API key for a chat engine
- A project folder or files the agent is allowed to work in
- For the iPhone steps: the Bloks iPhone app and a six digit pairing code from your Mac
Steps
- Open the agent's conversation in Bloks and pick the project folder it works in.
- Type /goal in the message box and describe what done looks like, for example: all tests in the project pass.
- Add the check to the goal: pnpm test
- Watch the turn chip above the composer; use Pause if you want to stop the loop.
- When the goal ends, review the change card under the last reply and use the undo button if the result is wrong.
Prompt for your agent
Using the Bloks repo at hamedgitty/bloks, start a /goal in the agent conversation for the project at <project-folder>, with the check pnpm test. Expected output: the goal reports done, stuck or out of turns, and the test run result. Verify that pnpm test passes in <project-folder> before you call the goal done.
Caveat. The README does not say how many turns a goal allows beyond stopping when done, stuck or out of turns, so check the goal status on screen rather than assuming a fixed limit.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for hamedgitty/bloks and "Keep a coding agent working until tests pass"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer