{
  "markdown": "# Claude Agent Manager\n\nA Claude Code plugin for spawning and managing autonomous background agents with persistent state across sessions.\n\n## What it does\n\n- **Spawn** background agents that work in isolated git worktrees\n- **Track** agent status with a persistent registry (`.claude/agents/registry.json`)\n- **Auto-detect completion** via hooks — registry updates in real-time when agents finish\n- **Resume** stopped or failed agents from where they left off\n- **Merge** completed agent work back into your main branch\n- **Monitor** agent activity with logs, diffs, and watch mode\n- **Learn** from previous tasks via persistent worker memory\n\n## Install\n\n```bash\nclaude plugin install agent-manager\n```\n\nWhen enabling, you'll be prompted for optional defaults:\n- **Default model** — `haiku`, `sonnet`, or `opus` (leave empty to inherit from session)\n- **Default effort** — `low`, `medium`, `high`, or `max` (leave empty for `high`)\n\nOr test locally:\n\n```bash\nclaude --plugin-dir /path/to/claude-agent-manager\n```\n\n### Requirements\n\n- **Git** — agents work in isolated git worktrees\n- **Node.js** — used by the hook script (always available since Claude Code runs on Node)\n- No other external dependencies\n\n## Commands\n\n### Core\n\n| Command | Description |\n|---------|-------------|\n| `/agent \"task\"` | Spawn a new background agent |\n| `/agent list` | Show all agents and their status |\n| `/agent switch <id>` | View details of a specific agent |\n| `/agent stop <id>` | Stop a running agent |\n| `/agent merge <id>` | Merge a completed agent's branch |\n| `/agent history` | Show full agent history |\n| `/agent clean` | Remove finished agents and worktrees |\n\n### Recovery\n\n| Command | Description |\n|---------|-------------|\n| `/agent resume <id>` | Resume a stopped/failed agent on its existing branch |\n| `/agent retry <id>` | Re-spawn a failed agent with the same task from scratch |\n\n### Inspection\n\n| Command | Description |\n|---------|-------------|\n| `/agent diff <id>` | Quick inline diff preview of agent's changes |\n| `/agent logs <id>` | Summarized activity log of what the agent did |\n| `/agent stats` | Lifetime stats — total spawned, success rate, etc. |\n\n### Advanced\n\n| Command | Description |\n|---------|-------------|\n| `/agent batch \"task1\" \"task2\"` | Spawn multiple agents in parallel |\n| `/agent note <id> \"text\"` | Attach a note to an agent |\n| `/agent watch <id>` | Poll a running agent until completion |\n| `/agent rebase <id>` | Rebase agent branch onto latest main |\n| `/agent export <id>` | Export changes as a `.patch` file |\n\n### Templates\n\nSpawn with a pre-defined template:\n\n```\n/agent --template api \"add user profile endpoint\"\n```\n\nTemplates are stored in `.claude/agents/templates/` as JSON files:\n\n```json\n{\n  \"name\": \"api\",\n  \"description\": \"API endpoint template\",\n  \"verifyCommand\": \"npm test\",\n  \"commitFormat\": \"feat(api): {description}\"\n}\n```\n\nRequired fields: `name`, `description`. Optional: `verifyCommand` (overrides Phase 4 auto-detection), `commitFormat` (overrides conventional commit format).\n\n### Spawn Flags\n\n| Flag | Values | Description |\n|------|--------|-------------|\n| `--model` | `haiku`, `sonnet`, `opus` | Choose which model the agent uses |\n| `--effort` | `low`, `medium`, `high`, `max` | Effort level metadata (worker runs at `high`) |\n| `--color` | `red`, `blue`, `green`, `yellow`, `purple`, `orange`, `pink`, `cyan` | Visual color for agent identification |\n| `--max-turns` | `<number>` | Max turns metadata (worker default: 200) |\n| `--template` | `<name>` | Use a pre-defined template |\n\n> **Note:** `--model` is the only flag that changes agent behavior at runtime (via the Agent tool's `model` parameter). `--effort` and `--max-turns` are stored in the registry for tracking but the worker subagent always uses `effort: high` and `maxTurns: 200` from its definition. `--color` sets the agent's display color.\n\n**Examples:**\n\n```\n/agent --model sonnet \"refactor the auth module\"\n/agent --model haiku --color blue \"add JSDoc comments to utils/\"\n/agent --max-turns 50 \"quick formatting fix\"\n/agent batch --model sonnet \"task one\" \"task two\"\n```\n\n## How it works\n\n1. Each spawned agent runs as a custom `worker` subagent in an isolated git worktree\n2. The worker follows a structured 5-phase process:\n   - **Analyze** — read project conventions, identify relevant files\n   - **Plan** — break task into 3-8 ordered steps with fallbacks\n   - **Implement** — execute incrementally, verify after each step\n   - **Verify** — auto-detect build system and run checks (or use template's `verifyCommand`)\n   - **Commit** — conventional commit, write result file back to main repo\n3. A `SubagentStop` hook auto-updates the registry when agents complete\n4. Workers accumulate project knowledge via persistent memory (`.claude/agent-memory/worker/`)\n5. Resume agents that failed, or retry them from scratch\n6. When ready, merge the agent's branch back into your working branch\n\n## Plugin Structure\n\n```\nclaude-agent-manager/\n├── .claude-plugin/\n│   ├── plugin.json          # Plugin manifest with userConfig\n│   └── marketplace.json     # Marketplace metadata\n├── agents/\n│   └── worker.md            # Custom worker subagent (background, worktree, memory)\n├── skills/\n│   └── agent/\n│       └── SKILL.md         # Main skill with all commands\n├── hooks/\n│   └── hooks.json           # SubagentStop hook for auto-registry updates\n├── bin/\n│   └── update-registry.sh   # Registry update script called by hook\n├── README.md\n├── CHANGELOG.md\n└── LICENSE\n```\n\n## Tips\n\n### First-time setup\n\nOn your first `/agent` command in a repo, the plugin asks for your default branch (e.g., `main`, `master`, `develop`). This is stored in the registry and used for all git operations. You only get asked once per project.\n\n### Monorepos with submodules\n\nAgents run in git worktrees. For monorepos with submodules, `cd` into the submodule before spawning agents — this ensures the worktree is created for that specific repo:\n\n```bash\ncd my-monorepo/frontend    # cd into the submodule\nclaude                     # start Claude Code here\n/agent \"add dark mode\"     # agent works on frontend repo only\n```\n\n### Environment files in worktrees\n\nAgents run in isolated git worktrees, which don't include gitignored files like `.env`. If your project needs environment variables or config files in agent worktrees, create a `.worktreeinclude` file at your project root:\n\n```\n.env\n.env.local\nconfig/secrets.json\n```\n\nFiles matching these patterns that are also gitignored will be automatically copied into each agent's worktree.\n\n## License\n\nMIT\n",
  "bytes": 6575,
  "sha": "9056138a2dd7ecb21d88ee0e5f47d06cfaeea23d47a7ba9e0beac8d8e17f933d",
  "repo_slug": "devhimanshulohani/claude-agent-manager",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_devhimanshulohani_claude_agent_manager_a_376d512e/readme"
}