Skip to content
Agentmart
Submit a tool

codespace-vscode-open

Auto-discover VS Code CLI in Codespaces and open files in connected editor

Skill by gitricko

IndexedMIT★ 1
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/gitricko-codespace-vscode-open

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Auto-discover VS Code CLI in Codespaces and open files in connected editor

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Shell scripts

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/codespace-vscode-open

What's inside

Skill name
codespace-vscode-open
Description
Auto-discover VS Code CLI in Codespaces and open files in connected editor
License
MIT
Instructions
74 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (4)

  • SKILL.md
  • vscode-cli-discovery.md · references/
  • install.sh · scripts/
  • vscode-open.sh · scripts/

SKILL.md (first lines)

# codespace-vscode-open

Auto-discovers the VS Code remote CLI path in GitHub Codespaces (`/vscode/bin/linux-x64/<commit>/bin/remote-cli/code`) and provides a simple command to open files in the user's connected VS Code instance.

## Problem

The bare `code` command often fails in Codespaces because it's not on PATH or the shim is broken. The real CLI lives at a commit-specific path under `/vscode/bin/linux-x64/`.

## Solution

A script that finds the CLI automatically and opens files. Works in any Codespace with VS Code connected.

## Installation

```bash
# Run the install script to copy vscode-open.sh to ~/.hermes/scripts/
~/.hermes/skills/minions/codespace-vscode-open/scripts/install.sh

# Or from the skill directory
skills/codespace-vscode-open/scripts/install.sh
```

The script is installed to `~/.hermes/scripts/vscode-open.sh` by the install script.

## Usage

```bash
# As a command
~/.hermes/scripts/vscode-open.sh /path/to/file.md

# Or from skill dir
skills/codespace-vscode-open/scripts/vscode-open.sh /path/to/file.md
```

## How It Works

1. Finds the **active VS Code server PID** (`pgrep -f "server-main.js"`)
2. **Extracts commit SHA** from the server's command line to get the exact matching CLI
3. **Fallback**: if commit SHA extraction fails, picks the newest `code` binary by mtime
4. Executes the CLI with the provided file path — opens in the user's connected VS Code

This ensures we always use the CLI from the **active VS Code server**, not a stale version from a previous update.

## Files

- `scripts/vscode-open.sh` — Main executable script
- `scripts/install.sh` — Installs vscode-open.sh to `~/.hermes/scripts/`
- `references/vscode-cli-discovery.md` — Discovery pattern and troubleshooting

## Pitfalls

| Pitfall | Symptom | Fix |
|---------|---------|-----|
| **Stale CLI selected** | File opens against old VS Code server, doesn't reach connected editor | Use active server's commit SHA (from `/proc/PID/cmdline`) or fallback to newest by mtime |
| **Script not installed** | `~/.hermes/scripts/vscode-open.sh: No such file or directory` | Run `scripts/install.sh` — it's not auto-linked like skills |
| **VS Code not connected** | `VS Code server not running` error | Connect VS Code desktop to Codespace before running |
| **Multiple VS Code versions** | Arbitrary `find \| head -1` picks wrong version | Sort by mtime (`-printf "%T@ %p\n" \| sort -n \| tail -1`) |

## Related Skills

- `codespace-persistent-symlinks` — Same symlink pattern for persisting scripts to `~/.hermes/scripts/`
- `codespace-gh-auth` — GitHub auth in Codespaces (token extraction from VS Code server)
- `codespace-port-visibility` — Port forwarding in Codespaces

## Mnemon Persistence

This skill follows the repo's persistent knowledge pattern:
1. Skill in `skills/codespace-vscode-open/` (git-tracked)
2. Script symlinked to `~/.hermes/scripts/vscode-open.sh` (runtime)
3. Wiki article in `../wiki/vscode-cli-codespaces.md`
4. Mnemon entry in `mnemon/seed.json` (validated via `mnemon import --dry-run`)

The `start-hermes.sh` repair guard (from `codespace-persistent-symlinks`) ensures the symlink survives rebuilds.

From gitricko/.minions, MIT.

More from gitricko/.minions

Signals

Stars
1
Forks
2
Open issues
3
Last commit (this folder)
Sep 11, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from gitricko

Cite this page

codespace-vscode-open skill. Agent Mart. https://agentmart.dev/skills/gitricko-codespace-vscode-open (last updated 2026-10-24)