agentsclimarketplace

Agentic loop

Skill meharajM/agent-loop-mcp/skills/agentic-loop

Persistent-memory Agent Skill and MCP server for resumable autonomous agent loops, context compaction, and self-healing workflows.

Install
npx -y skills add meharajM/agent-loop-mcp --skill agentic-loop

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Run long-lived autonomous agent loops with persistent memory, context-window compaction, self-healing retries, and resumable state. Use when an AI coding agent must retain progress across sessions, recover from failures, or avoid context exhaustion.

The file declares its own license as ISC. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

4.6 KB, ~1.0k tokens by cl100k_base, as published. Nobody here has run it

Agentic Loop Memory Server Skill ♾️

The industry-standard persistent memory for long-running agentic workflows.

[!IMPORTANT] Prerequisite: This skill requires the `@mhrj/mcp-agent-loop` MCP server to be installed and active in your agent's configuration.

Setup Instructions

To use this skill, ensure you have added the following to your `mcp_config.json` (e.g., in Claude Desktop, Cursor, or Windsurf):

```json { "mcpServers": { "agent-loop": { "command": "npx", "args": ["-y", "@mhrj/mcp-agent-loop"] } } } ```

How it Works

This skill connects you to the `@mhrj/mcp-agent-loop` server. It solves the "Goldfish Memory" problem in AI agents by providing a structured, self-compacting memory system. Unlike simple vector-search tools, this is an active state manager designed specifically for smaller models (like Gemini Flash or GPT-4o-mini) that need to perform complex tasks over hours or days without crashing.

Why this is better than other memory skills:

  • Zero-Dependency Transparency: Your memory is just a Markdown file. No hidden vector databases or opaque formats. You can read/edit your own "brain" anytime.
  • Active Context Compaction: Instead of just "searching", the server warns you when your context is getting full and guides you through a summarize-and-compress cycle.
  • Mandatory Self-Healing: It prevents you from getting stuck in "infinite retry loops" by requiring a strategy for every failure.
  • Agent-Agnostic: Works natively with Claude Code, Cursor, Windsurf, and any MCP-compatible environment.

When you are asked to perform a complex, autonomous, or long-running task, you must rely on this MCP server instead of trying to hold the entire history in your immediate memory window.

1. Start the Session Run the `init_loop` tool with a unique `session_id` (e.g. `debug_auth_bug`) and the `objective`.

2. Read the State Read the MCP resource `loop://{session_id}`. This Markdown file is your "brain". It contains the Objective, your System Instructions, the Active Context (recent steps), and your Compacted History (what you completed hours/days ago).

3. Act and Log Perform your normal tasks (running bash commands, editing files, searching). After every significant action, you MUST call the `log_step` tool:

  • `session_id`: Your chosen ID.
  • `action`: What you tried to do.
  • `result`: The command output or file edit result.
  • `failed`: A boolean. `true` if the command threw an error or didn't do what you expected. `false` if it succeeded.

4. The Self-Healing Requirement (CRITICAL) If you set `failed: true` in `log_step`, you MUST provide a `self_heal_strategy`. This is because you are not allowed to mindlessly retry the same failing tool. If a grep search fails to find a variable, your `self_heal_strategy` might be: "The variable isn't in `src`. I will search in the `lib` directory or look for tool suggestions." If you forget the `self_heal_strategy`, the `log_step` tool will explicitly reject your call and make you try again.

5. The Compaction Requirement (CRITICAL) If you run for a long time, the `Active Context` in your state file will grow too large, causing you to crash or hallucinate. When `log_step` returns a warning that the context is too large (e.g., >3000 words), you MUST immediately stop working on the task and call the `compact_memory` tool.

  • `context_summary`: You must look at the Active Context and write a dense, 2-3 paragraph summary of what was achieved and what the current state is. The server will wipe the Active Context and permanently store your summary.

6. Asking the Human If you hit an absolute dead end (e.g., missing API keys, ambiguous requirements, infinite error loops), do NOT guess. Call the `report_blocker` tool. Doing this will pause the loop, allowing you to ask the human user for help via standard chat. Once the human replies, use the `resume_loop` tool to inject their input back into the state file.

Expected Behavior

You are expected to act like a senior engineer. Do not give up easily. If an action fails, use your reasoning to devise a new `self_heal_strategy`. If you exhaust all local tools, call `get_tool_suggestions` to remind yourself how to break out of the box.

Gives 0 of the 12 instructions most memory context skills give in ~1.0k tokens

Counted across 674 of the 847 authors here whose files we hold, read 2026-08-06

  • inform the user when setup is completein 21 of 674, across 6 files
  • confirm the draft with the user before writingin 21 of 674, across 6 files
  • update the agent skills block in place if it existsin 21 of 674, across 6 files
  • present findings to the userin 20 of 674, across 5 files
  • write the three docs files from seed templatesin 20 of 674, across 5 files
  • ask the user about each decision one at a timein 19 of 674, across 4 files
  • edit CLAUDE.md if it existsin 18 of 674, across 3 files
  • explore current repo statein 18 of 674, across 3 files
  • do not overwrite user edits to surrounding sectionsin 18 of 674, across 3 files
  • back up the original file before overwritingin 16 of 674, across 8 files
  • keep the memory index under 200 linesin 15 of 674
  • Provide actionable steps and verificationin 13 of 674, across 2 files

Said here and by no other author read

  • rely on the mcp server for complex tasks
  • read the mcp resource before acting
  • log every significant action using log step
  • provide a self-heal strategy when logging failures
  • call compact memory when context is too large
  • write a dense summary of active context for compaction

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.