optimize

optimize is a command for Claude Code from TheBeardedBearSAS/claude-craft. It costs 8 tokens per session (1,579 once invoked), scanned A, original, MIT.

An Ansible optimisation command for reviewing automation playbooks, which are files that describe server setup tasks. It checks performance, quality, or both.

In plain words
What is it for?
Use it to review settings such as parallel execution, SSH pipelining, and fact caching, then receive improvement recommendations.
Why use it?
It helps find slow execution, unnecessary SSH work, and maintainability problems before they make deployments harder to run or update.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the claude-craft plugin — 56 skills, 94 commands, 47 agents, 5 hooks shipped together

Good fit Use it to review settings such as parallel execution, SSH pipelining, and fact caching, then receive improvement recommendations.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/thebeardedbearsas/claude-craft/optimize
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.

Clone the repo
git clone --depth 1 https://github.com/TheBeardedBearSAS/claude-craft

Made for: Claude Code.

Or install claude-craft, the plugin that ships this one along with the rest of its 56 skills, 94 commands, 47 agents, 5 hooks.

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 optimize

README.md
[![agentmods](https://agentmods.dev/badge/commands/thebeardedbearsas/claude-craft/optimize.svg)](https://agentmods.dev/commands/thebeardedbearsas/claude-craft/optimize)
Your own site
<a href="https://agentmods.dev/commands/thebeardedbearsas/claude-craft/optimize"><img src="https://agentmods.dev/badge/commands/thebeardedbearsas/claude-craft/optimize.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,579 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found 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.00008 $0.01579
Opus 5 $0.00004 $0.00790
Sonnet 5 $0.00002 $0.00316
Haiku 4.5 $0.00001 $0.00158

Measured 3d ago against content hash 699ddc8100bd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

optimize scanned grade A with 0 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 3d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Infra/i18n/de/Ansible/commands/optimize.md · 166 lines

How it starts

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

Ansible Optimize

Sie sind ein Ansible-Optimierungsspezialist. Sie mussen die Playbook-Performance analysieren und umsetzbare Empfehlungen fur Geschwindigkeits-, Qualitats- und Wartbarkeitsverbesserungen bereitstellen.

Argumente

$ARGUMENTS

Argumente:

  • (Optional) Ziel: performance, quality, both (Standard: both)

Beispiel: /ansible:optimize target:performance

Plan-Modus

Plan-Modus wird empfohlen. Claude analysiert die aktuelle Playbook-Struktur und Ausfuhrungsmuster, bevor Optimierungen vorgeschlagen werden.

AUFTRAG

Schritt 1: Performance-Analyse

══════════════════════════════════════════════════════════════
ANSIBLE OPTIMIERUNG
══════════════════════════════════════════════════════════════

Ziel: {performance/quality/both}

──────────────────────────────────────────────────────────────
AKTUELLES PERFORMANCE-PROFIL
──────────────────────────────────────────────────────────────

| Einstellung | Aktuell | Empfohlen | Auswirkung |
|-------------|---------|-----------|------------|
| forks | {Wert} | 20-50 | Parallelitat |
| pipelining | {aktiviert/deaktiviert} | aktiviert | SSH-Roundtrips |
| fact_caching | {none/jsonfile/redis} | jsonfile/redis | Fact-Gathering |
| gather_facts | {yes/no/smart} | smart | Startzeit |
| strategy | {linear/free/host_pinned} | free (wo sicher) | Ausfuhrungsreihenfolge |
| SSH-Multiplexing | {aktiviert/deaktiviert} | aktiviert | Verbindungswiederverwendung |

Mit ANSIBLE_CALLBACKS_ENABLED=timer,profile_tasks profilieren und Verbindungs-Overhead mit ansible.builtin.ping messen.

Schritt 2: Verbindungsoptimierung

──────────────────────────────────────────────────────────────
VERBINDUNGSTUNING
──────────────────────────────────────────────────────────────

Optimierte ansible.cfg-Verbindungseinstellungen generieren:

[defaults]
forks = 25
gathering = smart
fact_caching = jsonfile
fact_caching_connection = /tmp/ansible_facts_cache
fact_caching_timeout = 86400
callbacks_enabled = timer, profile_tasks

[ssh_connection]
pipelining = True
ssh_args = -o ControlMaster=auto -o ControlPersist=60s
control_path_dir = ~/.ansible/cp

Read the full file on GitHub · 166 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. 3d ago First seen · 166 lines · 8 tokens per session scan A 699ddc8100bd

Subscribe to this mod's changes

optimize is a command published in the GitHub repository TheBeardedBearSAS/claude-craft (105 stars, last pushed 4d ago), licensed MIT. It adds 8 tokens to every session and 1,579 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.