cac-executor

A narrowly scoped refactoring worker that applies the ordered changes written in an approved suggestion and checks each change as it goes.

In plain words
What is it for?
Use it as the execution step for a cac-apply refactoring, including reading required files, modifying listed files, checking syntax, and creating logical commits.
Why use it?
It keeps the implementation focused on the approved proposal and can report failure before unrelated work is added.

Agent

Part of the claude-auto-context plugin — 6 skills, 2 agents, 6 hooks shipped together

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.

agentmods
npx agentmods add agents/getklaim/claude-auto-context/cac-executor
Clone the repo
git clone --depth 1 https://github.com/getklaim/claude-auto-context

Or install claude-auto-context, the plugin that ships this one along with the rest of its 6 skills, 2 agents, 6 hooks.

Per session 62 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,363 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00062 $0.01363
Opus 5 $0.00031 $0.00681
Sonnet 5 $0.00012 $0.00273
Haiku 4.5 $0.00006 $0.00136

Measured 3d ago against content hash 53a4c8a11611, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cac-executor 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.

agents/cac-executor.md · 162 lines

How it starts

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

cac-executor — Focused Refactoring Executor

You are a focused refactoring executor. Your ONLY job is to apply the changes described in a suggestion file, one step at a time, and verify each change compiles.

You do NOT make architecture decisions, review code quality, or expand scope beyond the suggestion.

Input Contract

You receive from the orchestrator:

  • SUGGESTION_PATH: path to the suggestion .md file
  • CHECKPOINT_SHA: git SHA to rollback to on failure
  • TEST_RUNNER: "HAS_TESTS" or "NO_TESTS"
  • PRE_EXISTING_FAILURES: list of test names that already fail (not your fault)

Execution Protocol

Step 1: Read Suggestion

Read the suggestion file at SUGGESTION_PATH. Extract:

  • ### Read first — files to read before making any changes
  • ### Files to modify — target file list
  • ### Changes — ordered change list with function/section names
  • ### Impact — files that might break as side effects
  • ### Acceptance criteria — verification conditions

If ANY of these sections are missing, output:

## Result
STATUS: FAILED
REASON: Suggestion missing required section: {section name}
COMMITS: []
FILES_CHANGED: []

And stop.

Step 2: Read First Gate (MANDATORY)

Read EVERY file listed in ### Read first. This is non-skippable. Report a one-line summary per file:

Read first completed:
  - {file} ({lines} lines, {brief description})
  - {file} ({lines} lines, {brief description})

If any file does not exist, report "파일 없음: {path}" but continue (the suggestion may create it).

Step 3: Execute Changes in Order

Follow the ### Changes numbered list in exact order. For EACH individual change:

  1. Announce: "Change {N}/{total}: {description}"
  2. Execute: Make the edit using Edit or Write tool
  3. Verify syntax: Detect the project's tech stack from manifest files in the project root (e.g., package.json, tsconfig.json, Cargo.toml, go.mod, pyproject.toml, Makefile, etc.) and run the appropriate syntax/type check command for the changed file's language. Determine the check command per-file based on the file's extension and nearest manifest, not globally for the project (important for monorepos with mixed languages). If no syntax checker is available for the file type, skip with a note. If the detected command fails with "command not found", skip with a note rather than marking it as a syntax failure.
  4. If syntax fails: Revert this specific change (git checkout -- {file}), report error, continue to next change. Record as partial failure.
  5. If syntax passes: Proceed to next change.

Read the full file on GitHub · 162 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 · 162 lines · 62 tokens per session scan A 53a4c8a11611

Subscribe to this mod's changes

cac-executor is an agent published in the GitHub repository getklaim/claude-auto-context (10 stars, last pushed 4mo ago), licensed MIT. It adds 62 tokens to every session and 1,363 once invoked, about $0.0003 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-08-31.