Agent Context Harness

Per-turn router that sends each agent message to the current task, an existing parallel worker, or a new parallel session - context hygiene without compaction. Idea + prior-art scan.

About This Project

Agent-Context-Harness is a research and design project that explores how to keep coding-agent sessions clean when developers move between unrelated tasks within a single thread. The project proposes a per-turn router that classifies each incoming message as a continuation of the current task, a continuation of a task already owned by a worker, or a new task. New tasks spawn a parallel orchestrator instance on its own branch or worktree, with a manager view showing the resulting session, thread, and subagent tree. The stated goal is to reduce context degradation by starting fresh threads rather than repairing context after it has deteriorated.

The repository is written primarily in Python and contains a draft specification, a phased development plan, and a prior-art scan. A prior-art review dated 2026-10-16 found that Claude Code Projects already provides much of the core behaviour, leaving open an explicit, inspectable routing classifier with confidence scores and an evaluation set, a session-to-thread-to-subagent tree view, nesting, and a vendor-neutral harness. Later work includes a draft Claude Code hook that blocks an unrelated prompt, runs a clear command, and resends the prompt, along with a plan for a small local ONNX classifier. The project also references a public synthetic training dataset and a Hugging Face Space containing an int8 ONNX demo.

This project may interest developers who use coding agents for extended sessions and want to reduce context bloat, as well as researchers studying agent orchestration, task routing, and context management. It may also be useful to teams evaluating whether existing agent tooling meets their needs for inspectable routing and vendor independence.

Project Details

Explore More Projects