
ECC v2.2.1: The Agent Harness Optimization System Scaling Claude Code and Codex
Autonomous coding agents can write code quickly, but left to raw prompts, they stumble into familiar failure modes. They begin editing before inspecting requirements, generate expansive unverified diffs, skip test suites, hallucinate passing assertions, and repeat identical mistakes across separate terminal sessions.
The open-source ECC project (Everything Claude Code), created by maintainer Affaan M. and backed by a community of over 258,000 GitHub stars, tackles this discipline problem directly. Rather than treating an LLM harness as an isolated text generator, ECC wraps it in an explicit engineering lifecycle:
plan -> test -> implement -> review -> verify -> remember -> improve
With the release of version 2.2.1, the system formalizes cross-platform package distribution via ecc-universal, tightens shell command interception through GateGuard, and integrates security auditing via AgentShield.
The Architecture of an Agent Harness
Standard agent setups supply the model with a basic system prompt, bash access, and file editing tools. The model then decides its own strategy on every invocation. In contrast, ECC introduces a structured hierarchy of capabilities separated into distinct functional layers:
Spec-driven decomposition identifies acceptance criteria and checks for existing state before writing any source code.
Creates reproducible unit and integration tests that capture expected behavior and edge cases prior to implementation.
Applies minimal, contiguous diffs. Works alongside token-reduction proxies like RTK to conserve context capacity.
Pre-execution command filters block destructive operations while independent review subagents audit logic from a clean context.
Runs real repository test suites and commits learned project conventions and instincts for future agent runs.
Specialized Subagents and Granular Skills
ECC organizes its capabilities into 68 dedicated agents and 292 composable skills. Instead of forcing one generalist model to handle architectural design, database migrations, and frontend accessibility simultaneously, ECC routes sub-tasks to specialized profiles:
- Planning Agents: Spec decomposition, ADR (Architecture Decision Record) authoring, and task dependency mapping.
- Review Agents: Multi-axis verification assessing codebase standards, performance bottlenecks, and security boundaries.
- Build Repair Agents: Isolated terminal subagents that diagnose compilation failures and linters without contaminating the primary conversation context.
- Security Agents: Deep scanning for credential exposure, unsafe deserialization, and prompt injection vectors.
The design philosophy mirrors principles found in modular agent frameworks like Superpowers, but focuses specifically on production engineering workflows within existing terminal harnesses.
GateGuard: Intercepting Destructive Shell Execution
A recurring vulnerability in autonomous coding assistants is their willingness to execute destructive terminal commands when encountering unexpected errors. An agent attempting to resolve a dependency conflict might emit rm -rf node_modules or execute unvetted shell scripts piped from remote endpoints.
ECC addresses this with GateGuard, a deterministic command-governance engine that hooks directly into the harness execution loop:
- Destructive Pattern Analysis: GateGuard parses commands prior to invocation, rejecting commands that perform broad deletions, history rewrites (
git reset --hard), or dangerous system configurations. - PowerShell Obfuscation Prevention: In patch 2.2.1, GateGuard inspects dynamic variable assignments in PowerShell to prevent delayed or obfuscated invocations from bypassing checks.
- Root-Scoped Exemptions: Exemption rules use relative paths strictly bound within the repository root, stopping agents from creating exemptions that span root or parent directories.
- Fail-Closed Semantics: If an exemption pattern cannot be evaluated cleanly, the command is blocked and escalated to the operator.
| Security Component | Inspection Target | Enforcement Method | Default Policy |
|---|---|---|---|
| GateGuard | Shell commands (bash, sh, pwsh) | Pre-execution pattern interceptor | Block destructive patterns |
| AgentShield | Hook configs, MCP files, prompts | Static and heuristic validation | Fail closed on secret leaks |
| Ownership Hashes | User vs managed files | SHA-256 fingerprint tracking | Reject untracked collisions |
| Context Controls | Inbound file dumps, tool outputs | Token truncation and memory limits | Compress before context ingest |
AgentShield: Auditing the Agentic Attack Surface
As developer tooling integrates with the Model Context Protocol (MCP), agents gain access to local databases, external APIs, and browser automation drivers like cua-driver. This creates an expanded attack surface where malicious markdown files, contaminated logs, or rogue repositories can inject instructions into the LLM.
AgentShield acts as a static and runtime auditor for the agent environment. It inspects:
- Hook Configurations: Ensures third-party plugins cannot install background hooks that execute untracked binaries.
- MCP Server Definitions: Audits local
mcpServersconfigurations to verify that exposed endpoints adhere to least-privilege principles. - Secret Leakage: Scans outgoing tool arguments for private API keys, SSH keys, and environment variables.
- Payload Boundaries: In version 2.2.1, hook entrypoints enforce UTF-8-safe bounded reads to prevent denial-of-service or silent truncation on large JSON payloads.
Installation and Multi-Harness Deployment
ECC provides multiple setup paths depending on the host harness. The primary interface is the ecc-universal package distributed via npm.
Universal Guided Setup
For terminal-based installation and interactive configuration:
# Guided setup for Claude Code, Codex, and Kimi Code
npx ecc-universal@2.2.1 setup
# Run system diagnostic checks
ecc doctor
Native Claude Code Marketplace Integration
If working directly inside Claude Code, ECC can be installed as an in-session plugin:
/plugin marketplace add https://github.com/affaan-m/ECC
/plugin install ecc@ecc
Cross-Harness Support Matrix
While built natively around Claude Code and OpenAI Codex, ECC provides adapters for multiple agent runtimes:
| Harness Platform | Support Tier | Primary Integration Channel |
|---|---|---|
| Claude Code | Native | Plugin marketplace (ecc@ecc) and global CLI |
| OpenAI Codex | Native | CLI wrapper and configuration sync |
| Cursor | Adapter | Custom rules, prompt profiles, and hook shims |
| OpenCode | Adapter | Shell environment and subagent definitions |
| Gemini CLI / Antigravity | Adapter | Skill catalog import and system guidelines |
Practical Limitations and Operational Advice
While ECC provides substantial structure, engineering teams should recognize its operational boundaries:
- Context Window Overhead: Loading 68 subagent definitions simultaneously would consume an entire LLM context window. ECC uses selective on-demand loading, but poorly configured projects can still incur token bloat if too many rules are marked as always-active.
- Setup Dependency Requirements: The universal runner requires Node.js 18 or newer, Git on the system
PATH, and Claude Code 2.1 or newer. - No Automatic Problem Solving: ECC enforces process, not technical correctness. An agent following TDD can still write invalid tests if the developer does not provide clear acceptance criteria.
Conclusion
ECC marks a significant maturation in agentic development tooling. Moving away from casual, unconstrained prompting, it treats the agent harness as a predictable software system governed by explicit lifecycle gates, security verification, and persistent project memory. For teams running autonomous agents in production codebases, implementing these guardrails is no longer optional.