ai, agents, deep dive,

Deep Dive: ECC, a Manifest Installer That Asks Before It Hooks You

Cui Cui Follow Dec 05, 2026 · 5 mins read
Deep Dive: ECC, a Manifest Installer That Asks Before It Hooks You
Share this

affaan-m/ECC is an MIT-licensed bundle for coding-agent harnesses (about 317k stars per the GitHub API on 2026-12-05). At the commit I read, 4adeee6 (VERSION 2.2.3), the checkout has 328 skill directories, 72 agent files and 99 command files. Dropping all of that into an agent’s config would be a context disaster, so the interesting engineering is the installer. This is a source reading, plus a few dry runs and one refused install in a throwaway HOME.

Companion tutorial: how to install and use it is on Cui.Guru: Install only the agent-harness pieces you need with ECC.

The workflow in motion

Animated installer workflow: a CLI request is resolved into modules, becomes an operation plan, passes the hook consent gate, is applied with guarded writes, and is recorded in install-state, which doctor, repair and uninstall later read.

Architecture

Everything is data first. manifests/install-profiles.json maps profile names to module ids (in this checkout: minimal 5 modules, opencode 3, core 6, developer 9, security 7, research 9, full 36). manifests/install-modules.json defines 49 modules, each with paths, supported targets, dependencies, a cost and a stability. scripts/lib/install-manifests.js resolves a request into a plan.

The class names are my summary of the manifest and plan fields, not classes in the repo.

The core design idea

The installer separates three questions that usually collapse into one shell script: what do you want (profiles, modules, components), what will that touch (a plan you can preview), and may it run code on your machine (hooks, decided on its own).

First, dependency closure. resolveInstallPlan walks each requested module and its dependencies, rejects cycles, and refuses an exclusion that a kept module depends on:

// scripts/lib/install-manifests.js
if (visitingIds.has(moduleId)) {
  throw new Error(`Circular install dependency detected at ${moduleId}`);
}

and, when a kept module needs an excluded one, the error text starts Module ${dependencyOf} depends on excluded module ${moduleId}.

That is why --profile minimal --target claude names five modules but the plan selects seven: commands-core depends on shared-script-utils and workflow-quality on skill-unified-memory.

Second, hooks are a consent decision, not a module detail. The consent module lists six capability groups (source rewrites, command rewriting and process control, transcript-derived LLM egress, MCP process activity, automatic permission gates, session and cost records). applyInstallPlan begins with the gate:

// scripts/lib/install/apply.js
function applyInstallPlan(plan, dependencies = {}) {
  assertHookConsentReady(plan);
// scripts/lib/install/hook-consent.js (assertHookConsentReady, condensed)
if (!planMaterializesHookRuntime(plan)) {
  return;
}
if (plan.hookConsent === 'enabled') {
  return;
}
throw new Error(
  'This install would enable ECC\'s automatic hook runtime, which can:\n'
    + `${formatHookCapabilityDisclosure()}\n`
    + 'Confirm with --enable-hooks to install it, or --no-hooks ...'
);

install.sh allows --dry-run previews without either flag; the gate is enforced when applying. I ran ./install.sh --profile core --target claude (no dry run) with HOME=/tmp/fakehome: it printed the six-item disclosure, exited 1 and created no ~/.claude. With --no-hooks, withHookConsent rewrites the plan through stripHookRuntimeFromPlan, which removes hook operations and adds hooks-runtime to the excluded modules; the dry run showed it under Excluded modules. Combining --no-hooks with an explicit hooks-runtime module throws.

Third, ownership is recorded. After applying, the install-state stores a SHA-256 for each copied file (contentSha256). Uninstall can then keep what the user changed:

// scripts/lib/install-lifecycle.js
if (!currentDigest || currentDigest !== recordedDigest.toLowerCase()) {
  return uninstallRetained(operation);
}

A symlinked or drifted copy is retained instead of deleted. The hooks side uses stable ids: hooks/hooks.metadata.json is a sidecar aligned with hooks/hooks.json by event and index, with a fingerprint per entry, and scripts/ci/validate-hooks.js fails if the two drift. The hooks README gives the reason: Claude Code reports unknown keys in a plugin’s hooks.json, so ids and descriptions live beside it. In this checkout hooks.json has 28 matcher entries over eight events (for example 10 under PreToolUse and 8 under Stop).

Also visible in the code: Claude settings writes happen under a lock (runWithSettingsLock in apply.js), and the install-state validator is hand-written because, per its comment, the installer closure must not require a non-builtin package so that the vetted bytes are the installed bytes.

I did not run the full install, the hook runtime, or the test suite.

Takeaways

  • Make selection data (JSON manifests) separate from the code that copies files; plans become previewable and testable.
  • Resolve dependencies in the planner and fail loudly on exclusions that break them.
  • Gate automation that can rewrite commands or send transcripts behind an explicit, disclosed decision, and enforce it at the last responsible point before writing.
  • Record content digests at install time so uninstall can tell managed files from user edits.
  • A sidecar with stable ids and fingerprints lets you keep a strict third-party schema (hooks.json) while still tracking identity.

Want a safe, selective agent-harness rollout for your team? Get in touch at cui.guru/contact.

Join Newsletter
Get the latest news right in your inbox. We never spam!
Cui
Written by Cui Follow
Hi, I am Z, the coder for cuizhanming.com!

Click to load Disqus comments