Context Mode Output Sandbox
mksglu/context-mode
Routes large command, file, API and browser output through context-mode tools so only the needed result enters the agent's context, instead of dumping it via Bash.
Harness patterns for coding agents — memory, permissions, context engineering, delegation, skills, hooks, bootstrap.
$ npx skills add keli-wen/agentic-harness-patterns-skill --skill agentic-harness-patterns -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install keli-wen/agentic-harness-patterns-skill agentic-harness-patterns --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/keli-wen/agentic-harness-patterns-skill.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/agentic-harness-patterns .claude/skills/agentic-harness-patterns && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "agentic-harness-patterns" agent skill from https://github.com/keli-wen/agentic-harness-patterns-skill/tree/master/skills/agentic-harness-patterns into .claude/skills/agentic-harness-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "agentic-harness-patterns", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/keli-wen/agentic-harness-patterns-skill/tree/master/skills/agentic-harness-patternsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add keli-wen/agentic-harness-patterns-skill --skill agentic-harness-patterns -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install keli-wen/agentic-harness-patterns-skill agentic-harness-patterns --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/keli-wen/agentic-harness-patterns-skill.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/agentic-harness-patterns .agents/skills/agentic-harness-patterns && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "agentic-harness-patterns" agent skill from https://github.com/keli-wen/agentic-harness-patterns-skill/tree/master/skills/agentic-harness-patterns into .agents/skills/agentic-harness-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "agentic-harness-patterns", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add keli-wen/agentic-harness-patterns-skill --skill agentic-harness-patterns -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install keli-wen/agentic-harness-patterns-skill agentic-harness-patterns --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/keli-wen/agentic-harness-patterns-skill.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/agentic-harness-patterns .cursor/skills/agentic-harness-patterns && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "agentic-harness-patterns" agent skill from https://github.com/keli-wen/agentic-harness-patterns-skill/tree/master/skills/agentic-harness-patterns into .cursor/skills/agentic-harness-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "agentic-harness-patterns", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/keli-wen/agentic-harness-patterns-skill.git --path skills/agentic-harness-patterns--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add keli-wen/agentic-harness-patterns-skill --skill agentic-harness-patterns -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install keli-wen/agentic-harness-patterns-skill agentic-harness-patterns --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/keli-wen/agentic-harness-patterns-skill.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/agentic-harness-patterns .gemini/skills/agentic-harness-patterns && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "agentic-harness-patterns" agent skill from https://github.com/keli-wen/agentic-harness-patterns-skill/tree/master/skills/agentic-harness-patterns into .gemini/skills/agentic-harness-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "agentic-harness-patterns", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install keli-wen/agentic-harness-patterns-skill agentic-harness-patternsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add keli-wen/agentic-harness-patterns-skill --skill agentic-harness-patterns -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/keli-wen/agentic-harness-patterns-skill.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/agentic-harness-patterns .github/skills/agentic-harness-patterns && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "agentic-harness-patterns" agent skill from https://github.com/keli-wen/agentic-harness-patterns-skill/tree/master/skills/agentic-harness-patterns into .github/skills/agentic-harness-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "agentic-harness-patterns", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add keli-wen/agentic-harness-patterns-skill --skill agentic-harness-patterns -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install keli-wen/agentic-harness-patterns-skill agentic-harness-patterns --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/keli-wen/agentic-harness-patterns-skill.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/agentic-harness-patterns .opencode/skills/agentic-harness-patterns && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "agentic-harness-patterns" agent skill from https://github.com/keli-wen/agentic-harness-patterns-skill/tree/master/skills/agentic-harness-patterns into .opencode/skills/agentic-harness-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "agentic-harness-patterns", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
agentic-harness-patternsHarness patterns for coding agents — memory, permissions, context engineering, delegation, skills, hooks, bootstrap.
Agentic Harness Patterns is an agent skill from keli-wen/agentic-harness-patterns-skill. Harness patterns for coding agents — memory, permissions, context engineering, delegation, skills, hooks, bootstrap.
Its SKILL.md is about 4.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 15 other files, including reference files (for example `metadata.json`, `references/agent-orchestration-pattern.md` and `references/bootstrap-sequence-pattern.md`).
It sits in Agent Workflows, covering Context engineering. The repository describes itself as: Agent skill for harness engineering — memory, permissions, context engineering, multi-agent coordination. Distilled from Claude Code, with Codex CLI and Gemini CLI on the… The licence is MIT.
6 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 17549f5. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Agentic Harness Patterns loads about 4.4k tokens when it runs, and up to ~40k if it reads all its reference files. Until then it costs about 35 tokens; SKILL.md has 2,211 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from keli-wen/agentic-harness-patterns-skill at commit 17549f5, republished under its MIT licence (© keli-wen). 2,211 words, ~4,375 tokens.
.claude/skills/agentic-harness-patterns/SKILL.md (or your agent's skills folder). This skill also uses 13 other files; get the full folder from GitHub.Production AI coding agents are not just an LLM calling tools in a loop. The harness — memory, skills, safety, context control, delegation, and extensibility — is what separates a demo from a production system.
For: Engineers building or extending coding-agent runtimes, custom agents, or advanced multi-agent workflows. Not for: Prompt engineering, model selection, generic software architecture, or LLM API basics.
All principles are distilled from production runtime decisions. Claude Code is used as grounding evidence, not as the only possible implementation.
| If you want to... | Read |
|---|---|
| Make the agent remember and improve over time | Memory |
| Package reusable workflows and expertise | Skills |
| Let the agent use tools powerfully but not dangerously | Tools and Safety |
| Give the agent the right context at the right cost | Context Engineering |
| Split work across multiple agents without losing control | Multi-agent Coordination |
| Extend behavior with hooks, background tasks, or startup logic | Lifecycle and Extensibility |
Before you start building: Read the Gotchas — these are the non-obvious failure modes that cost the most time.
User problem: "My agent forgets corrections and project rules between sessions."
Golden rule: Separate what the agent knows (instruction memory) from what the agent learns (auto-memory) from what the agent extracts (session memory). Each layer has different persistence, trust, and review needs.
When to use: Any agent that operates across multiple sessions or needs to accumulate project-specific knowledge over time.
How it works:
Start here: Define your memory layers (instruction, auto, extraction). Implement the two-step save invariant (topic file, then index). Add background extraction only after the core write path is stable.
In Claude Code: Use
/rememberto audit and promote auto-memory entries across layers.
Tradeoffs:
Go deeper: references/memory-persistence-pattern.md
User problem: "I want my agent to reuse workflows and domain knowledge without re-explaining them every time."
Golden rule: Skills are lazy-loaded instruction sets, not eagerly injected prompts. Discovery must be cheap (metadata only); the full body loads only on activation.
When to use: Any agent that needs reusable, composable workflows activating on matching user intent.
How it works:
Start here: Choose a metadata format (frontmatter recommended). Implement two-phase discovery: cheap listing at startup, lazy body loading on invocation. Set a per-entry character cap before your catalog grows.
Tradeoffs:
Go deeper: references/skill-runtime-pattern.md
User problem: "I want my agent to use tools powerfully, but not dangerously."
Golden rule: Default to fail-closed. Tools are serial and gated unless explicitly marked safe for concurrency and approved by the permission pipeline.
When to use: Any agent runtime that needs tool registration, concurrency control, or permission gating.
How it works:
Start here: Route every tool call through one permission gate. Default to fail-closed (deny/ask). Add bypass-immune rules for protected paths before shipping any auto-approve mode.
In Claude Code: Use
/update-configto configure permission rules and hooks.
Tradeoffs:
Go deeper: references/tool-registry-pattern.md | references/permission-gate-pattern.md
User problem: "My agent either sees too much, too little, or the wrong thing."
Golden rule: Treat context as a budget, not a dump. Every token in the window should earn its place through one of four operations: select, write, compress, or isolate.
When to use: Any agent whose performance degrades in long sessions, whose delegated work pollutes the parent context, or whose startup is slow due to eager context loading.
How it works:
Start here: Audit your current context cost per turn. Apply hard caps to every variable-length block. Add truncation recovery pointers (tell the model which tool to call for full output) before enabling any compression.
Tradeoffs:
Go deeper: references/context-engineering-pattern.md (index) | select | compress | isolate
User problem: "I want parallelism, specialization, and coordination without chaos."
Golden rule: The coordinator must synthesize, not delegate understanding. "Based on your findings, fix it" is an anti-pattern — the coordinator should digest worker results into precise specs before dispatching implementation.
When to use: When a task is too large for a single agent, when you need parallel exploration, or when you want persistent specialized teammates.
How it works:
Three delegation patterns serve different task shapes:
| Pattern | Context sharing | Best for |
|---|---|---|
| Coordinator | None — workers start fresh | Complex multi-phase tasks (research → synthesize → implement → verify) |
| Fork | Full — child inherits parent history | Quick parallel splits sharing loaded context |
| Swarm | Peer-to-peer via shared task list | Long-running independent workstreams |
Key constraints:
Start here: Pick one delegation pattern and implement it fully before mixing patterns. Write every sub-agent prompt as a self-contained document. Add a synthesis step between research and implementation workers — this is where the orchestrator adds value.
Implementation checklist for the coordinator pattern:
Tradeoffs:
Go deeper: references/agent-orchestration-pattern.md
User problem: "I need hooks, background tasks, and a clean startup sequence."
Golden rule: Extensibility is an injection point, not an inheritance hierarchy. Hooks attach side effects at lifecycle moments; tasks track async work with strict state machines; bootstrap layers initialization sequentially with memoized stages.
When to use: When you need to extend agent behavior without modifying core code, track long-running background work, or structure initialization across multiple entry modes.
How it works:
Start here: Route all hooks through a single dispatch point. Implement the trust gate before adding any external hook type. Register cleanup handlers during init, not at usage sites.
In Claude Code: Use
/update-configto configure hooks (pre/post tool execution, prompt submission).
Tradeoffs:
Go deeper: references/hook-lifecycle-pattern.md | references/task-decomposition-pattern.md | references/bootstrap-sequence-pattern.md
Non-obvious principles that will cause bugs if you violate them:
Concurrency classification is per-call, not per-tool. A tool may be safe for some inputs and unsafe for others. Don't assume a tool's concurrency behavior is static — the runtime decides per invocation.
Permission evaluation has side effects. The permission checker tracks denials, transforms modes, and updates state. Don't treat it as a pure lookup function.
Most async work skips the "pending" state. In practice, work units register directly as "running." Don't build UIs that assume every work unit starts pending.
Fork children must not fork. The recursive guard preserves a single-level invariant. The fork tool stays in the child's tool pool (for prompt cache sharing) but is blocked at call time.
Context builders are memoized but manually invalidated. Add a context source without adding a corresponding invalidation point, and the model sees stale data for the entire session.
Memory indexes have hard caps. Entries beyond the cap are silently truncated. Without periodic cleanup, recent entries become invisible.
Skill listing budgets are tight. Descriptions are concatenated and capped per entry. Front-load the most distinctive trigger language — the tail gets cut.
Hook trust is all-or-nothing. If the workspace is untrusted, the entire hook system is disabled, not just individual suspicious hooks.
The default permission for tools is "allow." Tools that don't implement custom permission logic delegate entirely to the rule-based system. Override only when you need tool-specific gates (path ACLs, quotas, etc.).
Eviction requires notification. A terminal work unit is only GC-eligible after the parent has received the completion signal. Evicting before notification creates a race where the parent can never read the result.
This skill is about the harness around an agent, not:
If your question is about the model itself rather than the system around it, this skill does not apply.
© keli-wen, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 13 other files (references) in skills/agentic-harness-patterns of keli-wen/agentic-harness-patterns-skill.
Open the folder on GitHubat commit 17549f5
Agentic Harness Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Agentic Harness Patterns this skillkeli-wen/agentic-harness-patterns-skill | 305 | — | ~4.4k | Automated safety check: Pass | MIT | |
| Context Mode Output Sandboxmksglu/context-mode | 26k | — | ~4.1k | Automated safety check: Pass | Custom licence | |
| Memori Long-Term MemoryMemoriLabs/Memori | 17k | — | ~2k | Automated safety check: Notes | Custom licence | |
| Picoclaw Skill Creatorsipeed/picoclaw | 30k | — | ~4.4k | Automated safety check: Pass | MIT | |
| ccc Semantic Code Searchcocoindex-io/cocoindex-code | 2.7k | — | ~938 | Automated safety check: Pass | Apache-2.0 | |
| Context Mode for Antigravity CLImksglu/context-mode | 26k | — | ~850 | Automated safety check: Pass | Custom licence |
mksglu/context-mode
Routes large command, file, API and browser output through context-mode tools so only the needed result enters the agent's context, instead of dumping it via Bash.
MemoriLabs/Memori
Connects Claude Code to Memori Cloud for long-term memory, recalling stored context before substantive replies and saving new context afterward.
sipeed/picoclaw
Guidance for creating, updating and reviewing Picoclaw skills, from the SKILL.md structure to organizing bundled scripts, references and assets.
cocoindex-io/cocoindex-code
Semantic code search and index management with the ccc CLI: the agent initializes, indexes and queries the project by concept, filtering by language or path.
mksglu/context-mode
Routing rules for using context-mode MCP tools in Antigravity CLI: sandboxed code runs, file analysis, indexed search and web fetches that keep large output out of the conversation.
alexgreensh/token-optimizer
Audit a Claude Code or Codex setup for context-window waste, then fix it and measure the savings.
keli-wen/agentic-harness-patterns-skill
AI Agent Harness 设计模式 — 记忆、权限、上下文工程、委派、技能、 Hook、Bootstrap。中文版。
Categories
Harness patterns for coding agents — memory, permissions, context engineering, delegation, skills, hooks, bootstrap. Agentic Harness Patterns is an agent skill from keli-wen/agentic-harness-patterns-skill. Harness patterns for coding agents — memory, permissions, context engineering, delegation, skills, hooks, bootstrap.
Agentic Harness Patterns fits situations like: tasks that involve Context engineering.
Run `npx skills add keli-wen/agentic-harness-patterns-skill --skill agentic-harness-patterns -a claude-code`. Or copy the skill folder (skills/agentic-harness-patterns in keli-wen/agentic-harness-patterns-skill) into .claude/skills/agentic-harness-patterns in your project. Claude Code loads it when a task matches its description.
Run `npx skills add keli-wen/agentic-harness-patterns-skill --skill agentic-harness-patterns -a codex`. Or copy the skill folder (skills/agentic-harness-patterns in keli-wen/agentic-harness-patterns-skill) into .agents/skills/agentic-harness-patterns in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add keli-wen/agentic-harness-patterns-skill --skill agentic-harness-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/agentic-harness-patterns, .gemini/skills/agentic-harness-patterns, .github/skills/agentic-harness-patterns and .opencode/skills/agentic-harness-patterns in your project.
SKILL.md names no scripts, command-line tools or credentials: Agentic Harness Patterns is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Agentic Harness Patterns is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 4.4k tokens (SKILL.md is roughly 18k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 35k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Agentic Harness Patterns: Context Mode Output Sandbox (mksglu/context-mode, 26k stars), Memori Long-Term Memory (MemoriLabs/Memori, 17k stars), Picoclaw Skill Creator (sipeed/picoclaw, 30k stars) and ccc Semantic Code Search (cocoindex-io/cocoindex-code, 2.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
keli-wen (a GitHub user) maintains it in keli-wen/agentic-harness-patterns-skill, which has 305 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on April 2, 2026.
Source: keli-wen/agentic-harness-patterns-skill on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.