Skip to content

aimanyounises1/ClaudePromptRefiner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Claude Prompt Refiner πŸͺ„

A macOS menu bar app that refines your prompts using your Claude subscription (no API key needed!).

How It Works

  1. Select your draft prompt text in any app
  2. Press βŒ˜β‡§P (Command+Shift+P)
  3. App captures the text and opens Claude (Desktop or web)
  4. Auto-pastes the refinement request to Claude
  5. You copy Claude's response (⌘C)
  6. App detects the clipboard change and auto-pastes back to your original app

Features

  • βœ… Works with Claude Desktop app OR Claude.ai web
  • βœ… Uses your existing Claude subscription (no API costs)
  • βœ… Global hotkey (βŒ˜β‡§P)
  • βœ… Auto-paste refined prompts back
  • βœ… Menu bar integration
  • βœ… Customizable prompt template
  • βœ… Clipboard monitoring for seamless workflow

Installation

Step 1: Create Xcode Project

  1. Open Xcode
  2. Create a new macOS App project
  3. Product Name: ClaudePromptRefiner
  4. Interface: SwiftUI
  5. Language: Swift
  6. Bundle Identifier: com.yourname.ClaudePromptRefiner

Step 2: Add Files

Replace the default files with these:

  • βœ… ClaudePromptRefinerApp.swift (already created)
  • βœ… AppDelegate.swift (already created)
  • βœ… ClipboardMonitor.swift (already created)
  • βœ… SettingsView.swift (already created)
  • βœ… Info.plist (already created)

Step 3: Configure Project

  1. In Xcode, go to Signing & Capabilities
  2. Enable App Sandbox (uncheck if issues with accessibility)
  3. Go to Info tab
  4. Add custom Info.plist if needed

Step 4: Enable Accessibility

  1. Build and run the app
  2. macOS will prompt for Accessibility permission
  3. Go to System Settings β†’ Privacy & Security β†’ Accessibility
  4. Enable ClaudePromptRefiner

Step 5: Test

  1. Open any text editor
  2. Select some text like: "write a story"
  3. Press βŒ˜β‡§P
  4. Claude should open with the refinement request
  5. Copy Claude's response
  6. It should auto-paste back!

Usage

Refining a Prompt

Before: "write a story"

After: "Write a compelling short story (500-800 words) with:
- A clear three-act structure
- A relatable protagonist facing an internal conflict
- Vivid sensory details
- An unexpected but satisfying resolution
Theme: The courage to embrace change"

Custom Prompt Template

Open Settings from the menu bar to customize the refinement instruction:

You are an expert prompt engineer. Refine and improve the following prompt to make it clearer, more specific, and more effective. Return ONLY the refined prompt without any explanations or meta-commentary.

Original prompt:
{PROMPT}

Keyboard Shortcuts

  • βŒ˜β‡§P - Refine selected prompt
  • ⌘, - Open settings (when menu is focused)
  • ⌘Q - Quit app (when menu is focused)

Troubleshooting

Hotkey doesn't work

  • Check that Accessibility permissions are granted
  • Try restarting the app
  • Make sure no other app is using βŒ˜β‡§P

Text not being captured

  • Grant Accessibility permissions in System Settings
  • Make sure text is actually selected before pressing hotkey

Auto-paste not working

  • The app monitors clipboard changes
  • Make sure you copy (⌘C) Claude's response
  • Wait ~0.5s after copying for auto-paste to trigger

Claude doesn't open

  • For Claude Desktop: Make sure it's installed
  • For web: Default browser will open to claude.ai/new
  • You can manually open Claude and the text will be in clipboard

How It Uses Your Claude Subscription

This app does NOT use the Claude API. Instead:

  1. It captures your selected text
  2. Formats it with a prompt engineering instruction
  3. Copies it to clipboard
  4. Opens Claude (Desktop or web)
  5. Pastes the request
  6. You interact with Claude normally (counts toward your subscription usage)
  7. When you copy the response, it auto-pastes back

This means:

  • βœ… No API key needed
  • βœ… No extra API costs
  • βœ… Uses your existing Claude Pro/subscription
  • βœ… Full Claude features (artifacts, web search, etc.)

Architecture

User selects text β†’ βŒ˜β‡§P hotkey
    ↓
App captures text via simulated ⌘C
    ↓
Formats with prompt engineering template
    ↓
Opens Claude (Desktop or web)
    ↓
Auto-pastes request via simulated ⌘V
    ↓
User reviews and copies (⌘C) Claude's response
    ↓
Clipboard monitor detects change
    ↓
App switches back to original app
    ↓
Auto-pastes refined prompt via simulated ⌘V

System Requirements

  • macOS 13.0+ (Ventura or later)
  • Claude Desktop app OR web browser
  • Accessibility permissions

Privacy

  • All processing happens locally
  • Text is only sent to Claude (your subscription)
  • No data is stored or logged
  • Clipboard monitoring only active while waiting for response

License

MIT License - Feel free to modify and distribute

Credits

Created with ❀️ for better prompt engineering

About

πŸ€– macOS app for refining and optimizing prompts for Claude AI - Built with SwiftUI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors