autonomous-agent-patterns

autonomous-agent-patterns is a skill for Claude Code, Codex from davila7/claude-code-templates. It costs 51 tokens per session (4,880 once invoked), scanned C, a copy of autonomous-agent-patterns, MIT.

A collection of design patterns for building autonomous coding agents—software that can plan, use tools, observe results, and continue working with limited supervision.

In plain words
What is it for?
Use it when designing agent loops, tool or function APIs, permission systems, browser automation, or human-in-the-loop workflows.
Why use it?
It helps you reason about the difficult parts of agent software, such as tool access, approvals, browser control, and involving a person when needed.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for cline. Also seen: mentions Codex; built for cline.

Good fit Use it when designing agent loops, tool or function APIs, permission systems, browser automation, or human-in-the-loop workflows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/davila7/claude-code-templates/autonomous-agent-patterns
About the project

Claude Code Templates is a command-line tool and catalogue for configuring Anthropic’s Claude Code with agents, commands, settings, hooks, integrations, skills, and project templates. Developers use it to browse and install reusable components for their coding workflows. The catalogue includes many of these Claude Code components.

davila7/claude-code-templates · 34,542 stars · on GitHub · aitmpl.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add davila7/claude-code-templates --skill autonomous-agent-patterns
Clone the repo
git clone --depth 1 https://github.com/davila7/claude-code-templates

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for autonomous-agent-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/davila7/claude-code-templates/autonomous-agent-patterns/github.svg)](https://agentmods.dev/skills/davila7/claude-code-templates/autonomous-agent-patterns)
Your own site
<a href="https://agentmods.dev/skills/davila7/claude-code-templates/autonomous-agent-patterns"><img src="https://agentmods.dev/badge/skills/davila7/claude-code-templates/autonomous-agent-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for autonomous-agent-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/davila7/claude-code-templates/autonomous-agent-patterns"><img src="https://agentmods.dev/badge/skills/davila7/claude-code-templates/autonomous-agent-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,880 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 3 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 15 Sept 2026
  • Snyk warn 15 Sept 2026
How audits are shown
Origin 84% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00051 $0.04880
Opus 5.5 $0.00020 $0.01952
Sonnet 5.5 $0.00010 $0.00976
Haiku 4.5 $0.00005 $0.00488

Measured 3mo ago against content hash be44f06d05c6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

autonomous-agent-patterns scanned grade C with 3 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

if any(danger in cmd for danger in ["rm -rf", "sudo", "chmod"]):

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

response = requests.get(url)

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

result = subprocess.run(
Origin

This is a copy

84% identical to autonomous-agent-patterns — 753 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

cli-tool/components/skills/ai-research/autonomous-agent-patterns/SKILL.md · 762 lines

How it starts

The opening of the file, as written. The whole thing — 762 lines — stays where its author put it; the contents beside it link to each section on GitHub.

🕹️ Autonomous Agent Patterns

Design patterns for building autonomous coding agents, inspired by Cline and OpenAI Codex.

When to Use This Skill

Use this skill when:

  • Building autonomous AI agents
  • Designing tool/function calling APIs
  • Implementing permission and approval systems
  • Creating browser automation for agents
  • Designing human-in-the-loop workflows

1. Core Agent Architecture

1.1 Agent Loop

┌─────────────────────────────────────────────────────────────┐
│                     AGENT LOOP                               │
│                                                              │
│  ┌──────────┐    ┌──────────┐    ┌──────────┐              │
│  │  Think   │───▶│  Decide  │───▶│   Act    │              │
│  │ (Reason) │    │ (Plan)   │    │ (Execute)│              │
│  └──────────┘    └──────────┘    └──────────┘              │
│       ▲                               │                     │
│       │         ┌──────────┐          │                     │
│       └─────────│ Observe  │◀─────────┘                     │
│                 │ (Result) │                                │
│                 └──────────┘                                │
└─────────────────────────────────────────────────────────────┘
class AgentLoop:
    def __init__(self, llm, tools, max_iterations=50):
        self.llm = llm
        self.tools = {t.name: t for t in tools}
        self.max_iterations = max_iterations
        self.history = []

    def run(self, task: str) -> str:
        self.history.append({"role": "user", "content": task})

        for i in range(self.max_iterations):
            # Think: Get LLM response with tool options
            response = self.llm.chat(
                messages=self.history,
                tools=self._format_tools(),
                tool_choice="auto"
            )

            # Decide: Check if agent wants to use a tool
            if response.tool_calls:
                for tool_call in response.tool_calls:
                    # Act: Execute the tool
                    result = self._execute_tool(tool_call)

                    # Observe: Add result to history
                    self.history.append({
                        "role": "tool",
                        "tool_call_id": tool_call.id,
                        "content": str(result)
                    })
            else:
                # No more tool calls = task complete
                return response.content

        return "Max iterations reached"

    def _execute_tool(self, tool_call) -> Any:
        tool = self.tools[tool_call.name]
        args = json.loads(tool_call.arguments)
        return tool.execute(**args)

Read the full file on GitHub · 762 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 762 lines · 51 tokens per session scan C be44f06d05c6

Subscribe to this mod's changes

autonomous-agent-patterns is a skill published in the GitHub repository davila7/claude-code-templates (34,542 stars, last pushed today), licensed MIT. It adds 51 tokens to every session and 4,880 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it C with 3 findings (recursive force delete, makes network calls, runs shell commands). It is 84% identical to autonomous-agent-patterns, differing in 753 lines, and is treated as a copy.

Related

autonomous-agent-patterns compared with skills from other repositories

autonomous-agent-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
autonomous-agent-patternsdavila7/claude-code-templatesSkill35ktodayMITC51Claude Code, Codex
five-whyswesammustafa/Claude-Code-Everything-You-Need-to-KnowSkill3.7k3d agononeA53Claude Code
tddwesammustafa/Claude-Code-Everything-You-Need-to-KnowSkill3.7k3d agononeA4Claude Code
review-checklistwesammustafa/Claude-Code-Everything-You-Need-to-KnowSkill3.7k3d agononeA25Claude Code, Codex
check-linkswesammustafa/Claude-Code-Everything-You-Need-to-KnowSkill3.7k3d agononeA44Claude Code, Codex
changelogwesammustafa/Claude-Code-Everything-You-Need-to-KnowSkill3.7k3d agononeA28Claude Code
report-formatsandisab/swe-marketplaceSkill233d agoMITA105Claude Code