Catalog
affaan-m/autonomous-agent-harness

affaan-m

autonomous-agent-harness

Transform Claude Code into a fully autonomous agent system with persistent memory, scheduled operations, computer use, and task queuing. Replaces standalone agent frameworks (Hermes, AutoGPT) by leveraging Claude Code's native crons, dispatch, MCP tools, and memory. Use when the user wants continuous autonomous operation, scheduled tasks, or a self-directing agent loop.

global
0installs0uses~2.3k
v1.1Saved Apr 20, 2026

Autonomous Agent Harness

Turn Claude Code into a persistent, self-directing agent system using only native features and MCP servers.

When to Activate

  • User wants an agent that runs continuously or on a schedule
  • Setting up automated workflows that trigger periodically
  • Building a personal AI assistant that remembers context across sessions
  • User says "run this every day", "check on this regularly", "keep monitoring"
  • Wants to replicate functionality from Hermes, AutoGPT, or similar autonomous agent frameworks
  • Needs computer use combined with scheduled execution

Architecture

┌──────────────────────────────────────────────────────────────┐
│                    Claude Code Runtime                        │
│                                                              │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌─────────────┐ │
│  │  Crons   │  │ Dispatch │  │ Memory   │  │ Computer    │ │
│  │ Schedule │  │ Remote   │  │ Store    │  │ Use         │ │
│  │ Tasks    │  │ Agents   │  │          │  │             │ │
│  └────┬─────┘  └────┬─────┘  └────┬─────┘  └──────┬──────┘ │
│       │              │             │                │        │
│       ▼              ▼             ▼                ▼        │
│  ┌──────────────────────────────────────────────────────┐    │
│  │              ECC Skill + Agent Layer                  │    │
│  │                                                      │    │
│  │  skills/     agents/     commands/     hooks/        │    │
│  └──────────────────────────────────────────────────────┘    │
│       │              │             │                │        │
│       ▼              ▼             ▼                ▼        │
│  ┌──────────────────────────────────────────────────────┐    │
│  │              MCP Server Layer                        │    │
│  │                                                      │    │
│  │  memory    github    exa    supabase    browser-use  │    │
│  └──────────────────────────────────────────────────────┘    │
└──────────────────────────────────────────────────────────────┘

Core Components

1. Persistent Memory

Use Claude Code's built-in memory system enhanced with MCP memory server for structured data.

Built-in memory (~/.claude/projects/*/memory/):

  • User preferences, feedback, project context
  • Stored as markdown files with frontmatter
  • Automatically loaded at session start

MCP memory server (structured knowledge graph):

  • Entities, relations, observations
  • Queryable graph structure
  • Cross-session persistence

Memory patterns:

# Short-term: current session context
Use TodoWrite for in-session task tracking

# Medium-term: project memory files
Write to ~/.claude/projects/*/memory/ for cross-session recall

# Long-term: MCP knowledge graph
Use mcp__memory__create_entities for permanent structured data
Use mcp__memory__create_relations for relationship mapping
Use mcp__memory__add_observations for new facts about known entities

2. Scheduled Operations (Crons)

Use Claude Code's scheduled tasks to create recurring agent operations.

Setting up a cron:

# Via MCP tool
mcp__scheduled-tasks__create_scheduled_task({
  name: "daily-pr-review",
  schedule: "0 9 * * 1-5",  # 9 AM weekdays
  prompt: "Review all open PRs in affaan-m/everything-claude-code. For each: check CI status, review changes, flag issues. Post summary to memory.",
  project_dir: "/path/to/repo"
})

# Via claude -p (programmatic mode)
echo "Review open PRs and summarize" | claude -p --project /path/to/repo

Useful cron patterns:

Pattern Schedule Use Case
Daily standup 0 9 * * 1-5 Review PRs, issues, deploy status
Weekly review 0 10 * * 1 Code quality metrics, test coverage
Hourly monitor 0 * * * * Production health, error rate checks
Nightly build 0 2 * * * Run full test suite, security scan
Pre-meeting */30 * * * * Prepare context for upcoming meetings

3. Dispatch / Remote Agents

Trigger Claude Code agents remotely for event-driven workflows.

Dispatch patterns:

# Trigger from CI/CD
curl -X POST "https://api.anthropic.com/dispatch" \
  -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
  -d '{"prompt": "Build failed on main. Diagnose and fix.", "project": "/repo"}'

# Trigger from webhook
# GitHub webhook → dispatch → Claude agent → fix → PR

# Trigger from another agent
claude -p "Analyze the output of the security scan and create issues for findings"

4. Computer Use

Leverage Claude's computer-use MCP for physical world interaction.

Capabilities:

  • Browser automation (navigate, click, fill forms, screenshot)
  • Desktop control (open apps, type, mouse control)
  • File system operations beyond CLI

Use cases within the harness:

  • Automated testing of web UIs
  • Form filling and data entry
  • Screenshot-based monitoring
  • Multi-app workflows

5. Task Queue

Manage a persistent queue of tasks that survive session boundaries.

Implementation:

# Task persistence via memory
Write task queue to ~/.claude/projects/*/memory/task-queue.md

# Task format
---
name: task-queue
type: project
description: Persistent task queue for autonomous operation
---

## Active Tasks
- [ ] PR #123: Review and approve if CI green
- [ ] Monitor deploy: check /health every 30 min for 2 hours
- [ ] Research: Find 5 leads in AI tooling space

## Completed
- [x] Daily standup: reviewed 3 PRs, 2 issues

Replacing Hermes

Hermes Component ECC Equivalent How
Gateway/Router Claude Code dispatch + crons Scheduled tasks trigger agent sessions
Memory System Claude memory + MCP memory server Built-in persistence + knowledge graph
Tool Registry MCP servers Dynamically loaded tool providers
Orchestration ECC skills + agents Skill definitions direct agent behavior
Computer Use computer-use MCP Native browser and desktop control
Context Manager Session management + memory ECC 2.0 session lifecycle
Task Queue Memory-persisted task list TodoWrite + memory files

Setup Guide

Step 1: Configure MCP Servers

Ensure these are in ~/.claude.json:

{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@anthropic/memory-mcp-server"]
    },
    "scheduled-tasks": {
      "command": "npx",
      "args": ["-y", "@anthropic/scheduled-tasks-mcp-server"]
    },
    "computer-use": {
      "command": "npx",
      "args": ["-y", "@anthropic/computer-use-mcp-server"]
    }
  }
}

Step 2: Create Base Crons

# Daily morning briefing
claude -p "Create a scheduled task: every weekday at 9am, review my GitHub notifications, open PRs, and calendar. Write a morning briefing to memory."

# Continuous learning
claude -p "Create a scheduled task: every Sunday at 8pm, extract patterns from this week's sessions and update the learned skills."

Step 3: Initialize Memory Graph

# Bootstrap your identity and context
claude -p "Create memory entities for: me (user profile), my projects, my key contacts. Add observations about current priorities."

Step 4: Enable Computer Use (Optional)

Grant computer-use MCP the necessary permissions for browser and desktop control.

Example Workflows

Autonomous PR Reviewer

Cron: every 30 min during work hours
1. Check for new PRs on watched repos
2. For each new PR:
   - Pull branch locally
   - Run tests
   - Review changes with code-reviewer agent
   - Post review comments via GitHub MCP
3. Update memory with review status

Personal Research Agent

Cron: daily at 6 AM
1. Check saved search queries in memory
2. Run Exa searches for each query
3. Summarize new findings
4. Compare against yesterday's results
5. Write digest to memory
6. Flag high-priority items for morning review

Meeting Prep Agent

Trigger: 30 min before each calendar event
1. Read calendar event details
2. Search memory for context on attendees
3. Pull recent email/Slack threads with attendees
4. Prepare talking points and agenda suggestions
5. Write prep doc to memory

Constraints

  • Cron tasks run in isolated sessions — they don't share context with interactive sessions unless through memory.
  • Computer use requires explicit permission grants. Don't assume access.
  • Remote dispatch may have rate limits. Design crons with appropriate intervals.
  • Memory files should be kept concise. Archive old data rather than letting files grow unbounded.
  • Always verify that scheduled tasks completed successfully. Add error handling to cron prompts.
Files1
1 files · 1.0 KB

Select a file to preview

Overall Score

83/100

Grade

B

Good

Safety

82

Quality

85

Clarity

86

Completeness

78

Summary

This skill transforms Claude Code into a persistent autonomous agent system by coordinating native features (crons, dispatch, memory, computer use) and MCP servers. It provides a structured architecture for scheduling recurring tasks, maintaining cross-session memory, triggering remote workflows, and automating complex multi-step operations—replacing standalone agent frameworks like Hermes or AutoGPT.

Static Analysis Findings

1 finding

Patterns detected by deterministic static analysis before AI scoring. Hover over any finding code for detailed information and remediation guidance.

Environment Access
SEC-050Sensitive Environment Variable

Environment variable read for sensitive values

SKILL.md$ANTHROPIC_API_KEY

Detected Capabilities

Schedule recurring tasks via cron patternsPersistent memory management (session memory files + MCP knowledge graph)Remote agent dispatch via HTTP APIComputer use automation (browser, desktop, file operations)Task queue persistence across session boundariesMCP server integration and configurationEvent-driven workflow triggering

Trigger Keywords

Phrases that MCP clients use to match this skill to user intent.

autonomous agentscheduled tasksagent cronspersistent memorytask queueautonomous workflowsremote dispatchcomputer use automation

Risk Signals

WARNING

Environment variable reference: $ANTHROPIC_API_KEY in dispatch example

SKILL.md | Section '3. Dispatch / Remote Agents' | curl command example
INFO

Environment variable access (SEC-050) for $ANTHROPIC_API_KEY

SKILL.md | Dispatch patterns section

Referenced Domains

External domains referenced in skill content, detected by static analysis.

api.anthropic.com

Use Cases

  • Set up autonomous agents that run on a schedule (daily standups, weekly reviews, hourly monitoring)
  • Build persistent AI assistants that remember context across sessions and maintain task queues
  • Implement event-driven workflows (GitHub webhooks → agent diagnosis → PR fixes)
  • Automate browser and desktop tasks (UI testing, form filling, screenshot monitoring)
  • Create multi-step autonomous workflows (PR review → test analysis → GitHub comments)

Quality Notes

  • Strong architectural clarity: the diagram and layered component breakdown (crons, memory, dispatch, computer use) are well-structured and help users understand the system.
  • Good examples: practical cron patterns, MCP configuration, and three detailed workflow examples (PR reviewer, research agent, meeting prep) show real-world application.
  • Comparison table ('Replacing Hermes') effectively positions the skill against existing frameworks and explains how ECC features map to legacy components.
  • Clear activation triggers: 'When to Activate' section uses concrete user phrases ('run this every day', 'check on this regularly') that match real intent.
  • Constraints section identifies real limitations (isolated sessions, permission requirements, rate limits, memory file growth) and provides guardrails.
  • Minor gap: setup guide mentions `~/.claude.json` but does not explain how to verify or debug MCP server connections; troubleshooting steps would improve completeness.
  • Minor gap: the dispatch curl example shows Bearer token authentication but does not explicitly warn against hardcoding keys; could emphasize secure credential management.
  • No error handling guidance in example workflows: autonomous crons should include explicit instructions for handling failures (retry logic, alerting, logging).
Model: claude-haiku-4-5-20251001Analyzed: Apr 20, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Version History

v1.1

Content updated

2026-04-20

Latest
v1.0

No changelog

2026-04-12

Add affaan-m/autonomous-agent-harness to your library

Command Palette

Search for a command to run...