Skip to content

Skills, Custom Commands & MCP

Out of the box, Hya knows how to read files, edit code, search the web, and run shell commands. When you want to give it specialized know-how, reusable prompt shortcuts, or outside tools (like GitHub, Linear, Slack, or Postgres), you have three lightweight options—no coding required.


1. Skills (SKILL.md)

A Skill is a folder containing a SKILL.md instruction guide. Unlike AGENTS.md (which is loaded into every single chat), Skills stay out of the way until they are needed: Hya sees only a one-line name: description summary at startup, and loads the full SKILL.md instructions only when a task calls for it (or when you invoke it yourself).

Compatible out of the box

If you already have skills from Claude Code, Codex, or Pi, Hya finds them automatically! It checks these folders in order (first match wins):

  1. <project>/.hya/skills/<name>/SKILL.md
  2. ~/.config/hya/skills/<name>/SKILL.md
  3. ~/.claude/skills/<name>/SKILL.md
  4. <project>/.agents/skills/<name>/SKILL.md
  5. ~/.codex/skills/<name>/SKILL.md
  6. ~/.agents/skills/<name>/SKILL.md

Browsing and running Skills

  • /skills opens a full-screen browser showing every Skill found on your machine, where it came from, and any syntax warnings.
  • /skill:<name> <your request> forces Hya to load that Skill right now for your message:
    /skill:agent-bundle-authoring Help me package a read-only SQL helper bundle
  • Added or edited a SKILL.md while Hya was already open? Run /reload-skills.

2. Custom Slash Commands

Have a prompt you type ten times a week—like “Review staged git changes for bugs” or “Write release notes since the last tag”? Save it as a Markdown file and run it with /your-command!

Create .hya/commands/check-pr.md in your project (or ~/.config/hya/commands/check-pr.md for all projects):

---
description: Review current branch changes before opening a PR
---
Run `git diff main...HEAD`, check every changed file for edge cases or missing tests, and give me a short checklist of anything to fix before merging.
Extra focus: $ARGUMENTS

Now inside Hya (run /reload-commands if Hya is already open), just type:

/check-pr check SQL injection and null handling

Hya also includes handy built-in commands like /init (drafts an AGENTS.md for your repo) and /review (reviews your working tree changes).


3. MCP Servers (Model Context Protocol)

MCP lets Hya plug into local stdio tool servers or remote HTTP MCP servers—database inspectors, browser automation, issue trackers, documentation search, and more.

Add MCP servers in [mcp.<name>] tables in ~/.config/hya/config.toml:

[mcp.memory]
command = ["npx", "-y", "@modelcontextprotocol/server-memory"]
[mcp.github]
command = ["npx", "-y", "@modelcontextprotocol/server-github"]
env = { GITHUB_PERSONAL_ACCESS_TOKEN = "{env:GITHUB_TOKEN}" }
[mcp.docs-remote]
url = "https://mcp.example.com/mcp"

Every tool from an MCP server appears to Hya as mcp__<server>__<tool> (for example mcp__github__list_issues) and goes through Hya’s normal permission checks.

Managing MCP servers inside Hya (/mcp)

Type /mcp in the TUI to see every configured server:

  • Press Enter on a server to inspect all the tools it exposes.
  • Press c to connect or x to disconnect a server live.
  • Press a if a server asks for OAuth login.

4. Optional: Code Mode (tools.code.mode)

Code Mode lets an agent call several Hya tools in parallel, filter their outputs, and return a summary in a single round. hya-app exposes the native crates/hya-code-mode runtime through code-mode__run. It runs async JavaScript in-process in a QuickJS-NG sandbox via rquickjs. Before execution, an AST checker built on oxc_parser checks syntax, tool names, required arguments, and available globals. Code Mode requires no Bun runtime.

Usage & Configuration

Enable it in ~/.config/hya/config.toml (then run hya server restart):

[tools.code]
mode = "with_tools" # normal | with_tools | only
  • normal (default): code-mode__run is not loaded.
  • with_tools: offers code-mode__run alongside the agent’s usual tools.
  • only: offers code-mode__run as the exclusive tool (with all other tools callable inside scripts via tools.*; direct model calls to hidden tools are refused).

Configure the optional judge for models.classify in the [tools.code.judge] table in config.toml. When that table is omitted, Hya can read a deprecated config.yml from the Code Mode config directory or the legacy bundle config directory. Tool calls inside scripts follow the session’s Project boundaries and permission rules. See Code Mode configuration.

Tool and Script Interface

Input to code-mode__run accepts one of four forms:

  • { script: string, args?: object, save_as?: string }
  • { run: string, args?: object }
  • { list: true }
  • { show: string }

Each input must match exactly one form without extra fields. Saved script names in save_as, run, and show match ^[a-z0-9][a-z0-9-]{0,63}$. save_as stores a script even if it fails. show returns its source and last error. Scripts are async function bodies with top-level await and return.

Globals exposed inside the sandbox:

  • args: call arguments object (or {}).
  • await tools.<name>(input): invokes any tool in the caller’s view (non-identifier characters become _).
  • ALL_TOOLS lists callable tools as {name, description} objects. describeTool(name) returns {name, description, input_schema} or undefined.
  • await agent(input) and await agents.run(input) are available when a tool with ToolPermission::Task is registered. Pass {agent, prompt, description?, result?, model?, effort?, timeout_secs?}. The required fields are nonblank strings. description, model, and effort are optional strings. result maps field names to descriptions. timeout_secs accepts numbers from 0 through 1800, rounds up to whole seconds, and defaults to 600. The call returns {handle, session, status, report, result}, where result is the parsed RESULT: {...} from the report or null.
  • await models.classify({ state, questions }) sends a JSON value in state to the configured judge. questions is a nonempty object keyed by question ID. Each question has a nonblank instructions string and a type of bool, choice, or score. A bool question may supply criteria mapping "true" and "false" to descriptions. A choice question requires a nonempty label-to-description object, and a score question requires a nonempty array of descriptions. The call returns {answers}, where answers maps question IDs to objects. The answer shapes are {type: "bool", probability}, {type: "choice", choice, probabilities, confidence}, and {type: "score", score, confidence}. Probabilities and confidence range from 0 to 1. A score ranges from 0 to the number of criteria minus one.
  • text(value), return value, console.log(...): emit structured output and logs.

Example (code-mode__run input):

{
"script": "const [a, b] = await Promise.all([tools.read({ path: 'Cargo.toml' }), tools.grep({ pattern: 'hya-core' })]); return { hasCore: b.output.length > 0, bytes: a.output.length };"
}

Want to write your own Skills, Commands, or full Bundles? See Extending Hya.