← Back to Skills Marketplace
onestepat4time

Aegis Bridge

by Emanuele · GitHub ↗ · v0.6.6-preview.1 · MIT-0
cross-platform ⚠ suspicious
57
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install onestep-aegis
Description
Orchestrate Claude Code sessions via Aegis HTTP/MCP bridge. Use when spawning CC sessions for coding tasks, implementing issues, reviewing PRs, fixing CI, ba...
README (SKILL.md)

Aegis — CC Session Orchestration

Aegis manages interactive Claude Code sessions via HTTP API (port 9100) or MCP tools. Each session runs CC in tmux with JSONL transcript parsing and bidirectional communication.

Prerequisites

  1. Aegis server running: curl -s http://127.0.0.1:9100/v1/health
  2. MCP configured (optional, for native tool access): see scripts/setup-mcp.sh
  3. Verify health: bash scripts/health-check.sh

Core Workflow

create → send prompt → poll status → handle permissions → read result → quality gate → cleanup

Step 1: Create Session

MCP: create_session(workDir, name?, prompt?) HTTP:

SID=$(curl -s -X POST http://127.0.0.1:9100/v1/sessions \
  -H "Content-Type: application/json" \
  -d '{"workDir":"/path/to/project","name":"task-name"}' \
  | jq -r '.id')

⚠️ workDir must exist on disk or creation fails silently (returns null id).

Wait 8-10s for CC to boot. Check promptDelivery.delivered in the response — if false, resend via send_message after CC boots.

Step 2: Send Prompt

MCP: send_message(sessionId, text) HTTP:

curl -s -X POST http://127.0.0.1:9100/v1/sessions/$SID/send \
  -H "Content-Type: application/json" \
  -d '{"text":"Your task here"}'

Step 3: Poll Until Idle

MCP: get_status(sessionId) — check status field HTTP:

STATUS=$(curl -s http://127.0.0.1:9100/v1/sessions/$SID/read | jq -r '.status')

Step 4: Handle Permission Prompts

While polling, react to non-idle states:

Status Action
idle Done — read result
working Wait (poll every 5s)
permission_prompt POST .../approve (trust folder, tool use)
bash_approval POST .../approve or POST .../reject
plan_mode POST .../approve (option 1) or POST .../escape
ask_question POST .../send with answer
unknown GET .../pane for raw terminal output

Step 5: Read Transcript

MCP: get_transcript(sessionId) HTTP: curl -s http://127.0.0.1:9100/v1/sessions/$SID/read

Returns { messages[], status, statusText }. Each message: { role, contentType, text, timestamp }.

Step 6: Quality Gate

Before accepting output, verify:

  1. Check transcript for tool errors or failed assertions
  2. Run tsc --noEmit and build via send_message if needed
  3. Confirm tests pass (request CC to run them)
  4. Check for common issues: missing imports, hardcoded values, incomplete implementations

Step 7: Cleanup

MCP: kill_session(sessionId) HTTP: curl -s -X DELETE http://127.0.0.1:9100/v1/sessions/$SID

Always cleanup — idle sessions consume tmux windows and memory.

Common Patterns

Implement Issue

create_session(workDir=repo, name="impl-#123", prompt="Implement issue #123. Read the issue description first, then write code. Don't explain, just implement. Run tests when done.")
→ poll → approve permissions → read transcript → verify tests pass → cleanup

Review PR

create_session(workDir=repo, name="review-PR-456", prompt="Review PR #456. Focus on: security issues, test coverage, API design. Be concise.")
→ poll → read transcript → extract review comments

Fix CI

create_session(workDir=repo, name="fix-ci", prompt="CI is failing on main. Run the failing test suite, identify the root cause, and fix it. Don't add skip/only annotations.")
→ poll → approve bash commands → verify CI green → cleanup

Batch Tasks

Spawn multiple sessions in parallel, then poll all:

for task in "task-a" "task-b" "task-c"; do
  curl -s -X POST http://127.0.0.1:9100/v1/sessions \
    -H "Content-Type: application/json" \
    -d "{\"workDir\":\"$REPO\",\"name\":\"$task\",\"prompt\":\"$task description\"}" \
    | jq -r '.id' >> /tmp/session-ids.txt
done
# Poll all until done
while read SID; do ... done \x3C /tmp/session-ids.txt

Stall Detection and Recovery

A session is stalled when working for >5 minutes with no transcript change.

Detection

HASH1=$(curl -s http://127.0.0.1:9100/v1/sessions/$SID/read | jq -r '.messages | length')
sleep 30
HASH2=$(curl -s http://127.0.0.1:9100/v1/sessions/$SID/read | jq -r '.messages | length')
# If HASH1 == HASH2 and status is still "working", likely stalled

Recovery Options (in order)

  1. Nudge — send send_message("Continue. What's blocking you?")
  2. InterruptPOST .../interrupt then resend the task
  3. Refine — send a simplified or decomposed version of the task
  4. Pivot — kill session, create new one with a different approach
  5. Escalate — abandon automated approach, notify human

Troubleshooting

Problem Fix
Connection refused on 9100 Aegis not running. Check scripts/health-check.sh
Session stuck at unknown GET .../pane for raw output. May need POST .../escape
Permission loop (approve keeps coming) Likely bash approval. Check transcript for the command. Reject if unsafe
promptDelivery: "failed" CC didn't boot yet. Wait 10s and resend via send_message
Session not appearing in list_sessions Check workDir filter. Session may have been killed
High memory usage Kill idle sessions. Use list_sessions to find orphans

MCP Tool Reference

When MCP is configured, 24 tools are available natively:

Session Lifecycle

Tool Description
create_session Spawn new CC session (workDir, name, prompt)
list_sessions List sessions, filter by status/workDir
get_status Detailed session status + health
kill_session Kill session + cleanup resources
batch_create_sessions Spawn multiple sessions at once

Communication

Tool Description
send_message Send text to a session
send_bash Execute bash via ! prefix
send_command Send /slash command
get_transcript Read conversation transcript
capture_pane Raw terminal output
get_session_summary Summary with message counts + duration

Permission Handling

Tool Description
approve_permission Approve pending prompt
reject_permission Reject pending prompt
escape_session Send Escape key (dismiss dialogs)
interrupt_session Send Ctrl+C

Monitoring

Tool Description
server_health Server version, uptime, session counts
get_session_metrics Per-session performance metrics
get_session_latency Latency measurements

State (Memory Bridge)

Tool Description
state_set Set a shared state key/value entry
state_get Get a shared state key/value entry
state_delete Delete a shared state key/value entry

Advanced

Tool Description
list_pipelines List multi-step pipelines
create_pipeline Create orchestrated pipeline
get_swarm Swarm status for parallel sessions

For full API reference, see references/api-quick-ref.md. For agent templates, see references/agent-template.md. For heartbeat/dev-loop templates, see references/heartbeat-template.md.

Usage Guidance
Install only if you intentionally want Aegis to control local Claude Code sessions. Prefer project-scoped MCP setup, pin or verify the `aegis-bridge` package, disable auto-approval for untrusted workspaces, keep the Aegis port local, and periodically review or delete stored memory and MCP configuration.
Capability Analysis
Type: OpenClaw Skill Name: onestep-aegis Version: 0.6.6-preview.1 The skill bundle facilitates multi-agent orchestration via a local Aegis bridge (127.0.0.1:9100) but promotes an insecure-by-design workflow. Instructions in SKILL.md and logic in heartbeat-template.md explicitly direct the agent to programmatically bypass security checkpoints, such as 'bash_approval' and 'permission_prompt', which removes critical human-in-the-loop protections for local code execution. Additionally, setup-mcp.sh relies on 'npx' to fetch and run the bridge component, introducing standard supply-chain risks.
Capability Tags
crypto
Capability Assessment
Purpose & Capability
The artifacts consistently describe a localhost Aegis bridge for spawning and managing Claude Code sessions. This is purpose-aligned, but the capability is high-impact because it can create coding agents, send prompts, run bash/tool workflows, manage pipelines, and store memory.
Instruction Scope
The provided heartbeat and workflow examples make auto-approval of permission and bash prompts part of the default automation pattern, which can bypass per-command human review during code-changing sessions.
Install Mechanism
The setup script configures Claude Code to launch the MCP server with an unversioned `npx aegis-bridge` command. This is user-directed and purpose-aligned, but the executable provenance and version are not pinned in the reviewed artifacts.
Credentials
The bridge targets `127.0.0.1:9100` and user-selected working directories, which fits the purpose. Users should still treat spawned sessions as able to mutate the selected repository and run local development commands.
Persistence & Privilege
The setup can add a user-scoped MCP server under `~/.claude/settings.json`, and the API supports persistent memory. Both are disclosed and useful for the purpose, but they expand the blast radius beyond one immediate task unless scoped and cleaned up.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install onestep-aegis
  3. After installation, invoke the skill by name or use /onestep-aegis
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.6.6-preview.1
Release v0.6.6-preview.1 - HTTP/MCP Claude Code orchestration
Metadata
Slug onestep-aegis
Version 0.6.6-preview.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Aegis Bridge?

Orchestrate Claude Code sessions via Aegis HTTP/MCP bridge. Use when spawning CC sessions for coding tasks, implementing issues, reviewing PRs, fixing CI, ba... It is an AI Agent Skill for Claude Code / OpenClaw, with 57 downloads so far.

How do I install Aegis Bridge?

Run "/install onestep-aegis" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Aegis Bridge free?

Yes, Aegis Bridge is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Aegis Bridge support?

Aegis Bridge is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Aegis Bridge?

It is built and maintained by Emanuele (@onestepat4time); the current version is v0.6.6-preview.1.

💬 Comments