background-command

Guidance for running commands that stay active, such as development servers, file watchers, and watch-mode builds, in a separate visible terminal tab. It is written for the oretachi development interface, where users can view logs and stop the process.

In plain words
What is it for?
Use it for commands such as Vite, Next.js, Rails, Flask, Docker Compose, TypeScript watch mode, or HTTP servers, while using the normal terminal for tests, builds, linting, and other short commands.
Why use it?
Long-running commands can occupy the agent's normal command session and hide their output. A separate terminal lets the process continue after the agent exits and gives the user direct control.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ishida-supsys/oretachi/background-command
Any agent
npx skills add ishida-supsys/oretachi --skill background-command
Clone the repo
git clone --depth 1 https://github.com/ishida-supsys/oretachi

Made for: Claude Code, Codex.

Per session 120 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,055 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00120 $0.03055
Opus 5 $0.00060 $0.01528
Sonnet 5 $0.00024 $0.00611
Haiku 4.5 $0.00012 $0.00305

Measured 2d ago against content hash 2c4ff487a03f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

background-command scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- 出力を即 grep / 解析したい短命スクリプト(`curl`, `git log`, `ls` 等)
src-tauri/skills/background-command/SKILL.md · 186 lines

How it starts

The opening of the file, as written. The whole thing — 186 lines — stays where its author put it; the contents beside it link to each section on GitHub.

background-command スキル

長時間常駐するコマンド(開発サーバ・ファイル監視・watch ビルド・HTTP サーバ等)を実行するとき、Claude Code の bash tool の run_in_background を使うのではなく、oretachi の MCP ツールで oretachi UI 上に新しいターミナルタブを追加してそこで実行する。

これにより:

  • 出力ログが xterm.js でユーザーに可視化される
  • ユーザーが任意タイミングで Ctrl-C / kill できる
  • 他ワークツリーへの切替・detach 等の oretachi 既存 UI が活用できる
  • Claude Code 終了後もプロセスを残せる

いつこのスキルを使うか

使う(長時間常駐するコマンド):

  • pnpm dev, pnpm run dev, pnpm run tauri dev, npm start, yarn dev
  • next dev, vite, nuxt dev, astro dev
  • nodemon, tsc --watch, cargo watch, cargo run(HTTP サーバ等)
  • docker compose up-d なし), rails s, flask run, python -m http.server
  • その他、Ctrl-C しない限り終了しないコマンド全般

使わない(短命コマンド or 出力をすぐ後処理したいケース):

  • pnpm test, pnpm run build, cargo build, cargo check, tsc --noEmit, eslint ., prettier --check
  • ビルド・テスト・lint・型チェック等、終了コードを判定したいもの
  • ユーザーが明示的に「bash で background 実行して」と指示した場合
  • 出力を即 grep / 解析したい短命スクリプト(curl, git log, ls 等)

判断基準: 「実行後ずっと起動し続けるか?」「Yes」ならこのスキル、「No」なら通常の bash。

ただし oretachi 設定の 「AI からの background コマンドを oretachi ターミナルで起動する」が OFF の場合は、上記判定で「Yes」でも本スキルは使わず Claude Code の bash tool(run_in_background: true)でフォールバック起動する。Step 0 で確認する。

手順

Step 0: グローバル設定を確認する

最初に oretachi_get_app_options を呼び、戻り値の useOretachiTerminalForBackground を見る。

oretachi_get_app_options({})
// => { "useOretachiTerminalForBackground": true | false }
  • true: Step 1 以降に進む。
  • false(既定): 本スキルは使わない。Claude Code の bash tool で run_in_background: true を指定して起動する(例: bash tool で pnpm dev を実行、run_in_background: true)。oretachi UI には新タブを作らない。以降の Step もスキップ。

このトグルは oretachi 設定タブ → Terminal セクションの「AI からの background コマンドを oretachi ターミナルで起動する」に対応する。

Step 1: ワークツリーを特定する

oretachi_get_worktree_status を呼び、現在の作業ディレクトリ(PWD)と一致する worktree の nameid を取得する。

複数の worktree が同名だった場合は id も使う。

Step 2: ターミナルを起動してコマンドを流し込む

oretachi_spawn_terminal({
  worktree_name: "<Step 1 で取得した name>",
  worktree_id: "<必要なら id を指定>",
  command: "pnpm dev",
  title: "pnpm dev",            // タブ表示名
  reason: "ローカルサーバ起動"  // ログ用メモ(任意)
})

Read the full file on GitHub · 186 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 186 lines · 120 tokens per session scan A 2c4ff487a03f

Subscribe to this mod's changes

background-command is a skill published in the GitHub repository ishida-supsys/oretachi (2 stars, last pushed 13d ago), licensed MIT. It adds 120 tokens to every session and 3,055 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.