eve-agent-optimisation
Analyse agent execution to find wasted tool calls, wrong turns, and blind alleys. Optimise agents to reach their goal in the fewest turns, tokens, and least time. Recommend harness/model changes — never apply without user approval.
What this skill does
# Eve Agent Optimisation
The goal: get the agent to its objective in the **fewest tool calls, fewest tokens, shortest time**. Find where it wastes effort and eliminate it.
## Hard Rule: Recommend, Don't Change
**Never change the harness, model, reasoning effort, or permission policy without asking the user first.** These are cost and capability decisions that belong to the project owner. Diagnose, explain the tradeoff, and recommend — then wait for approval.
## What You're Looking For
Analyse agent execution logs to identify:
1. **Wrong turns** — agent tried an approach that couldn't work and had to backtrack.
2. **Blind alleys** — agent spent tokens exploring something irrelevant to the goal.
3. **Unnecessary tool calls** — agent read files it didn't need, ran commands that gave no useful information, or repeated calls with slight variations.
4. **Missing context** — agent had to discover something through trial and error that should have been stated in the SKILL.md or job description.
5. **Wrong tool for the job** — agent used a slow or fragile tool when a faster/native alternative exists (e.g., shelling out to `pdftotext` when the LLM reads PDFs natively).
6. **Excessive reading** — agent read entire large files when it only needed a section, or read many files looking for something that could have been found with a targeted search.
7. **Verbose output** — agent explained its reasoning at length when the task only needed a concise result.
8. **Retry loops** — agent repeated the same failing operation, hoping for a different result.
## Diagnostic Workflow
### Step 1: Get the Execution Record
```bash
eve job diagnose <job-id> # Full timeline, routing, errors
eve job show <job-id> --verbose # Phase, attempts, harness, agent
eve job receipt <job-id> # Token usage + cost
```
Key numbers:
- **Input tokens** — how much the agent read. High = reading too much.
- **Output tokens** — how much it wrote. High = verbose or excessive reasoning.
- **Attempt count** — more than 1 means the agent crashed or timed out.
- **Duration** — compare against what a focused agent should take.
### Step 2: Stream or Replay the Logs
```bash
eve job follow <job-id> # Real-time (if still active)
eve job logs <job-id> # Historical
```
Read the log sequentially. For each tool call, ask:
- **Did this advance the goal?** If not, it's waste.
- **Could this have been avoided?** If the SKILL.md had told the agent where to look, would it have skipped this?
- **Was this the right tool?** Could a different approach have gotten the same information faster?
- **Was the scope right?** Did the agent read an entire file when it needed 10 lines?
### Step 3: Map the Critical Path
Identify the **minimum set of tool calls** needed to achieve the goal:
1. What files actually mattered?
2. What commands actually produced useful output?
3. What decisions were correct on first attempt?
Everything else is waste. Quantify: how many tool calls were on the critical path vs total? What percentage of tokens were spent on productive work?
### Step 4: Identify Root Causes
For each category of waste, trace back to the root cause:
| Waste | Root Cause | Fix |
|-------|-----------|-----|
| Agent explored wrong files | SKILL.md doesn't say where to look | Add specific file paths or search patterns to SKILL.md |
| Agent tried wrong approach first | SKILL.md doesn't state the preferred approach | Add explicit instructions: "Do X, not Y" |
| Agent read files it didn't need | Job description too vague | Narrow the description; specify exact scope |
| Agent retried failing command | No error handling guidance | Add failure mode instructions to SKILL.md |
| Agent used wrong tool for file type | SKILL.md doesn't mention native capabilities | Add file-type routing: "PDFs: read natively. Images: view directly." |
| Agent read entire large file | No guidance on targeted reading | Add instructions: "Read only lines 1-50" or "Search for X" |
| Agent verbose in output | No output format specified | Specify exact format: JSON schema, attachment name, concise summary |
| Agent lacks context for decisions | Missing resource refs or env vars | Attach the right resources; ensure `with_apis` is configured |
| Agent re-discovers known facts | No persistent memory strategy | Use org docs, KV store, or attachments to carry forward knowledge |
| Agent slow due to provisioning | Too many resources, large clone, unnecessary toolchains | Trim resource refs, configure shallow clone, remove unused toolchains |
## The Fix Is Almost Always the SKILL.md
The SKILL.md is the highest-leverage optimisation target. A precise SKILL.md eliminates entire categories of wasted tool calls.
### Write for Efficiency
1. **State the goal in one sentence.** The agent should know exactly what it's trying to achieve before doing anything.
2. **Name specific files and paths.** "Check the auth config" wastes tool calls searching. "Read `src/config/auth.ts` lines 1-30" is one tool call.
3. **State the approach explicitly.** "Use native PDF reading via the Read tool — do NOT shell out to conversion tools" prevents the agent from trying the wrong path.
4. **Specify what NOT to do.** If there's a common wrong turn, block it. "Do not read the entire test suite; only read the failing test file."
5. **Define the output format.** "Write a JSON attachment named `findings.json` with schema `{issues: [{file, line, severity, message}]}`." This eliminates formatting deliberation.
6. **Tell the agent what context it has.** "The resource index at `.eve/resources/index.json` lists all attached documents with mime_type. Read it first to determine processing strategy."
7. **Provide decision trees for branches.** Instead of "handle different file types appropriately":
```
Check mime_type in resource index:
- application/pdf → read natively, use page ranges for >10 pages
- text/* → read directly
- image/* → view directly (multimodal)
- other → describe and note for human review
```
8. **Keep it short.** Every word the agent reads consumes input tokens. Cut filler. Use tables and lists over prose.
### Test the SKILL.md
After rewriting, run the same job again and compare:
- Fewer tool calls?
- Fewer tokens?
- Faster completion?
- Correct result on first attempt?
```bash
eve job compare <old-job-id> <new-job-id> # Compare receipts
```
## Beyond the SKILL.md
When SKILL.md changes aren't sufficient, look at these levers (all require user approval to change):
### Harness and Model
If the agent is consistently:
- **Too slow** for the task → recommend a faster model (e.g., sonnet → haiku).
- **Not capable enough** → recommend a more capable model (e.g., sonnet → opus).
- **Using too many thinking tokens** → recommend lower reasoning effort.
- **Not thinking enough** → recommend higher reasoning effort.
Present the tradeoff (speed vs cost vs quality) and let the user decide.
### Permission Policy
If the agent is blocked waiting for approvals on every file edit:
- Recommend `yolo` for automated batch work.
- Recommend `auto_edit` for supervised coding.
- Explain the security implications.
### Resource Refs
If provisioning is slow:
- Remove resource refs the agent doesn't actually use.
- Mark optional context as `required: false`.
- Thread `mime_type` so the agent doesn't need to probe file types.
### Git Controls
If the agent wastes time on git operations:
- `commit: auto` + `push: on_success` eliminates manual git ceremony.
- `create_branch: if_missing` avoids branch creation failures.
- `ref_policy: auto` minimises clone scope.
### Job Scope
If the agent is doing too much in one job:
- Split into focused children via orchestration.
- Each child gets a narrow scope and specialised SKILL.md.
- Cheaper models for simpler children; capable models only where needed.
### Team Coordination
If child agents duplicate work:
- Ensure skills read `.eve/coordination-inbox.md` at startRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.