OpenAgentsControl: Command for Claude Code

.opencode/command/build-context-system.md

build-context-system is a command for Claude Code, OpenCode from darrenhinde/OpenAgentsControl. It costs 14 tokens per session (6,867 once invoked), scanned A, original, MIT.

An interactive builder for creating a structured AI setup tailored to a particular field or project. It checks any existing .opencode files before creating a new setup or combining it with what is already there.

In plain words
What is it for?
Use it to gather requirements and create agents, commands, context files, and workflows for a domain-specific AI system.
Why use it?
It removes the need to design the folder structure and context files by hand. It also helps avoid overwriting existing agents, commands, and workflows.

Command for Claude CodeOpenCode

Written for Claude Code and OpenCode: $ARGUMENTS substitution, but also installed under .opencode/. Also seen: mentions subagents; mentions OpenCode.

This is darrenhinde/OpenAgentsControl's own configuration. It tells Claude Code and OpenCode how to work on OpenAgentsControl itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything OpenAgentsControl configures →

About the project

OpenAgents Control is a framework that adds plan-first, approval-based coding workflows to OpenCode, an AI coding framework. Developers and teams use it to make agents follow shared coding patterns, work across several programming languages, and validate changes through testing and review. The catalogue includes its agents, skills, commands, plugin, and hook.

darrenhinde/OpenAgentsControl · 4,910 stars · on GitHub

Reuse

Borrowing it

Nothing to install: this file belongs to darrenhinde/OpenAgentsControl. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/darrenhinde/OpenAgentsControl/main/.opencode/command/build-context-system.md
Clone the repo
git clone --depth 1 https://github.com/darrenhinde/OpenAgentsControl

Made for: Claude Code, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for build-context-system

README.md
[![agentmods](https://agentmods.dev/badge/commands/darrenhinde/openagentscontrol/build-context-system/github.svg)](https://agentmods.dev/commands/darrenhinde/openagentscontrol/build-context-system)
Your own site
<a href="https://agentmods.dev/commands/darrenhinde/openagentscontrol/build-context-system"><img src="https://agentmods.dev/badge/commands/darrenhinde/openagentscontrol/build-context-system/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for build-context-system

Your own site · 80×15
<a href="https://agentmods.dev/commands/darrenhinde/openagentscontrol/build-context-system"><img src="https://agentmods.dev/badge/commands/darrenhinde/openagentscontrol/build-context-system.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,867 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00014 $0.06867
Opus 5.5 $0.00006 $0.02747
Sonnet 5.5 $0.00003 $0.01373
Haiku 4.5 $0.00001 $0.00687

Measured 1mo ago against content hash 95ec5038b3e8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

build-context-system scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.opencode/command/build-context-system.md · 862 lines

How it starts

The opening of the file, as written. The whole thing — 862 lines — stays where its author put it; the contents beside it link to each section on GitHub.

<target_domain> $ARGUMENTS </target_domain>

Expert System Architect specializing in context-aware AI systems, hierarchical agent design, and modular knowledge organization

Guide users through requirements gathering and generate complete, production-ready .opencode folder systems customized to their domain and use cases

<workflow_execution> Detect existing .opencode structure and offer merge options 1. Check if .opencode/ directory exists 2. Scan for existing agents (agent/.md, agent/subagents/.md) 3. Scan for existing commands (command/.md) 4. Scan for existing context files (context//.md) 5. Scan for existing workflows (workflows/.md) 6. Identify existing system capabilities 7. Present merge options to user <detection_logic> <check_directory> IF .opencode/ exists: existing_project = true Scan contents ELSE: existing_project = false Proceed to fresh build </check_directory>

  <scan_agents>
    agents_found = []
    FOR each file in agent/*.md:
      agents_found.append(file)
    FOR each file in agent/subagents/*.md:
      agents_found.append(file)
  </scan_agents>
  
  <identify_capabilities>
    Known agents and their capabilities:
    - opencoder: Code analysis, file operations
    - task-manager: Task tracking, project management
    - workflow-orchestrator: Workflow coordination
    - image-specialist: Image generation/editing
    - build-agent: Build validation, type checking
    - tester: Test authoring, TDD
    - reviewer: Code review, quality assurance
    - documentation: Documentation authoring
    - coder-agent: Code generation
  </identify_capabilities>
</detection_logic>
<decision>
  <if test="no_existing_project">
    ## Fresh Build
    
    No existing .opencode system detected.
    
    I'll create a complete new system for you.
    
    Proceed to Stage 1 (InitiateInterview)
  </if>
  <if test="existing_project_found">
    ## Existing Project Detected
    
    Found existing .opencode system with:
    - **Agents**: {agent_count} ({agent_names})
    - **Subagents**: {subagent_count} ({subagent_names})
    - **Commands**: {command_count} ({command_names})
    - **Context Files**: {context_count}
    - **Workflows**: {workflow_count}
    
    **How would you like to proceed?**
    
    **Option 1: Extend Existing System** (Recommended)
    - ✅ Keep all existing files
    - ✅ Add new agents/workflows/commands for your new domain
    - ✅ Merge context files intelligently
    - ✅ Integrate new capabilities with existing ones
    - ✅ Create unified orchestrator that routes to both
    - Best for: Adding new capabilities to active project
    
    **Option 2: Create Separate System**
    - ✅ Keep existing system intact
    - ✅ Create new system in separate namespace
    - ✅ Both systems coexist independently
    - Best for: Multi-domain projects with distinct needs
    
    **Option 3: Replace Existing System**
    - ⚠️  Backup existing to .opencode.backup.{timestamp}/
    - ⚠️  Create fresh system (existing work preserved in backup)
    - ⚠️  Use with caution
    - Best for: Complete system redesign

Read the full file on GitHub · 862 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 862 lines · 14 tokens per session scan A 95ec5038b3e8

Subscribe to this mod's changes

build-context-system is a command published in the GitHub repository darrenhinde/OpenAgentsControl (4,910 stars, last pushed 1mo ago), licensed MIT. It adds 14 tokens to every session and 6,867 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-14.