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.
npx agentmods add skills/davila7/claude-code-templates/autonomous-agent-patternsnpx skills add davila7/claude-code-templates --skill autonomous-agent-patternsgit clone --depth 1 https://github.com/davila7/claude-code-templatesWrote 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.
[](https://agentmods.dev/skills/davila7/claude-code-templates/autonomous-agent-patterns)<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="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00051 | $0.04880 |
| Opus 5 | $0.00026 | $0.02440 |
| Sonnet 5 | $0.00010 | $0.00976 |
| Haiku 4.5 | $0.00005 | $0.00488 |
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 5d 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( Copies of this mod
8 near-identical copies found in the catalogue:
- autonomous-agent-patterns — 100% identical, 0 lines differ
- autonomous-agent-patterns — 100% identical, 0 lines differ
- autonomous-agent-patterns — 100% identical, 0 lines differ
- autonomous-agent-patterns — 95% identical, 4 lines differ
- autonomous-agent-patterns — 95% identical, 6 lines differ
- autonomous-agent-patterns — 88% identical, 5 lines differ
- autonomous-agent-patterns — 84% identical, 10 lines differ
- autonomous-agent-patterns — 84% identical, 10 lines differ
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)
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.
- 5d ago First seen · 762 lines · 51 tokens per session scan C be44f06d05c6
autonomous-agent-patterns is a skill published in the GitHub repository davila7/claude-code-templates (30,520 stars, last pushed today), licensed MIT. It adds 51 tokens to every session and 4,880 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 3 findings (recursive force delete, makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
playwright-cli
Automates browser interactions for web testing, form filling, screenshots, and data extraction using playwright-cli. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, extract information from web pages, mock network requests, manage browser…
browserstack
../../../engineering-team/playwright-pro/skills/browserstack/SKILL.md.
browser-automation
../../../engineering/skills/browser-automation/SKILL.md.
playwright-ci
Production-ready CI/CD configurations for Playwright — GitHub Actions, GitLab CI, CircleCI, Azure DevOps, Jenkins, Docker, parallel sharding, reporting, code coverage, and global setup/teardown.
playwright-pom
Page Object Model patterns for Playwright — when to use POM, how to structure page objects, and when fixtures or helpers are a better fit.
playwright-migration
Step-by-step migration guides for moving to Playwright from Cypress or Selenium/WebDriver — command mappings, architecture changes, and incremental adoption strategies.