JSPM

  • Created
  • Published
  • Downloads 453
  • Score
    100M100P100Q103767F
  • License MIT

Persistent AI agents for Claude Code — build once, run forever.

Package Exports

  • openrune

Readme

Rune

English | 한국어

The simplest agent toolkit for Claude Code
No SDK. No boilerplate. Just one file per agent.

Claude Code platform license

Rune Desktop UI — 4 agents collaborating


Prerequisites

  • Node.js 18+
  • Claude Code CLI installed and logged in — Rune uses Claude Code under the hood for all agent execution
npm install -g @anthropic-ai/claude-code
claude                                       # login if you haven't

How Rune works: Rune uses Claude Code's custom channels (currently in beta) to extend agent capabilities. It does not access the Claude API directly or handle any authentication — all execution goes through the official Claude Code CLI.

Usage: Rune runs through your Claude Code CLI session. We are currently verifying whether usage counts toward your subscription or extra usage — this section will be updated once confirmed.

Install

npm install -g openrune

30-Second Quick Start

rune new reviewer --role "Code reviewer, security focused"
rune run reviewer.rune "Review the latest commit"

That's it. You just built an agent.


How is Rune different from Agent Teams?

Claude Code's Agent Teams spawn teammates at runtime — powerful, but ephemeral. When the session ends, the agents are gone.

Rune takes a different approach: agents are files.

Agent Teams Rune
Persistence Session-only — agents disappear when done .rune files persist forever with history and memory
Portability Tied to a single Claude Code session Share, version-control, and reuse .rune files anywhere
Scheduling Manual execution only Cron, file-change, and git-commit triggers
Permissions Inherited from session Per-agent controls (fileWrite, bash, allowPaths)
Execution Interactive Headless, pipelines, CI/CD-ready

Rune agents survive across sessions, machines, and teams. Build once, run forever.


Core Concepts

One file = one agent

rune new architect --role "Software architect"
rune new coder --role "Backend developer"
rune new reviewer --role "Code reviewer"

Each .rune file is just JSON — portable, shareable, version-controllable:

{
  "name": "reviewer",
  "role": "Code reviewer, security focused",
  "permissions": {
    "fileWrite": false,
    "bash": false,
    "allowPaths": ["src/**"],
    "denyPaths": [".env", "secrets/**"]
  },
  "history": [],
  "memory": []
}

Permissions

Control what each agent can do. No permissions = full access (backward compatible).

{
  "permissions": {
    "fileWrite": false,
    "bash": false,
    "network": false,
    "allowPaths": ["src/**", "tests/**"],
    "denyPaths": [".env", "secrets/**", "node_modules/**"]
  }
}
  • fileWrite: false — agent can read but not write/edit files
  • bash: false — agent cannot run shell commands
  • network: false — agent cannot make web requests
  • allowPaths / denyPaths — restrict file access to specific patterns

A reviewer that can only read src/: safe. A coder that can write anywhere: powerful. You decide per agent.

Structured logging

Track what agents do, how long it takes, and how much it costs:

rune run reviewer.rune "Review this project" --auto --log review.json
{
  "agent": "reviewer",
  "prompt": "Review this project",
  "duration_ms": 12340,
  "cost_usd": 0.045,
  "tool_calls": [
    { "tool": "Read", "input": { "file_path": "src/index.ts" } },
    { "tool": "Grep", "input": { "pattern": "TODO" } }
  ],
  "result": "Found 3 issues..."
}

Self-spawning agents

An agent can create and coordinate other agents on its own:

rune new manager --role "Project manager. Create agents with rune new and coordinate them with rune pipe."
rune run manager.rune "Create a summarizer and a translator agent, then pipe them to summarize and translate this news article into Korean." --auto

The manager will:

  1. Run rune new summarizer --role "..."
  2. Run rune new translator --role "..."
  3. Run rune pipe summarizer.rune translator.rune "..."
  4. If something fails, debug and fix it autonomously

Agents creating agents. No human intervention.

Headless execution

Run agents from the terminal. No GUI needed:

rune run reviewer.rune "Review the latest commit"

# Pipe input from other commands
git diff | rune run reviewer.rune "Review this diff"

# JSON output for scripting
rune run reviewer.rune "Check for security issues" --output json

Autonomous mode

With --auto, agents write files, run commands, and fix errors on their own:

rune run coder.rune "Create an Express server with a /health endpoint. Run npm init and npm install." --auto
🔮 [auto] coder is working on: Create an Express server...

  ▶ Write: /path/to/server.js
  ▶ Bash: npm init -y
  ▶ Bash: npm install express
  💬 Server created and dependencies installed.

✓ coder finished

Agent pipeline

Chain agents. Each agent's output feeds into the next:

rune pipe architect.rune coder.rune "Build a REST API with Express"

With --auto, the last agent executes the plan:

rune pipe architect.rune coder.rune "Build a REST API with Express" --auto

architect designs → coder implements (writes files, installs deps).

Automated triggers

# On every git commit
rune watch reviewer.rune --on git-commit --prompt "Review this commit"

# On file changes
rune watch linter.rune --on file-change --glob "src/**/*.ts" --prompt "Check for issues"

# On a schedule
rune watch monitor.rune --on cron --interval 5m --prompt "Check server health"

Node.js API

Use agents in your own code. Each .send() call spawns a Claude Code process, so Claude Code CLI must be installed and logged in on the machine.

const rune = require('openrune')

const reviewer = rune.load('reviewer.rune')
const result = await reviewer.send('Review the latest commit')

// Pipeline
const { finalOutput } = await rune.pipe(
  ['architect.rune', 'coder.rune'],
  'Build a REST API'
)

Example: Agent-Powered API Server

A full walkthrough — from zero to a running server built by agents.

1. Install and create agents

npm install -g openrune
mkdir my-project && cd my-project

rune new architect --role "Software architect. Design system architecture concisely."
rune new coder --role "Backend developer. Implement code based on the given plan."
rune new reviewer --role "Code reviewer. Review for bugs and security issues."

2. Agents collaborate to build a server

rune pipe architect.rune coder.rune "Design and build an Express server with POST /review endpoint that uses require('openrune') to load reviewer.rune and send the prompt. Run npm init -y and npm install express openrune." --auto

architect designs the architecture → coder writes server.js, runs npm init, installs dependencies.

3. Start the server

node server.js

4. Call the agent via API

curl -X POST http://localhost:3000/review \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Review this project"}'

The reviewer agent analyzes your project and returns a full code review.

5. Open the desktop UI

rune open reviewer.rune

The conversation history from the API call is already there — context persists across CLI, API, and GUI.


Desktop UI

Rune includes an optional desktop app for interactive chat.

rune open reviewer.rune

Or double-click any .rune file in Finder.

Rune Desktop UI

  • Real-time activity — See tool calls, results, and permission requests as they happen.
  • Built-in terminal — Claude Code output and your own commands, side by side.
  • Right-click to create — macOS Quick Action for creating agents from Finder.

If double-click doesn't work, run rune install once to register the file association.


CLI Reference

Command Description
rune new <name> [--role "..."] Create agent
rune run <file> "prompt" [--auto] [--output json] Run headlessly
rune pipe <a> <b> [...] "prompt" [--auto] Chain agents
rune watch <file> --on <event> --prompt "..." Automated triggers
rune open <file> Desktop UI
rune list List agents in current directory
rune install Set up file associations & Quick Action

Watch events: git-commit, git-push, file-change (with --glob), cron (with --interval)


Platform Support

Platform Status
macOS Supported
Windows Supported
Linux Supported

License

MIT