gh-codespace
Skill4 starsChanged 6 months agoMITView on GitHub
GitHub CLI (`gh codespace` or `gh cs`) operations for connecting to, managing, creating, or editing GitHub Codespaces. You MUST load this skill when working with the `gh codespace` command.
In this repository124 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- .github/workflows/AGENTS.mdAGENTS.md
- .vscode/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- agent-log-analysisSkill
- agent-mdSkill
- agent-md-writerSkill
- agent-skill-md-writerSkill
- agentskillsSkill
- agents-md-writerSkill
- ai-prompt-writerSkill
- ansibleSkill
- apache-airflow-apiSkill
- apache-airflow-dagsSkill
- astro-cliSkill
- astronomer-docsSkill
- awesome-copilotSkill
- brainstorm-agent-runsSkill
- brainstorm-github-prSkill
- brainstormSkill
- catSkill
- chrome-devtoolsSkill
- claude-docsSkill
- codeqlSkill
- code-reviewSkill
- code-tourSkill
- coding-standard-writerSkill
- context-aware-opsSkill
- copilot-cliSkill
- copilot-docsSkill
- critical-thinkingSkill
- datadog-agentSkill
- datadog-apiSkill
- datadog-mcpSkill
- datadog-monitorsSkill
- datadog-pulumiSkill
- devcontainerSkill
- dictationSkill
- direnvSkill
- dockerfileSkill
- dockerSkill
- docs-reviewSkill
- docs-writerSkill
- dot-claudeSkill
- dotfilesSkill
- dot-githubSkill
- editorconfigSkill
- fact-writerSkill
- gdpr-compliantSkill
- gh-agent-taskSkill
- gh-apiSkill
- gh-aw-compileSkill
- gh-aw-firewall-debugSkill
- gh-aw-firewallSkill
- gh-aw-newSkill
- gh-awSkill
- gh-aw-troubleshootingSkill
- gh-issueSkill
- gh-modelsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 4 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 49
When managing, creating, or connecting to GitHub Codespaces natively from the CLI.
- Distinctive: line 50
When you need to securely transfer files between the local machine and a Codespace without configuring SCP manually.
- Distinctive: line 56
When attempting to perform automated Git commits (the agent should use native local git tools instead of proxying through a Codespace).
- Distinctive: line 57
If the user explicitly asks to work locally and has not initialized a Codespace environment.
- Very specific: line 67
Verify codespace status with gh codespace list or gh codespace view before attempting interactive connections.
- Very specific: line 68
Use gh codespace cp for transferring files between the local machine and the codespace instead of manually configuring SCP.
- Very specific: line 93
Connection Failures: If gh codespace ssh hangs or fails, check codespace logs: gh codespace logs -c <codespace-name>
- Very specific: line 95
Rebuilding Environment: If the Devcontainer configuration is modified or corrupted, trigger a rebuild: gh codespace rebuild -c …
- Very specific: line 100
Do not attempt to SSH manually without using gh codespace ssh as it requires specific key exchanges handled by the CLI.
- Very specific: line 101
Avoid using interactive commands (like gh codespace code or gh codespace ssh) in automated agent workflows.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- markdownlint-disable MD013 MD023 MD031 MD032 -->gh-codespace
Connect to and manage GitHub Codespaces natively from the CLI.
Mindmap of Commands
mindmap
root((gh-codespace))
code
Open in VS Code
cp
Copy files
create
Create a codespace
delete
Delete codespaces
edit
Edit a codespace
jupyter
Open in JupyterLab
list
List codespaces
logs
Access codespace logs
ports
List and manage ports
rebuild
Rebuild a codespace
ssh
SSH into a codespace
stop
Stop a codespace
view
View detailsWhen to Use
- When managing, creating, or connecting to GitHub Codespaces natively from the CLI.
- When you need to securely transfer files between the local machine and a Codespace without configuring SCP manually.
- To handle port forwarding for local testing of applications running inside a Codespace.
When Not to Use
- For managing local Docker containers or Devcontainers not hosted on GitHub's infrastructure (use
dockerordevcontainerskills instead). - When attempting to perform automated Git commits (the agent should use native local
gittools instead of proxying through a Codespace). - If the user explicitly asks to work locally and has not initialized a Codespace environment.
Common Pitfalls
- Interactive Hangs: Running
gh codespace sshin an automated agent session, which blocks execution by dropping the agent into an interactive TTY shell. - Dangling Port Forwards: Starting a port forward with
gh codespace ports forwardwithout backgrounding it (&), locking up the terminal. - Ignoring State: Attempting to execute commands against a Codespace that is currently in a "Stopped" or "Rebuilding" state, causing immediate connection failures.
Core Principles
- Verify codespace status with
gh codespace listorgh codespace viewbefore attempting interactive connections. - Use
gh codespace cpfor transferring files between the local machine and the codespace instead of manually configuring SCP. - Manage port forwarding natively via
gh codespace ports forwardfor local testing.
Commands / Usage Patterns
- List Codespaces: View active codespaces to find the
<codespace-name>:gh codespace list --json name,repository,state - Create a Codespace:
gh codespace create --repo <repository-name> --branch <branch-name> - Copy Files: Transfer files from a codespace to the local machine:
gh codespace cp -c <codespace-name> remote:/path/to/file local/path/Transfer files from local to codespace:gh codespace cp -c <codespace-name> local/path/ remote:/path/to/file - Port Forwarding: Expose a port from the codespace to your local machine:
gh codespace ports forward <remote-port>:<local-port> -c <codespace-name> - Stop/Delete Codespace: Clean up resources when done:
gh codespace stop -c <codespace-name>gh codespace delete -c <codespace-name>
Diagnostics and Troubleshooting
- Connection Failures: If
gh codespace sshhangs or fails, check codespace logs:gh codespace logs -c <codespace-name> - Rebuilding Environment: If the Devcontainer configuration is modified or corrupted, trigger a rebuild:
gh codespace rebuild -c <codespace-name>
What to Avoid
- Do not attempt to SSH manually without using
gh codespace sshas it requires specific key exchanges handled by the CLI. - Avoid using interactive commands (like
gh codespace codeorgh codespace ssh) in automated agent workflows. Use them only when providing instructions to the user.
Limitations
- The CLI depends on active network connections and the GitHub Codespaces service availability.
- Port forwarding
gh codespace ports forwardblocks the terminal and requires background execution (&) or a separate process in non-interactive environments.
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

