A collection of production-ready autonomous agents built on Anthropic's Managed Agents API — self-running, event-driven AI agents that operate 24/7 with minimal human intervention, integrated with Sentry, Jira, GitHub, and Slack.
This repository contains Claude Managed Agents — long-running autonomous AI agents that use Anthropic's managed-agents API beta to operate as persistent, event-driven workers. Unlike one-shot prompts, these agents run in a continuous session loop, respond to real-world events (Sentry alerts, Jira tickets, PR comments), and take autonomous action with human-in-the-loop approval for critical operations.
Each agent is defined by:
- A system prompt (
.MDfile) that describes the agent's role, decision logic, and tool-use rules - A scheduler (
scheduler.ts) that creates a fresh session every 60 minutes and triggers a polling cycle - MCP tool integrations (Sentry, Jira, GitHub, Slack) injected at session creation via vault/environment config
┌──────────────┐ every 60 min ┌────────────────────┐
│ scheduler │ ──────────────────── ▶ │ sessions.create() │
│ (cron job) │ │ (Managed Agent) │
└──────────────┘ └────────┬───────────┘
│ trigger: "Run your polling cycle now."
▼
┌────────────────────┐
│ Agent reasons │
│ + uses MCP tools │
│ (Sentry/Jira/GH) │
└────────┬───────────┘
│
┌──────────────────┼──────────────────┐
▼ ▼ ▼
Jira ticket GitHub PR Slack alert
created opened posted
- Scheduler (
scheduler.ts) fires on a cron schedule - Creates a fresh Managed Agent session via
client.beta.sessions.create() - Sends a trigger message:
"Run your polling cycle now." - Streams agent events — the agent autonomously investigates, codes, and takes action
- Session is archived when the cycle is complete
OnCallIncidentManager.MD
An autonomous on-call incident commander that handles the full incident lifecycle end-to-end:
- Sentry → Jira: Detects new Sentry errors and creates corresponding Jira tickets automatically
- Root cause analysis: Inspects stack traces, maps file paths to GitHub repositories, and identifies the breaking code
- Critical incident approval gate: For Critical severity, posts a structured plan to
#ai-agentSlack channel and waits for human ✅ approval before touching any code - Auto-fix & PR: Creates a feature branch (named after the Jira ticket ID), implements a targeted fix, runs lint/prettier, and opens a PR
- PR review response: Reads reviewer comments, addresses all feedback, pushes to the same branch, and replies to each comment on GitHub
- Continuous queue: When current incidents are fixed, automatically picks up the next unresolved ticket by severity priority
- Always in sync: Keeps Jira tickets, GitHub PRs, and the
#ai-agentSlack channel updated throughout
Integrations: Sentry · Jira · GitHub · Slack
claude_managed_agents/
├── OnCallIncidentManager.MD # Agent system prompt — incident commander
├── scheduler.ts # Cron runner: creates sessions & streams events
├── setup.ts # One-time environment/vault setup
├── package.json
├── tsconfig.json
├── .env.sample # Required environment variables
└── README.md
- Node.js 18+
- An Anthropic API key with access to the
managed-agents-2026-04-01beta - A configured Anthropic Agent with MCP vaults for Sentry, Jira, GitHub, and Slack
git clone https://github.com/dinesh2648/claude_managed_agents.git
cd claude_managed_agents
npm installCopy .env.sample to .env and fill in your values:
cp .env.sample .envANTHROPIC_API_KEY=sk-ant-...
AGENT_ID=ag_...
ENVIRONMENT_ID=env_...
VAULT_IDS=vault_abc,vault_def # comma-separated MCP vault IDsnpx ts-node scheduler.tsThe scheduler fires immediately on startup, then every 60 minutes. Each run creates a fresh session, triggers the agent's polling cycle, streams output to the console, and archives the session on completion.
This project uses Anthropic's Managed Agents beta API:
// Create a session tied to an agent
const session = await client.beta.sessions.create({
agent: AGENT_ID,
environment_id: ENVIRONMENT_ID,
vault_ids: VAULT_IDS,
title: `Polling cycle – ${runAt}`,
}, { headers: { "anthropic-beta": "managed-agents-2026-04-01" } });
// Trigger the agent
await client.beta.sessions.events.send(session.id, {
events: [{ type: "user.message", content: [{ type: "text", text: "Run your polling cycle now." }] }]
}, { headers: { "anthropic-beta": "managed-agents-2026-04-01" } });
// Stream agent output
const stream = await client.beta.sessions.events.stream(session.id, ...);Each .MD file in this repo is the system prompt for a Claude Managed Agent. The design principles:
- Workflow-first: Prompts are structured as named workflows (
### When a Sentry issue is raised) so Claude can pattern-match the current situation to the right playbook - Explicit approval gates: Critical actions (e.g. fixing Critical severity incidents) require a structured human-approval step via Slack before proceeding
- Idempotent operations: Branch-existence checks prevent duplicate branches; session archiving frees resources after each cycle
- Opinionated output formats: PR title formats, Slack message schemas, and Jira comment templates are specified precisely to keep outputs consistent and machine-readable
The OnCall Incident Manager never touches Critical severity code without approval:
🚨 *Critical Incident Plan — [TICKET-ID]: [Title]*
*Root cause:* <summary>
*Affected file(s):* <file paths>
*Proposed fix:* <description of the change>
*Awaiting approval to proceed. Reply ✅ to approve or ❌ to reject with feedback.*
The agent waits for ✅ or "approved" in the Slack thread before proceeding. This pattern can be adapted for any agent that needs a human checkpoint.
-
PRReviewMonitor.MD— dedicated agent for proactive PR review assignment and nudges -
EngineeringHealthMonitor.MD— sprint health and bottleneck detection agent - Multi-agent orchestration (agents that hand off tasks to other agents)
- Web dashboard for session history and agent activity logs
Contributions welcome. To add a new agent:
- Fork this repository
- Create a new
.MDfile with your agent's system prompt — follow the workflow-first structure ofOnCallIncidentManager.MD - Document the integrations and trigger conditions clearly
- Submit a PR with a short description of what problem the agent solves
Apache 2.0 — see LICENSE for details.
Keywords: Anthropic managed agents, Claude autonomous agents, managed-agents API beta, Claude sessions API, on-call AI agent, Sentry incident automation, Jira automation Claude, AI DevOps agent, autonomous incident response, Claude MCP tools, agentic AI engineering, LLM-powered on-call, AI SRE agent, self-healing systems