# Context Budget Orchestrator — Long-Horizon AI Engine

> Zero-dependency Python AI orchestrator skill for multi-hour engineering projects. Enforces 68% context-budget gates, typed graph memory, AST parallel subagent waves, 30-CWE/OpenAPI security audits, ground-truth git verification, and interactive checkbox setup across 8+ AI CLIs.

Context Budget Orchestrator — Long-Horizon AI Engine is a paid AI agent skill on Agensi by Sushikim, in Agents & Orchestration. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $5 (one-time purchase)
- Creator: [Sushikim](https://www.agensi.io/creators/omakasekim)
- Category: [Agents & Orchestration](https://www.agensi.io/skills/agents-orchestration)
- Version: 1.0
- Last updated: 2026-11-25
- Security: scan passed (2026-11-25); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/context-budget-orchestrator-long-horizon-ai-engine
- Tags: ai-agents, code-review, security, orchestration, context-budget, subagents, security-audit, developer-tools

## About this skill

### Context Budget Orchestrator (v3.4 Universal)

A **zero-dependency, zero-bloat AI Orchestrator Skill** (Python 3.9+ stdlib only, optional `tiktoken`) designed for complex software engineering and research projects lasting **minutes to hours** across **Claude Code, Gemini CLI, OpenAI Codex CLI, GitHub Copilot CLI, OpenCode, OpenClaw, DeepSeek Harness, and xAI Grok CLI**.

#### Key Capabilities
1. **Automatic Interactive Feature Selector (`configure`)** — Launches a zero-dependency terminal checkbox TUI (`↑`/`↓`, `Space`, `Enter`) or structured chat multi-select schema on first run with 4 built-in presets (`minimal`, `standard`, `security`, `full`).
2. **Proactive 68% Context-Budget Gates (`inspect-session`, `gate-check`, `verify-handoff`)** — Reads exact provider JSONL token usage, flags edit-thrash loops & tool bloat, enforces a 68% safe ceiling, and verifies AST syntax/tests before any session handoff.
3. **AST Auto-Planning & File-Disjoint Parallel Waves (`auto-plan`, `plan-schedule`)** — Parses local Python/JS/TS import graphs into topological batches, auto-splits oversized tasks, and schedules safe parallel waves.
4. **Typed Context Graph & Subgraph-Pruned Cold Resume (`memory`, `record-decision`, `query-graph`, `resume-context`)** — Stores research findings, ADRs, execution receipts, and dead ends in `.agent_state/context_graph.json` and restores only the relevant upstream subgraph within a strict `--token-budget` cap.
5. **Specialist Subagent Delegation & Atomic File Leases (`delegate`, `lease`)** — Generates role-scoped briefs (`researcher`, `architect`, `implementer`, `reviewer`, `verifier`) with TTL file locks and ready-to-run dispatch commands for 8+ harnesses.
6. **Auto-Compressed Execution Logs (`exec-task`, `compress-output`)** — Runs builds and test suites while compressing noisy logs by 70–95% so stack traces never rot the context window.
7. **Metadata-Only Companion Skill Router (`discover-skills`)** — Scans YAML frontmatter across installed CLI skill directories without loading unused skill bodies.
8. **Built-In Defensive Security & Code Audit Engine (`audit`)** — 30 CWE static rules, custom JSON rules, OpenAPI contract audit, SHA-256 deduplication, baseline diffing (`--retest-new`), compliance mapping (OWASP Top 10 / PCI-DSS v4 / SOC 2 / ISO 27001), 7-Question Triage Gate, secret redaction, and 6 export formats (`json`, `sarif`, `html`, `junit`, `csv`, `md`).
9. **Ground-Truth Verification & Referee Kernel (`verify`)** — Adjudicates agent "done" claims against real git ancestry (`shipped`), catches hollow `assert True` tests (`commit-audit`), detects spin loops (`liveness`), arbitrates file/dependency locks (`arbitrate`), and manages human escalations (`escalate`).

- **Install:** 1-command macOS/Linux (`install.sh`) and Windows PowerShell (`install.ps1`) with `--doctor` diagnostics & 10 passing test suites.

## Requires

- Python 3.9+
- Optional: tiktoken (exact BPE tokenizer)
- Optional: Git (for ground-truth commit verification)

## Known limitations

Requires Python 3. TUI features need a live terminal TTY. Context budget gates are based on token estimates and active model limits.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Context Budget Orchestrator — Long-Horizon AI Engine skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does the Context Budget Orchestrator prevent an AI agent from 'forgetting' project requirements during long tasks?

The skill prevents model hallucinations and logic drift by enforcing a 68% token 'gate.' When reached, it automatically prunes low-priority data and persists the current architectural state into a graph-based memory, ensuring the agent never operates in a saturated context window.

### Can I use this skill with multiple AI agents like Claude Code and GitHub Copilot simultaneously?

Yes, it is a zero-dependency Python implementation designed to work across major CLI-based agents including Claude Code, Gemini CLI, OpenAI Codex, and GitHub Copilot CLI. It functions as an orchestration layer regardless of the underlying LLM provider.

### What components are included in the purchase of the Context Budget Orchestrator?

The package includes the core `budget_engine.py` script, the interactive feature picker for workspace initialization, the graph-based memory module, and a suite of automated verification tools for 'claim-vs-diff' auditing.

### What are the technical requirements for setting this up in my local development environment?

Setup is straightforward: ensure you have a Python 3 environment, run the interactive feature picker to map your local import graphs (Python/JS/TS), and configure your memory persistence settings. No complex external databases are required.

### How does the skill handle file-edit collisions when managing multiple subagents?

The Dependency Planning module analyzes your local import graphs to create a Directed Acyclic Graph (DAG) of tasks. This ensures that the agent works on architectural foundations first and uses file-lease locking to prevent subagents from editing the same file at once.

### What happens if I need to stop a project mid-way and resume it the next day?

The 'Atomic Handoff' feature saves the complete session state, including ADRs and worklogs, into an epoch-tracked file. You can then use the `resume-context` command in a fresh session to immediately reload the pruned subgraph and continue exactly where the agent left off.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
