jpskill.com
💬 コミュニケーション コミュニティ

show-code

Open code files in a tmux pane at the relevant line using the user's preferred editor. Use when the user says "show me the code", "open this in an editor", "let me see that code", or wants to view discussed code in an editor.

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o show-code.zip https://jpskill.com/download/9244.zip && unzip -o show-code.zip && rm show-code.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/9244.zip -OutFile "$d\show-code.zip"; Expand-Archive "$d\show-code.zip" -DestinationPath $d -Force; ri "$d\show-code.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して show-code.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → show-code フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1
📖 Claude が読む原文 SKILL.md(中身を展開)

この本文は AI(Claude)が読むための原文(英語または中国語)です。日本語訳は順次追加中。

<objective> Open a file at a specific line in the user's preferred terminal editor inside a tmux pane. Infer the file path and line number from conversation context, manage tmux panes automatically, and persist editor preference. </objective>

<execution_style> Be silent and fast. Combine commands into as few Bash calls as possible. Do not narrate what you are doing — just do it. Only speak to the user if something goes wrong or you need information. No commentary between steps. </execution_style>

<quick_start>

  1. Infer file path and line number from conversation context
  2. Resolve editor preference from ~/.claude/preferences.json
  3. Verify tmux session and ensure a second pane exists
  4. Open the file in the editor via tmux send-keys </quick_start>

<process>

<step name="identify-target"> Identify target file and line

From the conversation context, determine:

  • The absolute file path being discussed
  • The line number (exact or best approximation)

If either cannot be determined, ask the user. Use the Read tool or Grep tool to confirm the file exists and the line number is correct before proceeding. </step>

<step name="resolve-editor"> Resolve editor preference

Read ~/.claude/preferences.json using the Read tool and look for the editor key.

If the file doesn't exist or has no editor key, ask the user using AskUserQuestion:

  • Question: "What terminal editor should I use to show code?"
  • Options: "micro", "vim", "nano", "nvim"

Then save their choice. Use Bash:

python3 -c "
import json, os
path = os.path.expanduser('~/.claude/preferences.json')
try:
    with open(path) as f: data = json.load(f)
except (FileNotFoundError, json.JSONDecodeError): data = {}
data['editor'] = 'CHOSEN_EDITOR'
with open(path, 'w') as f: json.dump(data, f, indent=2)
"

Replace CHOSEN_EDITOR with the user's selection. </step>

<step name="verify-tmux"> Verify tmux session

Check if running inside tmux:

echo "$TMUX"

If $TMUX is empty, tell the user: "Sorry, this requires a tmux session. Please start tmux and try again." Then stop - do not proceed further. </step>

<step name="manage-panes"> Ensure a second pane exists

Count panes in the current window:

tmux list-panes -F '#{pane_id} #{pane_active}'
  • If only 1 pane exists, create a second one:

    tmux split-window -h
    tmux last-pane

    The split creates a side-by-side pane. last-pane returns focus to the original pane (where Claude is running). Remember that the pane was newly created — this affects the command in the next step.

  • If 2+ panes exist, use the first inactive pane as the target. The pane is pre-existing.

Determine the target pane ID (the pane that is NOT active):

tmux list-panes -F '#{pane_id} #{pane_active}' | grep ' 0$' | head -1 | awk '{print $1}'

</step>

<step name="open-editor"> Open editor in target pane

Send the editor command to the target pane. Most terminal editors support +LINE syntax.

If the pane was newly created in the previous step, append && exit so the pane closes automatically when the editor exits:

tmux send-keys -t TARGET_PANE 'EDITOR +LINE FILEPATH && exit' Enter

If the pane was pre-existing, do NOT append && exit:

tmux send-keys -t TARGET_PANE 'EDITOR +LINE FILEPATH' Enter

Replace:

  • TARGET_PANE with the pane ID from the previous step
  • EDITOR with the user's preferred editor
  • LINE with the line number
  • FILEPATH with the absolute file path

Examples:

# Newly created pane — closes when editor exits
tmux send-keys -t %3 'micro +641 /home/user/project/main.ts && exit' Enter

# Pre-existing pane — stays open
tmux send-keys -t %3 'micro +641 /home/user/project/main.ts' Enter

</step>

</process>

<edge_cases>

  • If the target pane has a running process (not a shell prompt), warn the user before sending keys
  • If the editor is not installed, inform the user and suggest installing it
  • If the line number exceeds the file length, open at the last line (most editors handle this gracefully)
  • If multiple files are being discussed, ask which one to open </edge_cases>

<success_criteria>

  • File opens in the correct editor at the specified line
  • Editor appears in a tmux pane (reusing existing or creating new)
  • Editor preference is persisted in ~/.claude/preferences.json
  • Graceful exit with message when not in tmux </success_criteria>