Optimize Agent and Skill Definitions

VerifiedSafe

Optimizes agent and skill definitions by reducing token count and clarifying boundaries.

Sby Skills Guide Bot
DevelopmentIntermediate
7/24/2026
Claude Code
#optimization#agent-definition#skill-definition#token-efficiency

Recommended for

Automated summary

Optimizes agent and skill definitions for conciseness, clarity, and reduced token consumption.

Strengths

  • Significant token reduction (30-50% for skills, under 500 tokens for agents).
  • Cross-checks boundaries between agents to prevent trigger overlap.
  • Provides structured output with a unified diff and actionable recommendations.
  • Preserves all critical functionality during optimization.

Limitations

  • Only works on existing agent/skill files in the standard Claude Code format.
  • May oversimplify complex agents that require verbose instructions.
  • Requires contextual understanding to avoid overly aggressive optimization.
When to use it

Use this skill when you want to reduce token usage and improve clarity of existing agent or skill definitions in your project.

When not to use it

Do not use this skill for creating new definitions from scratch or for definitions that do not follow the standard agent/skill format in Claude Code.

Security analysis

Safe
Quality score92/100

The skill only uses read, write, and grep within the project to optimize text files. It does not execute shell commands, network calls, or destructive actions, and there is no obfuscation or exfiltration risk.

No concerns found

How this analysis is made

Examples

Optimize a specific agent
Optimize the agent 'web-research' located in .claude/agents/ for token efficiency and clarity.
Optimize custom skill
Analyze and optimize my custom skill for summarizing documents, focusing on reducing token count and removing redundancies.
Batch optimize all agents
Optimize all agent definitions in .claude/agents/ to reduce token usage and ensure no trigger overlap.

description: Optimizes agent/skill definitions by reducing tokens and clarifying boundaries allowed-tools: [read, write, grep]

Optimize Agent or Skill

You optimize Claude Code agent and skill definitions for conciseness, clarity, and reduced token consumption.

Input

  1. target: Name or path of agent/skill to optimize
  2. additional_instructions (optional): Specific focus areas

Process

Step 1: Analysis

  1. Read the target agent/skill file
  2. Read ALL other agents in .claude/agents/ for boundary context
  3. Count current tokens
  4. Identify redundancies, verbose examples, unclear triggers

Step 2: Detect Type

  • Agent (.md in .claude/agents/): Optimize description field
  • Skill (.md in .claude/skills/): Optimize instructions section

Step 3: Optimize

For Agents (target: max 500 tokens):

  • Remove verbose examples, replace with concise trigger lists
  • Convert paragraphs to bullet points
  • Structure: What it does (1 line) -> Use for (4 items) -> Trigger (3-5 items) -> NOT for (optional)

For Skills (target: 30-50% reduction):

  • Remove redundant explanations and filler phrases
  • Convert prose to structured steps
  • Use tables for comparisons
  • Keep technical precision

Step 4: Boundary Analysis

Cross-check with all other agents:

  • No trigger overlap
  • Clear functional separation
  • Explicit "NOT for" sections where needed

Step 5: Language Rules

  • English, imperative mood ("Use for", not "This agent can be used for")
  • Avoid filler: "comprehensive", "detailed", "robust", "powerful"
  • MAX 2 short examples OR 1 example + trigger list
  • 3-5 trigger patterns using actual user phrases

Step 6: Quality Checks

  • [ ] Token count reduced by at least 30% (unless already optimal)
  • [ ] All critical functionality preserved
  • [ ] No trigger overlap with other agents
  • [ ] Concrete use cases, not vague descriptions
  • [ ] Proper frontmatter syntax maintained

Output Format

# Optimization Analysis: [name]

## Current State
- Type: [Agent/Skill]
- Token Count: XXX tokens
- Issues: [main problems]

## Optimization Results
- New Token Count: XXX tokens (XX% reduction)
- Key Changes: [list]

## Boundary Analysis
- Potential conflicts: [list]
- Recommendations: [suggestions]

## Proposed Changes (Diff)
[Unified diff]

## Additional Recommendations
[If any]

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/optimize-agent-and-skill-definitions-mrwakdzq/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/optimize-agent-and-skill-definitions-mrwakdzq' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/optimize-agent-and-skill-definitions-mrwakdzq/download' --output '.skill-downloads/optimize-agent-and-skill-definitions-mrwakdzq/SKILL.md.part' && mv '.skill-downloads/optimize-agent-and-skill-definitions-mrwakdzq/SKILL.md.part' '.skill-downloads/optimize-agent-and-skill-definitions-mrwakdzq/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

This file does not provide a usable name/description header for this native procedure. It remains available to download and inspect; use the manual method below.

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/optimize-agent-and-skill-definitions-mrwakdzq/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills