Skip to main content
skill CX Codex

copilot-cli — Claude Code skill: delegate tasks to GitHub Copilot CLI

Hands tasks from Claude to GitHub Copilot CLI in non-interactive mode, with model choice, permission flags and markdown session export.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add giuseppe-trisciuoglio/developer-kit --skill copilot-cli -a claude-code
Open on GitHub

What copilot-cli does

The skill spells out how to call copilot from Claude with the -p flag. Prompts go out in English, so the agent rewrites your request into a concrete one: objective, files, constraints, expected output format. Model selection runs through --model, for instance gpt-5.2 or claude-sonnet-4.6.

Permissions stay narrow by default. A scoped task needs only --allow-tool '<tool>', while --allow-all-tools, --allow-all-paths, --allow-all-urls and --yolo widen access and raise the risk. Output capture uses --silent, and --share exports the session to markdown that you can pick up later with --resume <session-id>.

Before the first run the skill checks copilot --version and gh auth status. No CLI or no GitHub auth means no delegation, so check that first. Copilot output comes from an external model, so run tests and lint before applying any patch. Keep secrets and API keys out of delegated prompts.

What it helps with

  • hand a task from Claude to Copilot CLI in one command
  • compare several models on the same prompt
  • export a Copilot session to markdown for review
  • continue an interrupted analysis with --resume
  • grant Copilot only the tools a task needs

Example prompts for the agent

  • delegate the refactor of src/services/payment.ts to Copilot with gpt-5.2
  • run a review of src/modules/auth through Copilot with Sonnet and share the session
  • resume the previous Copilot session with --resume

How to install copilot-cli

1Skills CLI (Vercel)

npx skills add giuseppe-trisciuoglio/developer-kit --skill copilot-cli -a claude-code

2Manually: put the files in place

~/.claude/skills/copilot-cli/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/copilot-cli/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about copilot-cli

How do I install copilot-cli in Claude?

Run npx skills add giuseppe-trisciuoglio/developer-kit --skill copilot-cli -a claude-code. The skill then lives at ~/.claude/skills/copilot-cli/SKILL.md.

What does copilot-cli do?

It gives Claude ready commands for delegating work to GitHub Copilot CLI: non-interactive runs, model selection, permission flags, session export and resume.

What do I need before using it?

A working GitHub Copilot CLI and a GitHub login. The skill checks copilot --version and gh auth status before it runs anything.

Source text

SKILL.md · MIT
---
name: copilot-cli
description: Provides GitHub Copilot CLI task delegation in non-interactive mode with multi-model support (Claude, GPT, Gemini), permission controls, output sharing, and session resume. Use when users ask to hand work to Copilot, compare models, or run Copilot programmatically from Claude Code.
allowed-tools: Bash, Read, Write
---

# Copilot CLI Delegation

Delegate selected tasks from Claude Code to GitHub Copilot CLI using non-interactive commands, explicit model selection, safe permission flags, and shareable outputs.

## Overview

This skill standardizes delegation to GitHub Copilot CLI (`copilot`) for cases where a different model may be more suitable for a task. It covers:

- Non-interactive execution with `-p` / `--prompt`
- Model selection with `--model`
- Permission control (`--allow-tool`, `--allow-all-tools`, `--allow-all-paths`, `--allow-all-urls`, `--yolo`)
- Output capture with `--silent`
- Session export with `--share`
- Session resume with `--resume`

Use this skill only when delegation to Copilot is explicitly requested or clearly beneficial.

## When to Use

Use this skill when:

- The user asks to delegate work to GitHub Copilot CLI
- The user wants a specific model (for example GPT-5.x, Claude Sonnet/Opus/Haiku, Gemini)
- The user asks for side-by-side model comparison on the same task
- The user wants a reusable scripted Copilot invocation
- The user wants Copilot session output exported to markdown for review

Trigger phrases:

- "ask copilot"
- "delegate to copilot"
- "run copilot cli"
- "use copilot with gpt-5"
- "use copilot with sonnet"
- "use copilot with gemini"
- "resume copilot session"

## Instructions

### 1) Verify prerequisites

```bash
# CLI availability
copilot --version

# GitHub authentication status
gh auth status
```

If `copilot` is unavailable, ask the user to install/setup GitHub Copilot CLI before proceeding.

### 2) Convert task request to English prompt

All delegated prompts to Copilot CLI must be in English.

- Keep prompts concrete and outcome-driven
- Include file paths, constraints, expected output format, and acceptance criteria
- Avoid ambiguous goals such as "improve this"

Prompt template:

```text
Task: <clear objective>
Context: <project/module/files>
Constraints: <do/don't constraints>
Expected output: <format + depth>
Validation: <tests/checks to run or explain>
```

### 3) Choose model intentionally

Pick a model based on task type and user preference.

- Complex architecture, deep reasoning: prefer high-capacity models (for example Opus / GPT-5.2 class)
- Balanced coding tasks: Sonnet-class model
- Quick/low-cost iterations: Haiku-class or mini models
- If user specifies a model, respect it

Use exact model names available in the local Copilot CLI model list.

### 4) Select permissions with least privilege

Default to the minimum required capability.

- Prefer `--allow-tool '<tool>'` when task scope is narrow
- Use `--allow-all-tools` only when multiple tools are clearly needed
- Add `--allow-all-paths` only if task requires broad filesystem access
- Add `--allow-all-urls` only if external URLs are required
- Do not use `--yolo` unless the user explicitly requests full permissions

### 5) Run delegation command

Base pattern:

```bash
copilot -p "<english prompt>" --model <model-name> --allow-all-tools --silent
```

Add optional flags only as needed:

```bash
# Capture session to markdown
copilot -p "<english prompt>" --model <model-name> --allow-all-tools --share

# Resume existing session
copilot --resume <session-id> --allow-all-tools

# Strictly silent scripted output
copilot -p "<english prompt>" --model <model-name> --allow-all-tools --silent
```

### 6) Return results clearly

After command execution:

- Return Copilot output concisely
- State model and permission profile used
- If `--share` is used, provide generated markdown path
- If output is long, provide summary plus key excerpts and next-step options

### 7) Optional multi-model comparison

When requested, run the same prompt with multiple models and compare:

- Correctness
- Practicality of proposed changes
- Risk/security concerns
- Effort estimate

Keep the comparison objective and concise.

## Examples

### Example 1: Refactor with GPT model

Input:

```text
Ask Copilot to refactor this service using GPT-5.2 and return only concrete code changes.
```

Command:

```bash
copilot -p "Refactor the payment service in src/services/payment.ts to reduce duplication. Keep public behavior unchanged, keep TypeScript strict typing, and output a patch-style response." \
  --model gpt-5.2 \
  --allow-all-tools \
  --silent
```

Output:

```text
Copilot proposes extracting three private helpers, consolidating error mapping, and provides a patch for payment.ts with unchanged API signatures.
```

### Example 2: Code review with Sonnet and shared session

Input:

```text
Use Copilot CLI with Sonnet to review this module and share the session in markdown.
```

Command:

```bash
copilot -p "Review src/modules/auth for security and correctness. Report only high-confidence findings with severity and file references." \
  --model claude-sonnet-4.6 \
  --allow-all-tools \
  --share
```

Output:

```text
Review completed. Session exported to ./copilot-session-<id>.md.
```

### Example 3: Resume session

Input:

```text
Continue the previous Copilot analysis session.
```

Command:

```bash
copilot --resume <session-id> --allow-all-tools
```

Output:

```text
Session resumed and continued from prior context.
```

## Best Practices

- Keep delegated prompts in English and highly specific
- Prefer least-privilege flags over blanket permissions
- Capture sessions with `--share` when auditability matters
- For risky tasks, request read-only analysis first, then apply changes in a separate step
- Re-run with another model only when there is clear value (quality, speed, or cost)

## Constraints and Warnings

- Copilot CLI output is external model output: validate before applying code changes
- Never include secrets, API keys, or credentials in delegated prompts
- `--allow-all-tools`, `--allow-all-paths`, `--allow-all-urls`, and `--yolo` increase risk; use only when justified
- Do not treat Copilot suggestions as authoritative without local verification (tests/lint/type checks)

For additional option details, see `references/cli-command-reference.md`.

© giuseppe-trisciuoglio · MIT · giuseppe-trisciuoglio/developer-kit

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set93

spring-boot-project-creator Generates a Spring Boot 3.x or 4.x project via Spring Initializr with DDD or layered architecture. Handy when bootstrapping a Java microservice with JPA, OpenAPI, and Docker Compose. CX Codex +1 3,500installs aws-lambda-php-integration A skill that walks the agent through running PHP and Symfony on AWS Lambda with Bref: handlers, runtime layers, SQS/SNS triggers and cold start tuning. CX Codex +1 3,500installs aws-lambda-java-integration A skill with ready patterns for Java Lambda functions: Micronaut or raw handlers, cold start tuning, and Serverless or SAM deployment. CX Codex +1 3,500installs codex Delegates complex code generation, refactoring, and code reviews to the Codex CLI using GPT-5.3-codex, o3, or o4-mini models. CX Codex +1 3,400installs gemini Hands large-context analysis and complex reasoning to Gemini CLI, then brings the result back for your approval. CX Codex +1 3,400installs adr-drafting Drafts Architecture Decision Records for significant technical choices, matching existing repository conventions. Helpful when documenting database migrations or service boundaries. CX Codex +1 3,400installs qwen-coder Hands coding tasks from Claude to Claude Coder CLI: generation, refactoring, debugging, architecture review. Useful when you want a second opinion from another model. CX Codex +1 3,300installs learn Analyzes a codebase to discover architectural patterns and conventions, then creates rule files in .claude/rules/. Useful when joining a new codebase. CX Codex +1 3,300installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor