Perpetual autonomous work loop for Claude Code — no end condition, no memory regression, no context overfill. Maintains a persistent ledger across all sessions.
npx skills add https://github.com/majiayu000/claude-skill-registry --skill agent-estate
Perpetual autonomous work loop plugin for Claude Code. Turns Claude into an agent that works cycle after cycle, maintaining a persistent ledger across all sessions, never stopping until explicitly told to.
Agent Estate creates an infinite work loop by intercepting Claude's stop events via a shell hook. Each time Claude tries to exit, the hook blocks the exit, increments the cycle counter, and re-injects the prompt — creating a true perpetual agent.
agent-estate/
├── .claude-plugin/plugin.json # Plugin manifest (name, version, author)
├── commands/
│ ├── start.md # /agent-estate:start — activates the loop
│ ├── stop.md # /agent-estate:stop — removes state file to allow exit
│ └── status.md # /agent-estate:status — shows cycle count, ledger summary
├── hooks/
│ ├── hooks.json # Registers stop-hook.sh on the "Stop" event
│ └── stop-hook.sh # Core engine: blocks exit, increments cycle, re-injects prompt
├── scripts/
│ └── setup-estate.sh # Creates .claude/agent-estate.local.md state file
├── LICENSE
└── README.md
hooks/stop-hook.sh)The core engine. Runs on every Claude "Stop" event:
.claude/agent-estate.local.md exists (is the loop active?)done: true in frontmatter): removes state file, exits normally (auto-stop){"decision": "block", "reason": "..."} to prevent exitscripts/setup-estate.sh)Creates the state file at .claude/agent-estate.local.md with YAML frontmatter (active, cycle, started_at, user_prompt) and the full cycle protocol instructions. If already active, outputs current state and continues.
.claude/agent-estate.md)The persistent brain — every Claude session reads and updates it. Contains:
.claude/agent-estate.local.md)Ephemeral file that signals an active loop. Contains the cycle counter and preserved user prompt. Removing this file (via /agent-estate:stop) is the only way to end the loop.
| Command | Description |
|---------|-------------|
| /agent-estate:start | Activate the loop in perpetual mode (no end condition) |
| /agent-estate:start <prompt> | Start perpetual mode with a specific task focus |
| /agent-estate:start --done <prompt> | Start in done mode — auto-stops when task is complete |
| /agent-estate:status | Show current cycle, mode, stats, and the latest handoff message |
| /agent-estate:stop | Manually remove the state file to stop the loop |
Built into the agent instructions, in order:
Each cycle follows this pattern:
.claude/agent-estate.md (the ledger)jq — required for JSON output in the stop hookgit clone https://github.com/MercuriusDream/agent-estate.git
mkdir -p ~/.claude/plugins/local
ln -s "$(pwd)/agent-estate" ~/.claude/plugins/local/agent-estate
chmod +x agent-estate/scripts/setup-estate.sh
chmod +x agent-estate/hooks/stop-hook.sh
/agent-estate:start <prompt> for focused work without being restrictiveCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Replace with description of the skill and when Claude should use it.
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill content", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins.
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
Use when creating new skills, editing existing skills, or verifying skills work before deployment
Take majiayu000/agent-estate from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.