HyperAgent Usage Guide

May 21, 2026 · View on GitHub

Complete reference for HyperAgent configuration, features, and commands.

CLI Flags

FlagDescription
--model <name>LLM model (default: claude-opus-4.6)
--cpu-timeout <ms>CPU time limit per JS execution (default: 1000)
--wall-timeout <ms>Wall-clock backstop per execution (default: 5000)
--send-timeout <ms>Agent inactivity timeout (default: 300000)
--heap-size <MB>Guest heap size (default: 16)
--scratch-size <MB>Guest scratch size, includes stack (default: 16)
--profile <name>Apply resource profile at startup (stackable)
--skill <name>Invoke skill(s) before the prompt
--auto-approve / --yoloAuto-approve all interactive prompts
--base-dir <path>Auto-enable fs-read + fs-write with this directory as their base
--prompt "<text>"Non-interactive: send prompt, wait for completion, exit
--prompt-file <path>Read the non-interactive prompt from a file
--show-codeLog generated JS to a timestamped file
--show-timingLog timing breakdown to a timestamped file
--reasoning-effort [level]Set reasoning effort (low|medium|high|xhigh, default: high)
--verboseStream reasoning + show sandbox tool result bodies
--very-verbose / -vvLike --verbose plus full result bodies for every tool (audit/registration/…)
--transcriptRecord session transcript to ~/.hyperagent/logs/
--tuneCapture LLM decision/reasoning logs to JSONL
--plugins-dir <path>Custom plugins directory (default: ./plugins)
--list-modelsList available models and exit
--resume [id]Resume a previous session (latest if no ID given)
--skip-suggestSkip mandatory suggest_approach/API-discovery enforcement
--output-threshold <n>Large output threshold in bytes (default: 20480)
--debugEnable debug event/lifecycle logging
--versionShow version and exit
--helpShow help message

Environment Variables

All configuration is also available via environment variables (overridden by CLI flags):

VariableDefaultDescription
COPILOT_MODELclaude-opus-4.6Model name for the Copilot SDK session
HYPERLIGHT_CPU_TIMEOUT_MS1000Max CPU time per JS execution (ms)
HYPERLIGHT_WALL_TIMEOUT_MS5000Max wall-clock time per execution (ms)
HYPERAGENT_SEND_TIMEOUT_MS300000Agent inactivity timeout (ms)
HYPERLIGHT_HEAP_SIZE_MB16Guest heap size (megabytes)
HYPERLIGHT_SCRATCH_SIZE_MB16Guest scratch size, includes stack (megabytes)
HYPERLIGHT_INPUT_BUFFER_KB1040Input buffer size (kilobytes)
HYPERLIGHT_OUTPUT_BUFFER_KB1040Output buffer size (kilobytes)
HYPERAGENT_PROFILE(none)Profile name(s) to apply at startup
HYPERAGENT_AUTO_APPROVE(none)Set to 1 for auto-approve mode
HYPERAGENT_PROMPT(none)Non-interactive prompt text
HYPERAGENT_PROMPT_FILE(none)File containing the non-interactive prompt
HYPERAGENT_SKILL(none)Skill name(s) to invoke
HYPERAGENT_TUNE(none)Set to 1 to capture LLM decision logs
HYPERAGENT_REASONING_EFFORT(none)Reasoning effort level (low/medium/high/xhigh)
HYPERAGENT_VERBOSE(none)Set to 1 for verbose output mode
HYPERAGENT_VERY_VERBOSE(none)Set to 1 for very-verbose output (full body for every tool)
HYPERAGENT_BASE_DIR(none)Base directory for fs-read/fs-write plugins (auto-enables both)
HYPERAGENT_LIST_MODELS(none)Set to 1 to list models and exit
HYPERAGENT_RESUME_SESSION(none)Session ID to resume, or __last__ for latest
HYPERAGENT_PLUGINS_DIR(none)Custom plugins directory path
HYPERAGENT_SKIP_SUGGEST(none)Set to 1 to disable suggest_approach/API-discovery enforcement
HYPERAGENT_OUTPUT_THRESHOLD_BYTES20480Large output threshold in bytes
HYPERAGENT_TIMING_LOG(none)Path to timing log file (default: ~/.hyperagent/logs/)
HYPERAGENT_CODE_LOG(none)Path to code log file (default: ~/.hyperagent/logs/)
HYPERAGENT_TRANSCRIPT(none)Set to 1 to record session transcript
HYPERAGENT_DEBUG(none)Set to 1 for debug logging to ~/.hyperagent/logs/

Example:

COPILOT_MODEL=gpt-5.1 HYPERLIGHT_CPU_TIMEOUT_MS=2000 hyperagent

Slash Commands

Toggle options at runtime without restarting. Type / and press Tab for completion.

CommandEffect
/show-codeToggle inline display of generated JavaScript
/show-timingToggle execution timing breakdown
/debugToggle debug event logging
/timeout cpu <ms>Override CPU timeout for subsequent calls
/timeout wall <ms>Override wall-clock timeout for subsequent calls
/timeout send <ms>Override agent inactivity timeout
/timeout resetReset all timeouts to defaults
/buffer input <kb>Override input buffer size (kilobytes)
/buffer output <kb>Override output buffer size (kilobytes)
/buffer resetReset buffer sizes to defaults
/transcriptToggle session transcript recording on/off
/modelsList available models with capability icons
/model <name>Switch to a different model (preserves conversation)
/newStart a fresh session (blank context, same model)
/sessionsList saved sessions with summaries
/resume [id]Resume a previous session (latest if no ID)
/plugin listList discovered plugins with state, risk, and approval status
/plugin enable <name> [k=v]Audit, configure, and enable a plugin (inline config supported)
/plugin disable <name>Disable an enabled plugin
/plugin approve <name>Approve a plugin (persists until source changes or unapproved)
/plugin unapprove <name>Remove plugin approval
/plugin audit <name>Force re-audit a plugin (after source changes)
/profile listList available resource profiles
/profile apply <name> ...Apply profile limits and request required plugins
/mcp listList configured MCP servers
/mcp enable <name>Approve and connect an MCP server
/configShow current configuration (model, timeouts, buffers, plugins)
/helpList available commands
/exitExit the agent (or just type exit)

LLM Tools

The agent registers custom tools that the LLM can call. Most SDK built-in tools (grep, edit, etc.) are blocked by the tool gating layer. The SDK's bash tool is also blocked — execute_bash is Hyperagent's own sandboxed bash interpreter.

ToolPurpose
register_handlerRegister named JavaScript handler code in the sandbox
execute_javascriptExecute a registered handler with optional event data
execute_bashRun bash commands in a sandboxed pure-JS interpreter (just-bash)
delete_handlerRemove a handler from the sandbox
get_handler_sourceRetrieve handler source for inspection or editing
edit_handlerSurgically edit an existing handler
list_handlersList registered handlers with line counts
reset_sandboxClear sandbox state, keep handlers registered
configure_sandboxChange resource limits at runtime (heap, scratch, timeouts, buffers)
register_moduleCreate a reusable ES module (persisted to ~/.hyperagent/modules/)
list_modulesList available modules (system + user)
module_infoGet module exports, JSDoc, and metadata
delete_moduleDelete a user-created module
write_outputWrite text content through the fs-write plugin
read_inputRead text content through the fs-read plugin
read_outputRead content previously written as output
manage_pluginEnable/disable plugins with configuration
list_pluginsDiscover available plugins
plugin_infoDetailed plugin information and config schema
apply_profileApply named resource profiles (limits + plugins in one step)
list_mcp_serversList configured MCP servers and connection status
mcp_server_infoInspect MCP server tools and generated declarations
manage_mcpConnect or disconnect MCP servers
sandbox_helpOn-demand guidance: patterns, state, binary I/O, fetch, debugging
report_intentProtocol tool used by the model to signal intent
ask_userAsk the user structured questions (free-form or multiple choice)
llm_thought(tune mode only) Log structured reasoning for prompt engineering

Profiles

Profiles bundle resource limits and plugin requirements into named presets. Profiles are additive — stacking multiple takes the max of each limit and the union of all plugins when applied during a session.

CLI --profile applies CPU, wall-clock, heap, and scratch limits at startup. It does not silently enable plugins, and input/output buffer profile limits are only applied at runtime. During a run, use /profile apply or let the LLM call apply_profile to request the profile's plugin requirements.

ProfileHeapCPUWallPluginsUse case
default16MB1000ms5s(none)Math, algorithms, data transforms
file-builder128MB15000ms60sfs-writeZIP, PPTX, PDF, CSV, image generation
web-research64MB2000ms120sfetch, fs-writeAPI calls, web scraping, data pipelines
heavy-compute64MB10000ms15s(none)Large datasets, crypto, simulations
# Single profile
hyperagent --profile file-builder

# Stacked at startup — takes max of each limit
hyperagent --profile "web-research heavy-compute"

Skills

Skills inject domain expertise into the conversation. A skill is a markdown file (skills/<name>/SKILL.md) with YAML frontmatter specifying metadata and allowed tools, followed by structured guidance for the LLM.

---
name: pptx-expert
description: Expert at building professional PowerPoint presentations
allowed-tools:
  - register_handler
  - execute_javascript
---
# PowerPoint Presentation Expert
You are an expert at building professional, polished PowerPoint presentations...
# Interactive — load the skill and start a conversation
hyperagent --skill pptx-expert

# Autonomous — skill + prompt + auto-approve
hyperagent --skill pptx-expert --auto-approve \
  --prompt "Build a 10-slide deck on cloud architecture"

Shared State & Persistence

Handlers share data via ha:shared-state — an in-sandbox key-value store. ha:shared-state is automatically preserved across all sandbox recompiles. No manual save/restore steps are needed.

1. Research handler stores data in shared-state
2. register_handler("builder")  ← recompile (shared-state auto-preserved)
3. execute_javascript("builder") ← builder sees all shared-state data

User Modules

The LLM can create reusable ES modules at runtime via register_module. User modules are persisted to ~/.hyperagent/modules/ and survive across sessions. They're importable via import { fn } from "ha:<name>".

ToolAction
register_moduleCreate or update a module (name, source, author, description)
list_modulesList all modules — system + user, with size and mutability
module_infoExports + JSDoc; optionally query one function by name
delete_moduleDelete a user module (system modules are immutable)

System Modules

Builtin ES modules available to handler code via import { fn } from "ha:<name>":

ModuleDescription
shared-stateCross-handler state preserved across sandbox recompiles
ziplibNative DEFLATE compression/decompression
zip-formatZIP archive builder for document formats
doc-coreShared document themes, colour validation, and input guards
ooxml-coreShared OOXML units, colours, themes, content types, and rels
pptxPowerPoint presentation generation
pptx-chartsEditable PowerPoint charts
pptx-tablesPowerPoint tables, comparisons, and timeline helpers
xlsxExcel workbook generation with sheets, pivots, charts, and styles
pdfPDF document generation
pdf-chartsPDF chart rendering
markdownMarkdown to HTML or plain text conversion
htmlHTML text and link extraction
imagePNG/JPEG/GIF/BMP dimension reading
base64Base64 encode/decode for binary data
str-bytesString and byte conversion utilities
crc32CRC-32 checksums for ZIP/PNG/gzip
xml-escapeXML escaping and simple element building

Model Management

Switch models mid-conversation with /model <name> — the conversation history is preserved via the SDK's resumeSession API.

You: /models
  🤖 Available models (17):
     claude-opus-4.6 ← current 👁️🧠
     gpt-5.1 👁️🧠
     gpt-4.1 👁️
     ...

     👁️ = vision  🧠 = reasoning effort

You: /model gpt-5.1
  🔄 Model switched: claude-opus-4.6 → gpt-5.1
     Conversation history preserved.

Infinite Sessions

Context compaction is enabled by default. When the context window fills up, the SDK automatically summarises older context in the background so conversations can continue indefinitely without hitting token limits.

  • Background compaction triggers at 80% context usage
  • Blocking compaction triggers at 95% (pauses briefly to compact)

Session Management

Sessions are persisted by the SDK. You can list, resume, and create new sessions without losing previous conversations.

You: /sessions
  📋 Sessions (3):
     a1b2c3d4e5f6…
       Modified: 25/02/2026, 12:30:00 — Fibonacci calculation and sorting demo
     f7e8d9c0b1a2… ← current
       Modified: 25/02/2026, 12:45:00 — Data processing pipeline

You: /resume a1b2
  ⏮️  Resumed session: a1b2c3d4e5f6…
     Model: claude-opus-4.6

Resume from the CLI with --resume (latest session) or --resume <id>.

Session Transcript

Record the full session (input, output, tool calls) to a file:

# Via CLI flag
hyperagent --transcript

# Via slash command during a session
You: /transcript
  📄 Transcript started: ~/.hyperagent/logs/hyperagent-20260225-123456.log

Transcripts are written as ANSI-coloured .log files during the session, then auto-stripped to clean .txt on exit.

Non-Interactive / Scripted Mode

Combine --prompt, --auto-approve, and --skill for fully autonomous operation — no interactive prompts, no human in the loop. Treat this as yolo mode for trusted prompts only:

# Autonomous PPTX generation
hyperagent --auto-approve --skill pptx-expert \
  --profile "web-research file-builder" \
  --prompt "Build a deck comparing AWS, Azure, and GCP pricing"

# Simple computation — no plugins needed
hyperagent --auto-approve \
  --prompt "Calculate the first 100 prime numbers and return them as JSON"

In auto-approve mode:

  • Plugin enables are approved automatically
  • ask_user questions select the first option
  • Config changes are applied without confirmation
  • Module registration proceeds without review

Command Suggestions

After each LLM response, HyperAgent scans the output for actionable slash commands (e.g. "/plugin enable fetch allowedDomains=api.github.com") and presents them as one-keystroke suggestions. Accept with a single keypress instead of typing the full command.

Tuning Mode

When --tune is enabled, an additional llm_thought tool becomes available. The LLM can log structured reasoning data (decisions, concerns, constraints, rejected alternatives) to a JSONL file. This is useful for prompt engineering and improving the system message guidance.

hyperagent --tune --transcript
# Decision logs written to ~/.hyperagent/tune-logs/

Keep-Alive Timeout

The agent uses a custom keep-alive mechanism that resets the inactivity timer on every session event (tool start, tool complete, message deltas). This means long-running tool chains stay alive as long as events keep flowing — the timeout only fires if the agent truly goes silent.

Default: 300s. Override with --send-timeout <ms> or /timeout send <ms>.