Static prompts are the fastest way to turn an AI launcher into a glorified web chat box. If you have to highlight text, switch windows, paste it into an AI prompt, manually type repetitive context, and copy the result back, you are suffering from workflow friction.
Power users configure Raycast AI commands with dynamic placeholders ({selection}, {clipboard}, {browser-tab}) and system arguments ({argument}) to create adaptive, context-aware command pipelines. These allow a single keyboard shortcut to inspect your frontmost editor, query your active browser tab, pull recent clipboard buffers, prompt for optional inline variables, and replace the highlighted text in place—all without leaving your current application.
At 365Finds, our operational judgment is clear: Never build static AI prompts for repeatable desktop tasks. If a command requires manual window switching or copy-pasting, it is under-engineered. Raycast AI provides one of the cleanest desktop parametric prompt systems available, but maximizing its utility requires knowing how to combine context extraction, runtime arguments, and modifier chaining.
1. The Core Context Ingestion Placeholders
Raycast AI pulls runtime environmental data directly into prompt templates using curly brace tags. When the command executes, the launcher resolves these placeholders before transmitting the prompt payload to the underlying large language model.
| Placeholder | Context Source | Key Attributes & Syntax | Best Desktop Workflow |
|---|---|---|---|
{selection} | Frontmost active application | Grabs highlighted text; in AI Chat, falls back to the previous message | In-place code refactoring, grammar fixes, text translation |
{clipboard} | System clipboard buffer | Supports history offsets: {clipboard offset=1}, {clipboard offset=2} | Multi-source comparison, log analysis, secondary context injection |
{browser-tab} | Focused browser tab | Requires Raycast Browser Extension; formats: markdown (default), text, html; supports CSS selector | Scraped documentation analysis, Jira/GitHub ticket synthesis, web summarization |
Deep Dive: Multi-Buffer Operations with {clipboard offset=N}
Most users only know about {clipboard}, which pulls the immediate clipboard content. Power users enable Clipboard History in Raycast and utilize offsets to feed multiple copied fragments into a single prompt:
{clipboard}: The item currently at the top of your clipboard (copy #0).{clipboard offset=1}: The item copied immediately before the current one (copy #1).{clipboard offset=2}: The item copied two steps ago (copy #2).
This unlocks multi-buffer AI workflows without opening a full chat window: copy an API schema, copy an error stack trace, select your local code, and trigger a command that contrasts all three simultaneously.
Deep Dive: Targeted Web Extraction with {browser-tab selector="..."}
Extracting an entire webpage via {browser-tab} often blows up the model's context window with noisy navigation bars, footers, and tracking scripts. Raycast solves this by supporting CSS selectors:
{browser-tab selector="article"}: Extracts only the core article container.{browser-tab selector="main" format="markdown"}: Grabs the primary content body in structured Markdown.{browser-tab selector=".issue-details"}: Isolates ticket descriptions from project management tools like GitHub or Linear.
2. Interactive Runtime Arguments: {argument}
Dynamic placeholders pull automatic context, but complex commands often require runtime human intent. Raycast AI supports up to 3 distinct arguments per command, rendered directly inside the launcher search bar.
Named Arguments for Consistency
By default, each standalone {argument} creates a generic text field. Adding the name attribute assigns an identifier and an intuitive placeholder label in the search input:
Translate the following text into {argument name="Target Language"}:
{selection}
If you use the same argument name more than once inside a prompt template, Raycast asks for the input once and reuses that identical string across every matching placeholder.
Default Values: Eliminating Micro-Friction
By default, an argument without a fallback is strictly mandatory: Raycast will block command execution until you type something. For power users, mandatory prompts introduce micro-friction.
Adding the default attribute makes the argument optional:
Review this pull request title and description.
Tone: {argument name="Style" default="constructive and direct"}
Code: {selection}
365Finds Best Practice: Set default values on every argument where a standard choice covers 80% of your daily work. When the launcher opens, hitting
Enterimmediately executes the command with your proven default, while typing overrides it on demand.
Constrained Choices with options
Free-form text input creates typing fatigue and inconsistent model outputs. Raycast allows you to constrain arguments to a curated dropdown list using the options attribute:
Refactor this function prioritizing {argument name="Goal" options="readability, runtime performance, memory efficiency, unit test coverage" default="readability"}:
{selection}
When you trigger this command, Raycast turns the search bar into an autocompleting selector, letting you toggle between architectural trade-offs using your arrow keys in less than a second.
3. Modifier Chaining and Prompt Escaping
Feeding raw desktop context into LLMs without sanitization often causes prompt injection, JSON corruption, or broken output formatting. Raycast AI provides a pipe syntax (|) to modify placeholder output before prompt assembly.
Essential Modifiers
trim: Strips leading and trailing whitespace and empty newlines from your selection. Essential when grabbing terminal output or code blocks where rogue whitespace confuses formatting instructions.- Syntax:
{selection | trim}
- Syntax:
json-stringify: Escapes double quotes, backslashes, and line breaks. Mandatory when building commands that instruct the LLM to output valid JSON or when passing code containing unescaped quote marks into structured schemas.- Syntax:
{selection | json-stringify}
- Syntax:
raw: Raycast AI automatically wraps{selection}and{clipboard}placeholders in"""(triple double quotes) to delimit user context from system instructions. While helpful for basic text, this automatic delimiter can break strict code transformations, diff generation, or inline variable interpolations. Userawto disable this behavior.- Syntax:
{selection | raw}
- Syntax:
lowercase/uppercase: Enforces canonical casing for prompt instructions and enum tokens.- Syntax:
{argument name="Format" options="json, yaml" | lowercase}
- Syntax:
percent-encode: Encodes special characters. Primarily used when passing dynamic outputs into web links or URLs.
Modifier Chaining
You can pipe multiple modifiers sequentially:
{clipboard offset=1 | trim | json-stringify}
This sequence strips accidental indentation, escapes syntax characters, and ensures the payload integrates cleanly into your prompt template.
4. Output Behavior and Model Routing
A well-crafted prompt template is only half the battle; how Raycast surfaces the response determines your execution speed. In the Create AI Command configuration screen, set the following options deliberately:
Output Behavior: Replace Selection vs. Open in Raycast
- Replace Selection: The model replaces your highlighted text in-place inside the frontmost app. Use this for refactoring, lint fixes, prose editing, and commit message drafting.
- Must-Have Setting: Check Highlight Editing Changes. Raycast will render a visual diff overlay so you can review modifications before accepting them.
- Required Permission: Ensure macOS Accessibility permission is granted to Raycast under System Settings → Privacy & Security → Accessibility.
- Open in Raycast: The model opens a modal chat window displaying the generated output. Use this for explanatory queries, architectural reviews, or outputs that generate new multi-file assets.
Model Routing and Reasoning Effort
Raycast AI allows assigning specific models per command:
- For deterministic in-place transformations (formatting, translation, docstrings), route to fast, cost-efficient models (such as Claude 3.5 Haiku or GPT-4o-mini) to maintain sub-second launcher responsiveness.
- For architectural analysis or code reviews, assign advanced reasoning models (such as Claude 3.5 Sonnet, GPT-4o, or reasoning-focused models) and set the Reasoning Effort parameter (
low,medium,high) directly on the command form.
5. Production Recipes for Power Users
Here are three tested, high-velocity command templates demonstrating contextual multi-input chaining.
Recipe 1: Contextual Code Differential & Regression Reviewer
- Command Name:
Review Code Against Upstream Specs - Output Behavior:
Open in Raycast - Model: Advanced Reasoning Model (Sonnet / GPT-4o)
You are a Staff Software Engineer conducting a strict code review.
### Goal
Audit the selected local implementation against the upstream requirements/logs stored in my clipboard buffer.
### Review Focus
{argument name="Focus Area" options="security vulnerabilities, performance regressions, edge-case coverage, API contract compatibility" default="security vulnerabilities"}
### Upstream Specification / Error Log (Clipboard)
{clipboard | trim}
### Selected Implementation Under Review
{selection | trim}
### Output Requirements
1. Identify explicit regressions or deviations between the code and specification.
2. Provide concrete, corrected code blocks for any critical flaws found.
3. Be concise and prioritize high-severity findings.
Recipe 2: Web-Aware Technical Documentation & Issue Drafter
- Command Name:
Draft Issue from Web & Selection - Output Behavior:
Open in Raycast - Model: Default AI Command Model
Create a structured bug report or engineering task based on the active browser tab and selected logs.
### Task Type
{argument name="Issue Type" options="Bug Report, Feature Request, Tech Debt Task" default="Bug Report"}
### Web Context (Active Tab Body)
{browser-tab selector="main" format="markdown"}
### Local Terminal / Error Context (Selected Text)
{selection | trim}
### Output Format
- Title: [Type] Clear summary
- Environment & Context: Extracted from browser tab
- Reproduction / Stack Trace: Cleaned version of selection
- Suggested Resolution: Clear bullet points
Recipe 3: Zero-Friction In-Place Refactoring Pipeline
- Command Name:
Refactor In-Place - Output Behavior:
Replace Selection - Highlight Editing Changes:
Enabled - Model: Fast In-Place Model
Refactor the following code snippet. Return ONLY the replacement code with no surrounding explanation, conversational filler, or Markdown code fence delimiters.
### Target Language / Paradigm
{argument name="Language/Framework" default="idiomatic modern code"}
### Primary Objective
{argument name="Optimization" options="readability, performance, typing accuracy, async conversion" default="readability"}
### Code to Refactor
{selection | trim | raw}
6. Institutional Evaluation: Where AI Commands Hit Their Limits
At 365Finds, we advocate pushing declarative AI commands to their full potential before writing heavy custom extensions. However, power users must recognize the architectural boundary:
- The 3-Argument Hard Limit: Raycast AI strictly limits each command to three
{argument}placeholders. If a workflow demands multi-step configuration forms or dynamic dependent dropdowns, do not force it into an AI Command. Build a native Raycast Extension using the React/TypeScript SDK instead. - Read-Only Context: Placeholders can extract active application selections, clipboard state, and browser content, but they cannot execute shell scripts, write directly to arbitrary filesystem paths, or query external REST APIs without user-triggered paste actions. When file system orchestration or CLI execution is needed, pair your AI Command with Raycast Script Commands or Model Context Protocol (MCP) servers.
- Clipboard History Dependency: Using
{clipboard offset=N}requires Raycast's Clipboard History feature to remain active and unpaused. If you purge your clipboard history frequently or disable it in sensitive enterprise environments, offset placeholders will fail or return empty buffers.
By leveraging {selection | raw}, parameterized {argument} dropdowns, and multi-offset clipboard ingestion, you transform Raycast AI into an instantaneous, context-aware command center that eliminates desktop task switching.