Lifecycle Hooks
Drop shell, Python, or PowerShell scripts into .scorpiox/hooks/<event>/
and they execute automatically when the event fires. All 31 hooks pass four arguments:
$1=event $2=session_id $3=ISO_timestamp $4=JSON.
Configuration
HOOKS_ENABLED1 (default) — master switchHOOKS_TIMEOUT30 (default) — timeout in secondsLogs
sessions/<id>/hooks.logPer-session loghooks/logs/hook.logFallback global log| Hook | Type | Trigger |
|---|---|---|
session_start |
lifecycle | New session begins (user opens TUI or resumes) |
session_end |
lifecycle | Session ends gracefully (user exits or DLL unloads) |
session_clear |
lifecycle | User runs /clear command to reset chat history |
user_message |
event | User sends a message to the agent |
agent_run_start |
lifecycle | Agent begins processing a user message |
agent_complete |
lifecycle | Agent finishes an agentic run (all turns complete) |
agent_cancelled |
lifecycle | User cancels the running agent (Ctrl+C or Escape) |
tool_use |
event | Agent invokes a built-in tool (Bash, ReadImage, etc.) |
mcp_call |
event | Agent calls an MCP server tool (mcp__server__tool) |
api_response |
event | API response received from provider |
api_error |
event | API error occurred (rate limit, auth failure, network) |
compact |
lifecycle | Conversation compacted (auto-shrink or /compact) |
Example: Log agent completions
Slash Commands
19 built-in system commands, plus unlimited custom commands via .md, .sh,
or .ps1 files. Markdown commands inject prompt context; shell commands execute directly.
Command Directories
~/.claude/commands/User-level commands./.claude/commands/Project-level commandsSupported Formats
.mdInjected as prompt context.shExecuted directly (bash).ps1Executed directly (PowerShell)Resolution Priority
When multiple commands share the same name, higher priority wins:
SX_CMDSRC_SYSTEM— built-in system commands (lowest)SX_CMDSRC_BUILTIN_SKILL— pre-shipped skills in binarySX_CMDSRC_BUILTIN_CMD— pre-shipped commands in binarySX_CMDSRC_USER— ~/.claude/commands/SX_CMDSRC_PROJECT— ./.claude/commands/SX_CMDSRC_USER_SKILL— ~/.claude/skills/SX_CMDSRC_PROJECT_SKILL— ./.claude/skills/ (highest)
| Command | Description | Aliases |
|---|---|---|
/exit |
Exit the application | /quit, /q |
/clear |
Clear chat history and screen | — |
/help |
Show available commands | — |
/model |
Show or switch model | — |
/save |
Save conversation to file | — |
/load |
Load conversation from file | — |
/rewind |
Rewind to previous checkpoint | — |
/config |
Open configuration editor | — |
/transcript |
Open transcript viewer | — |
/continue |
Continue generating response | — |
/info |
Toggle info box visibility | — |
/resume |
Resume previous conversation | /r |
/keepalive |
Toggle cache keep-alive (on/off) | — |
/context_resize |
Resize context window threshold | — |
/terminal |
Toggle terminal panel | — |
/history |
View conversation history | — |
/compact |
Compact context into new session | — |
/cd |
Change working directory | — |
/voice |
Record and transcribe voice input | — |
Example: Custom /deploy command
Skills
Skills are reusable workflows with YAML frontmatter. Each skill lives in its own directory
with a SKILL.md file that declares name, description, allowed tools, and context.
Skill Directories
~/.claude/skills/<name>/User-level skills./.claude/skills/<name>/Project-level skillsSKILL.md Format
Frontmatter Fields
nameRequired — skill identifierdescriptionRequired — shown in /helpallowed-toolsOptional — restrict tool accesscontextOptional — files/dirs to includeargument-hintOptional — hint for $ARGUMENTSMCP Servers
Register up to 16 custom MCP servers exposing up to 512 tools total. Servers communicate
via JSON-RPC 2.0 over stdio. Tools appear as mcp__<server>__<tool>.
Configuration Keys
MCP0/1 — master switch for MCPMCP_SERVERname:command:arg1,arg2,... — inline definitionMCP_CONFIG/path/to/mcp_servers.json — external configMCP_FILE/path/to/.mcp — dotfile-style configMCP_ALLOWserver:glob_pattern — tool allow filterMCP_DENYserver:glob_pattern — deny filter (overrides allow)Inline Definition
External JSON Config
Discovery
Timer Callbacks
Schedule delayed messages that re-enter the agentic loop as synthetic user messages. 8 concurrent slots, 1–3600 second delays, auto-repeating up to N times.
Limits
max_slots8 concurrent callbacksdelay_range1–3600 secondsdefault_repeat20 fires before auto-cancelActions
setSchedule a new callbacklistShow active callbackscancelCancel by ID or cancel allExample: Monitor build status
SDK Event Emission
Every agent interaction writes structured JSON files to the session messages directory for external SDK consumers. Enable telemetry reporting to POST events to a remote URL.
Configuration
EMIT_SESSION_TRACKING0/1 — enable external telemetryEMIT_SESSION_API_URLURL to POST session events