{"meta":{"title":"Delegating tasks to Copilot","intro":"Use autopilot mode, or the /delegate slash command, to get Copilot to work autonomously on your behalf.","product":"GitHub Copilot","breadcrumbs":[{"href":"/en/enterprise-cloud@latest/copilot","title":"GitHub Copilot"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos","title":"How-tos"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos/copilot-cli","title":"Copilot CLI"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos/copilot-cli/use-copilot-cli","title":"Use Copilot CLI"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos/copilot-cli/use-copilot-cli/delegate-tasks-to-cca","title":"Delegate tasks to Copilot"}],"documentType":"article"},"body":"# Delegating tasks to Copilot\n\nUse autopilot mode, or the /delegate slash command, to get Copilot to work autonomously on your behalf.\n\nCopilot CLI offers two ways to have Copilot work autonomously: **autopilot mode** and the **`/delegate` command**. Both let you hand off tasks, but they differ in where the work happens:\n\n* **Autopilot mode** runs locally in your CLI session. You give autopilot full permissions and Copilot then works on a task without stopping to prompt you for input. Your local machine does the work, and you can watch progress in real time. Use autopilot when you want hands-free local execution.\n\n* **`/delegate`** pushes the task to Copilot cloud agent on GitHub. The work runs remotely: Copilot creates a branch, opens a draft pull request, and works in the background. Use `/delegate` when you want to hand off a task entirely and continue running even if you shut down your local machine.\n\n## Get autopilot to complete tasks autonomously on your local machine\n\nThere are two ways to use autopilot mode:\n\n* **Interactively:** In an interactive session, press <kbd>Shift</kbd>+<kbd>Tab</kbd> until you see \"autopilot\" in the status bar. If prompted to choose permissions for autopilot mode, allow full permissions, then enter your prompt.\n* **Programmatically:** Pass the CLI a prompt directly in a command, and include the `--autopilot` option. For example, to use autopilot mode with full permissions, restricting it to 10 continuations, enter `copilot --autopilot --yolo --max-autopilot-continues 10 -p \"YOUR PROMPT HERE\"`.\n\nFor more information, see [Allowing GitHub Copilot CLI to work autonomously](/en/enterprise-cloud@latest/copilot/concepts/agents/copilot-cli/autopilot).\n\n## Delegate tasks to Copilot cloud agent\n\nYou can delegate a task to Copilot cloud agent on GitHub by using the `/delegate`slash command, followed by a prompt:\n\n```shell\n/delegate complete the API integration tests and fix any failing edge cases\n```\n\nAlternatively, prefix a prompt with `&` to delegate it:\n\n```shell\n& complete the API integration tests and fix any failing edge cases\n```\n\nCopilot will ask to commit any of your unstaged changes as a checkpoint in a new branch it creates. Copilot cloud agent will open a draft pull request, make changes in the background, and request a review from you.\n\nCopilot will provide a link to the pull request and agent session on GitHub once the session begins.\n\n## Next steps\n\nTo learn how to invoke specialized agents tailored to specific tasks, such as code review, documentation, or security audits, see [Invoking custom agents](/en/enterprise-cloud@latest/copilot/how-tos/copilot-cli/use-copilot-cli/invoke-custom-agents)."}