📖 Prerequisite: Complete Chapter 02: Context and Conversations before reading this appendix.
This appendix covers two additional context features: working with images and managing permissions across multiple directories.
You can include images in your conversations using the @ syntax. Copilot can analyze screenshots, mockups, diagrams, and other visual content.
copilot
> @screenshot.png What's happening in this UI?
# Copilot analyzes the image and responds
> @mockup.png @current-design.png Compare these two designs
# You can also drag and drop images or paste from clipboard| Format | Best For |
|---|---|
| PNG | Screenshots, UI mockups, diagrams |
| JPG/JPEG | Photos, complex images |
| GIF | Simple diagrams (first frame only) |
| WebP | Web screenshots |
1. UI Debugging
> @bug-screenshot.png The button doesn't align properly. What CSS might cause this?2. Design Implementation
> @figma-export.png Write the HTML and Tailwind CSS to match this design3. Error Analysis
> @error-screenshot.png What does this error mean and how do I fix it?4. Architecture Review
> @whiteboard-diagram.png Convert this architecture diagram to a Mermaid diagram I can put in docs5. Before/After Comparison
> @before.png @after.png What changed between these two versions of the UI?Images become even more powerful when combined with code context:
copilot
> @screenshot-of-bug.png @src/components/Header.jsx
> The header looks wrong in the screenshot. What's causing it in the code?- Crop screenshots to show only relevant portions (saves context tokens)
- Use high contrast for UI elements you want analyzed
- Annotate if needed - circle or highlight problem areas before uploading
- One image per concept - multiple images work, but be focused
By default, Copilot can access files in your current directory. For files elsewhere, you need to grant access.
# Add a directory to the allowed list
copilot --add-dir /path/to/other/project
# Add multiple directories
copilot --add-dir ~/workspace --add-dir /tmp# Disable path restrictions entirely (use with caution)
copilot --allow-all-pathscopilot
> /add-dir /path/to/other/project
# Now you can reference files from that directory
> /list-dirs
# See all allowed directories# Allow all permissions for non-interactive scripts
copilot -p "Review @src/" --allow-all
# Or use the memorable alias
copilot -p "Review @src/" --yoloCommon scenarios where you'll need these permissions:
- Monorepo work - Comparing code across packages
- Cross-project refactoring - Updating shared libraries
- Documentation projects - Referencing multiple codebases
- Migration work - Comparing old and new implementations