Skip to content

kod3000/solve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solve 🔨

A spicy little macOS menu-bar wrapper that turns your clipboard into a coding agent command.

Copy an error. Hit ⌘⇧S. Watch Claude Code or Kimi fix it — no terminal juggling required.

macOS Swift License Kimi Claude Code

it works

✨ What it does

Solve lives in your menu bar as a humble hammer icon. When something breaks — a stack trace, a failing test, a vague error message — you copy it, hit a hotkey, and Solve delegates the fix to the CLI coding agent of your choice.

  • One hotkey⌘⇧S reads the clipboard, prefixes "fix ", and runs the agent.
  • Two agents — Claude Code or Kimi, switchable from the menu. Defaults to Kimi.
  • Live progress window — stdout/stderr stream in real time.
  • In-app banners — green for success, red for failure, anchored to the menu-bar icon.
  • MCP server — exposes the same flow over a local Unix socket so Claude Desktop, Claude Code, or any MCP client can trigger Solve programmatically.
  • Print-mode only — no TUI, no PTY hacks, no fragile auto-response patterns. Just kimi --prompt … or claude --print --dangerously-skip-permissions ….

🚀 Quick start

xcodebuild -project Solve.xcodeproj -scheme Solve -configuration Debug build
open ~/Library/Developer/Xcode/DerivedData/Solve-*/Build/Products/Debug/Solve.app

Or open Solve.xcodeproj in Xcode and press ⌘R.

First-time setup

  1. Click the hammer → Set Working Directory… and pick where the agent should run.
  2. (Optional) Tool ▸ switches between Claude Code and Kimi.
  3. (Optional) Test Current Tool (⌘⇧T) runs a quick ping and shows pass/fail.

Daily use

  1. Copy a stack trace, error message, or task description.
  2. Click the hammer → Solve from Clipboard (or ⌘⇧S).
  3. Watch the progress window while the agent reads, edits, and runs commands.
  4. Get a green or red banner when it finishes.

🛠️ Requirements

  • macOS 13.0+
  • Xcode 14.0+
  • One of these CLIs on PATH:
    • Kimi — default at ~/.kimi-code/bin/kimi
    • Claude Codeclaude

Solve also searches /usr/local/bin and /opt/homebrew/bin if the binary isn't on your default PATH.

🎛️ Tool switching

  • Per-session: menu → Tool ▸ Claude Code / Kimi
  • Settings panel (⌘,) has a segmented picker too
  • Persisted in UserDefaults under SolveSelectedTool
  • New installs default to Kimi

🔨 Menu-bar states

Icon Meaning
hammer.circle.fill (solid) Idle
hammer.circle (outline) A run is in flight

Hover for the live tooltip, e.g. Solve: idle (Kimi ✓ 4.5s) or Solve: Kimi — Running….

🔌 MCP server

Solve exposes itself as an MCP server so other agents can call it. See mcp/README.md for install instructions and Claude Desktop / Claude Code config.

MCP client ──stdio──▶ mcp/solve_mcp_server.py ──UNIX socket──▶ Solve.app
                                                                   └─▶ kimi / claude

Bridge listens on ~/Library/Application Support/Solve/solve.sock and exposes:

  • solve(prompt, working_directory?, tool?) — async; returns {run_id, status: "running"}
  • get_run_status(run_id) — poll output + status
  • list_solve_tools() — installed tools + last-known health
  • check_tool_health(tool?) — synchronous liveness probe (~5s)

One run at a time. Concurrent attempts get HTTP 409 / a clear error.

🔔 Notifications

  • In-app popover — anchored to the menu-bar icon, auto-dismisses (3.5s success, 5s failure). Always works.
  • System banners — also attempted via UNUserNotifications, but macOS often denies auth for ad-hoc-signed debug builds. The popover is the reliable path; system banners light up once the app is properly signed/registered.

Events that produce banners: run started, run finished (success/fail), tool health check pass/fail.

📁 Project layout

Solve/
├── SolveApp.swift              # SwiftUI App entry (delegates everything to AppDelegate)
├── AppDelegate.swift           # Menu bar, menus, windows, notifications, observers
├── Models/
│   └── AppState.swift          # Shared @ObservableObject + CLITool + ToolHealth
├── Managers/
│   ├── ClaudeCodeManager.swift # Spawns the chosen CLI in print mode
│   ├── ClipboardManager.swift
│   ├── FolderManager.swift     # UserDefaults persistence (working dir, tool)
│   ├── MCPBridgeServer.swift   # Unix-socket HTTP server + run registry
│   └── ToolHealthChecker.swift # Independent "ping" probe with deadline
└── Views/
    ├── ProgressWindow.swift    # Live output display
    └── SettingsView.swift      # Tool picker + working directory
mcp/
├── solve_mcp_server.py         # FastMCP stdio sidecar
├── requirements.txt            # mcp[cli]
└── README.md                   # MCP install + config
test-fixtures/
└── buggy.py                    # Smoke-test fixture for end-to-end runs

Solve.xcodeproj/project.pbxproj lists files explicitly — when adding a new .swift file under Solve/, register it there (see existing MCPBridgeServer.swift entries as a template).

🩹 Troubleshooting

"No Working Directory" alert — menu → Set Working Directory…

Tool not found — run which kimi / which claude. Solve also looks in ~/.kimi-code/bin, /usr/local/bin, /opt/homebrew/bin.

Health check failed — open the progress window for the streamed ping output. Common causes: auth not configured for that CLI, network blocked, wrong PATH.

Settings window doesn't appear — the menu-bar app uses .accessory activation, so SwiftUI's Settings { … } scene doesn't surface reliably. Solve presents Settings as a manual NSWindow — ⌘, from the menu.

No system notification banners — see the Notifications section above; the in-app popover is the fallback.

MCP socket not found — Solve must be running. ls ~/Library/Application\ Support/Solve/solve.sock should show a socket file. If not, check Solve's NSLog output: log show --predicate 'process == "Solve"' --last 1m.

To set them, edit the repository's About section on GitHub and paste the topics above into the topics field.

📜 License

MIT.

About

macOS menu-bar wrapper that drives a CLI coding agent to fix what's on your clipboard.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors