Skip to main content Switch to mobile version agent-efficiency 2.0.0 Zero-dependency local context index, log compression, session memory, context doctor, and lean MCP server for AI coding agents.
pip install agent-efficiency==2.0.0 Copy PIP instructions
Stop paying your AI coding agent to re-read the same files and paste 3,000-line test logs into every turn.
Cut noisy test-log & session-resume overhead by up to 94–97%, trim code-reading tokens by 20–80% even against disciplined rg + range-read agents, and audit your real IDE token waste & always-on context bloat in 3 seconds.
Works with Claude Code, Cursor, Codex, Gemini CLI, Antigravity, OpenCode, Windsurf, Copilot, and custom LLM pipelines. Runs 100% locally on Python 3.9+ standard library + SQLite FTS5 (zero required packages, ~16–21 MB peak RAM, no background daemon).
10-Second Try-It-Now (Zero Repo Changes, Read-Only)
See what your coding agents actually burned last week — and how many always-on tokens your rules, skills, and MCP servers tax every single turn:
# Run directly from PyPI via uvx (zero install, strictly read-only): uvx agent-efficiency audit uvx agent-efficiency doctor # Or install/run directly from GitHub main: # uvx --from git+https://github.com/Jeager070/agent-efficiency-skills.git ae audit
1-Command Setup (ae init)
Option A — Install via pipx / pip + ae init (Recommended)
pipx install agent-efficiency # Optional native tree-sitter AST upgrade for JS/TS/Go/Rust/Java: # pipx install "agent-efficiency[ast]" # Or install directly from GitHub main: # pipx install git+https://github.com/Jeager070/agent-efficiency-skills.git # Auto-detects Claude Code, Cursor, Codex, Gemini, OpenCode, Windsurf & Copilot: ae init # Skills (--profile ide) + ae CLI + rules + repo index ae init --enforce # Recommended v2.0: MCP (core) + ae_gate.py PreToolUse + hard rules ae init --hooks # + Non-destructive hooks (PreToolUse in safe hint-only mode) ae init --hooks --auto-wrap # + Explicit opt-in: auto-wrap simple pipe-free test/build cmds ae init --mcp # + Built-in lean MCP (`ae mcp --profile core`: 8 tools, <850 tok) Option B — From a Local Clone (No pipx/uvx Needed)
git clone https://github.com/Jeager070/agent-efficiency-skills.git cd agent-efficiency-skills python3 scripts/ae_init.py . --hooks # Or target a single runtime explicitly: python3 scripts/install.py --runtime claude --profile ide --install-cli --install-rules --force python3 scripts/install.py --runtime cursor --profile ide --install-cli --install-rules --force Option C — Claude Code Plugin Marketplace
This repository ships .claude-plugin/plugin.json and .claude-plugin/marketplace.json:
/plugin marketplace add Jeager070/agent-efficiency-skills /plugin install agent-efficiency Why It Actually Gets Used (Not Forgotten Like Normal Skills)
Real SessionStart trigger (Claude Code & Gemini CLI) + Hookless-IDE setup: Hook-capable clients (ae init --hooks): SessionStart runs agent_state.py session-start --auto-index automatically at turn 0, injecting PROJECT_MAP.md, recent git activity, and active checkpoints/handoffs directly into the starting context so the agent skips ls/find without relying on prompt memory.
Hookless IDEs (Antigravity, Cursor, Codex, Windsurf, Copilot): ae init installs the short workflow block (rules/AGENT_RULES.md) into GEMINI.md / .cursor/rules/agent-efficiency.mdc (alwaysApply: true) / AGENTS.md / copilot-instructions.md — kick off a fresh window with ae resume (or bind it as your first prompt/workflow).
Safe-by-default PreToolUse / BeforeTool hook (scripts/pretool_hook.py): Default (--mode hint): Never rewrites commands silently. Adds a concise non-blocking tip on noisy test/build runs and nudges when the agent is about to re-read an unchanged >150-line file in full.
Explicit opt-in (ae init --auto-wrap / --mode rewrite): Transparently wraps only simple, pipe-free, non-interactive test/build commands (pytest, npm test, cargo test, go test, vitest, tsc, etc.) through ae run. Commands with pipes (|), redirects (>), chains (&&/;), subshells, complex env prefixes, or interactive/watch flags (-i, --pdb, --watch, -w) are never touched.
Lean 7-tool MCP Core Profile (--profile core): Full 39-tool MCP servers cost ~3,274 schema tokens every turn. ae init --mcp and setup_hooks.py mcp-config default to --profile core (7 tools, ~622–637 tokens — −81% schema tax).
Live Savings Counter, Actionable Doctor & Clean Rollback: Every ae run, ae slice, and ae outline logs gross local I/O savings (ae savings --statusline); ae doctor lists the Top 10 heaviest skills with exact paths and archives unused bloat safely (ae doctor --prune --apply); ae install-status and ae uninstall inspect and cleanly remove every installed component. ae: -142.3k tok (-86%, ~$0.43 saved / 7d)
Core IDE Skills vs. Optional Pipeline Skill
local-context-index: Incremental SQLite FTS5 index (schema v5, CamelCase/snake_case/kebab-case splitting), static symbol call graph, monorepo alias resolution (tsconfig.json, package.json workspaces, go.mod), multi-target live slice (a.py:foo b.py:10-40), diff-pack, trace-pack, tests-for, and run (80–95% log compression + auto-sliced failing stacktraces).
adaptive-orchestration-handoff: Zero-friction checkpoint (CHECKPOINT.md), 1-call session-start/brief with live SHA drift detection, ADRs (DECISIONS.md), anti-duplication dead-end memory, read-only IDE audit (Claude Code, Antigravity, Codex, Gemini, Cursor, OpenCode, Cline), and doctor (always-on context bloat, MCP schema tax, cache-busters & secret leaks). Optional subagent/pipeline routing in route_task.py.
prompt-cache-manager (optional): L0/L1 prefix linting, provider cache payload builders (Anthropic, OpenAI Chat & Responses API, Gemini, Bedrock), and verified telemetry tracking.
Reproducible Benchmarks & End-to-End LLM A/B Eval
1. Deterministic Token & Signal-Preservation Benchmarks (Zero API Cost)
Run on any local or open-source repository (non-destructive copy in a temp dir) — measures token reduction against both naive reads and a disciplined rg + 90-line range-read baseline, and verifies deterministic diagnostic & fixture-warning preservation (target symbol definitions, AssertionError, fixture warning 35+ lines above the traceback, and exact >>> crash line preserved):
Scope note: These zero-API-cost benchmarks measure token reduction and deterministic signal preservation, not LLM solve rate. To measure end-to-end Pass@1 solve rate, turn count, and net cached API cost with real models, run the A/B harness below.
python3 benchmarks/benchmark_efficiency.py --repo . --format md # Benchmark multiple OSS repos side by side (e.g. local clones of Flask & a TS app): python3 benchmarks/benchmark_efficiency.py --repo /path/to/flask --repo /path/to/ts-app --format md 2. End-to-End LLM A/B Evaluation (benchmarks/eval_llm_ab.py)
Evaluates 6 realistic multi-file bugfix tasks across Python & TypeScript — including deliberate tunnel-vision stress cases (fixture warning 35+ lines before traceback, module-level constant side effects, enclosing class __init__ regressions, TypeScript interface/DI defaults) — comparing a baseline arm (grep + read_file + raw tests) against an ae arm (ae search/slice --with-header/run --verbose + full-read escape hatch) on Pass@1 solve rate, turns, context escalations, cache hit rate, and USD cost:
# Offline deterministic harness check (0 API cost — verifies all 6 bugs fail & patches pass): python3 benchmarks/eval_llm_ab.py --mode mock --format md # Live end-to-end A/B evaluation against real LLMs (requires ANTHROPIC_API_KEY, GEMINI_API_KEY, OPENAI_API_KEY, or litellm): python3 benchmarks/eval_llm_ab.py --mode live --model claude-sonnet-4-20250514 --format md python3 benchmarks/eval_llm_ab.py --mode live --model gemini-2.5-flash --format md python3 benchmarks/eval_llm_ab.py --mode live --model gpt-4o --format md Live API benchmark policy: No live API numbers are hardcoded here until executed against live provider keys; run --mode live locally to record verified model-specific Pass@1, turn, cache-hit, and USD results.
Measured on agent-efficiency-skills (78 files, 617 symbols, Apple Silicon, Python 3.9 stdlib)
Synthetic 35-File Multi-Language Suite & 1,000-File Scaling (python3 benchmarks/benchmark_efficiency.py)
Scaling (1,000 files / 10,000 symbols, Apple Silicon): cold index 1.05 s, incremental edit 166 ms, FTS5 search 3.3 ms, call-graph 3.0 ms, SQLite DB 6.2 MB.
Honest scope: Against an already disciplined agent using rg + tight line-range reads, typical everyday code-reading savings are 20–50% on medium/large repos (and higher on multi-file symbol lookups). The largest universal savings come from ae run, ae tests-for, ae doctor (cutting always-on MCP/rules tax), and ae checkpoint/brief across compactions. On tiny <15-file single-file edits, read directly.
Daily CLI Reference (ae)
# Onboarding, Waste Audit, Diagnostics & Clean Rollback ae init [--hooks] [--auto-wrap] [--mcp] # Auto-detect IDEs & install skills/CLI/rules/hooks ae install-status [--format card|json] # Inspect active skills, rules, hooks, MCP & repo state (also `ae status --setup`) ae uninstall [--dry-run] [--purge-repo-state] # Non-destructively remove AE rules blocks, hooks, skills & CLI ae audit [--limit 6 --format card|compact|json] # Visual IDE transcript waste, USD cost & weighted trends ae doctor [--prune [--apply]] [--format card] # Always-on bloat, top-10 skill offenders, cache-busters & safe archive ae savings [--days 7] [--statusline] # Gross I/O token & USD savings receipt / statusline string # Minimal Code Context, Logs & Affected Tests ae index # Incremental FTS5 + call-graph index (.git/info/exclude) ae search "token refresh" # Finds refreshAccessToken via identifier splitting ae outline src/auth.py # Imports + symbol signatures & line ranges ae slice a.py:foo b.py:Service.bar --with-header --max-tokens 1200 ae deps src/auth.py --depth 2 # Import blast radius (tsconfig / workspaces / go.mod) ae callgraph verify_token --depth 2 [--lsp] # Symbol callers/callees (syntax name-matched, or type-checked via `--lsp`) ae tests-for # Minimal affected test files + suggested runner cmd ae run [--verbose] -- pytest -q # Compress logs, keep fixture warnings & auto-slice crashes ae trace-pack --file err.log # Raw stacktrace -> exact in-repo failing slices ae diff-pack --base HEAD --budget-tokens 2500 # Budgeted diff + touched symbols + callers # Session Memory & Handoff ae resume # 1-call new-window resume (auto-index + PROJECT_MAP + git + brief) ae checkpoint --note "Ready for review" # Zero-friction checkpoint (CHECKPOINT.md) ae brief # 1-call state/checkpoint brief with live SHA drift check ae handoff --summary "..." --next "..." # Zero-reexploration HANDOFF.md Optional Hooks & Lean MCP Setup
# Auto-reindex on git commit/checkout/merge (worktree-aware; preserves existing hooks): python3 scripts/setup_hooks.py git /path/to/repo # Merge Claude Code or Gemini CLI hooks (safe hint-only PreToolUse by default; pass --auto-wrap to opt in): python3 scripts/setup_hooks.py runtime /path/to/repo --client claude --write python3 scripts/setup_hooks.py runtime /path/to/repo --client claude --auto-wrap --write # Print lean 7-tool MCP config (~622 schema tok vs ~3,274 for --profile full): python3 scripts/setup_hooks.py mcp-config --client claude --profile core python3 mcp/server.py --profile core --list-tools Guardrails, Prompt-Cache Hygiene & Runtime Support Tiers
Anti-Tunnel-Vision Safeguards: ae run preserves fixture/setup warnings above errors, emits an explicit omission notice if warnings exceed budget, archives the complete redacted full_log, and supports --verbose for wider pre-error context.
ae slice --with-header prepends compact file imports, module-level constants, and the enclosing class header within the token budget; ae trace-pack uses an asymmetric pre-crash window (-6/+3) on long functions.
rules/AGENT_RULES.md enforces an explicit escalation rule: if root cause is unclear or a fix fails once, widen context (--with-header, --verbose, full_log, or full file read) instead of burning extra turns.
Prompt-Cache Golden Rule: Never @import mutable .agent-state/* files (CHECKPOINT.md, HANDOFF.md, CURRENT_STATE.md) into always-on CLAUDE.md / AGENTS.md / .cursor/rules/. ae doctor and ae cache lint flag dynamic state includes automatically, and ae brief omits ticking TTL countdowns so repeated briefs stay byte-stable. (ae savings tracks gross local I/O reduction; verify net provider cache hit rate via ae audit.)
Core vs. Runtime Support Tiers (Maintenance Boundary): Core engine (runtime-agnostic): ae index, search, outline, slice, deps, callgraph, tests-for, run, trace-pack, diff-pack, doctor, checkpoint, brief depend only on local files + Git and never break from IDE format changes.
Tier 1 (CI fixture-verified adapters): Transcript parsers & hooks for Claude Code, Gemini CLI / Antigravity, and Codex.
Tier 2 (Best-effort / community adapters): Cursor, OpenCode, Windsurf, Copilot, Cline (path mappings + best-effort ae audit parsers). If any client changes its log schema, ae audit surfaces an explicit Schema-Drift Warning instead of silently reporting zero usage.
Parser Fidelity, Trust & Safety Guarantees
Python (.py, .pyi): Full stdlib ast parsing (analysis_confidence: "ast", resolution_mode: "ast-syntax-name-matched") including decorators, base classes, module-level wiring, and DI/callback arguments (Depends(verify_token)).
JS/TS/TSX/Go/Rust/Java/Kotlin/Swift/C/C++/Ruby: Zero-dependency default uses comment/string-aware brace matching + dynamic import() + JSX + @Decorator heuristics (analysis_confidence: "heuristic"). Install optional pip install "agent-efficiency[ast]" (tree-sitter-language-pack) for native tree-sitter syntax ASTs, and pass ae callgraph --lsp when a local LSP server (typescript-language-server, pyright-langserver, rust-analyzer, gopls) is installed for type-checked references (resolution_mode: "type-checked-lsp").
Zero code execution during indexing & local privacy: Strictly static parsing with PRAGMA trusted_schema=OFF; zero telemetry or outbound network calls (ae audit reads local transcripts strictly read-only). See SECURITY.md and CHANGELOG.md.
Smart secret exclusion & code-safe redaction: skips .env* (except .example/.sample/.template), private keys, *.tfvars.json, *.tfstate*, secret config files, binaries, nested .gitignore (! negation supported), and symlinks pointing to secrets — redacting hardcoded literals without corrupting code.
Prompt-injection isolation & atomic locking: repository snippets are framed inside
python3 scripts/sync_shared.py --check python3 scripts/validate_skills.py python3 -m unittest discover -s tests -v python3 mcp/server.py --profile core --list-tools python3 benchmarks/benchmark_efficiency.py --repo . --format md License
MIT © 2026 Jeager070
Released: Nov 28, 2026
Both files in this release have provenance metadata.
View provenance details
ai claude-code codex coding-agent cursor fts5 gemini mcp skills tokens
Development Status 4 - Beta
Intended Audience Developers
License OSI Approved :: MIT License
Programming Language Python :: 3
Topic Software Development :: Quality Assurance
Release files for agent-efficiency 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 575.7 kB
Release files / agent_efficiency-2.0.0.tar.gz
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Release files / agent_efficiency-2.0.0-py3-none-any.whl
Security for agent-efficiency 2.0.0
Both files in this release have been uploaded with provenance metadata.
With provenance agent_efficiency-2.0.0.tar.gz Nov 28, 2026
Attestation for agent_efficiency-2.0.0.tar.gz
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release history Release notifications | RSS feed
Nov 28, 2026 2 release files Full provenance
Nov 27, 2026 2 release files Full provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation
Deployed from fc0d8e6











