Show HN: Prismag – Per-block model routing for the terminal and any IDE Developer Rufus SD released Prismag, an open-source CLI tool that routes different parts of a single prompt to different AI models using @@tags, enabling per-block model selection in terminals and IDEs like Cursor and Claude Code. The tool addresses the limitation of current AI coding tools that force a single model per conversation or require manual context switching across multiple chats. One prompt enters. Each block routes to the right model. Tag any block with @@model and PRISMAG sends it to the model you chose — planning to Opus, implementation to Composer, summaries to a fast model — without switching the IDE picker or juggling chats. prismag @@opus: design the auth flow @@composer: implement the middleware ── @@opus → claude-4.6-opus-high-thinking ─────────────────────────── Use short-lived access tokens with rotating refresh tokens because… ── @@composer → composer-2.5-fast ─────────────────────────────────── // middleware/auth.go func RequireAuth next http.Handler http.Handler { … } routed 2 blocks · chained · 1.8s Today's AI coding tools force a binary choice: - Pick one model for the whole conversation, or - Open multiple chats and split the work by hand. Neither matches how you actually work. Planning wants depth Opus . Implementation wants speed Composer . Review wants a different lens entirely. | Without PRISMAG | With PRISMAG | |---|---| | One model per chat | A model per block, in one prompt | | Switch the picker between tasks | @@opus: … @@composer: … and go | | Manual context copy-paste between chats | Output of block N chains into block N+1 | | Auto-routing by cost/latency OpenRouter | You choose the model per block | | YAML/Python pipelines LangGraph/CrewAI | Chat-native @@ syntax, zero config | Prompt with @@tags ──▶ parser ──▶ orchestrator ──▶ model backends ──▶ sectioned result ▲ └── ContextStore in-memory · or maind - The trigger is , not @@ @ — a bare @ collides with the IDE's mention menu. @@ travels as plain text through every chat surface. - Routing is deterministic and owned by the CLI + registry.yaml . - Blocks run serial + chained by default output N → context N+1 , or --parallel for independent blocks. - Context flows through a pluggable store — in-memory by default, or maind https://github.com/rufus-SD/maind for encrypted, cross-session memory. Go 1.26+ go install github.com/rufus-SD/prismag@latest or clone and build git clone https://github.com/rufus-SD/prismag.git cd prismag && make install 1. Guided onboarding — environment, optional API keys, model discovery, registry prismag setup 2. Wire routing into your editor auto-detects the tool prismag init 3. Route a prompt prismag run "@@opus: plan the cache layer" "@@composer: implement it" Or just run prismag with no args to drop into the interactive prismag session. PRISMAG works in two ways , from the same global config: CLI / REPL — runs in any terminal, on any OS. Executes each block via provider APIs using your keys. Universal, deterministic. In your IDE — prismag init writes a rule that teaches the agent to route @@ blocks through PRISMAG. Where the IDE supports per-task subagents, each block is dispatched to its own subagent + model using your subscription no API keys needed . | Editor | Rule file | Dispatch | |---|---|---| Cursor | .cursor/rules/prismag-routing.mdc + .cursor/agents/ | subagents any model | Claude Code | CLAUDE.md + .claude/agents/ | subagents Claude + API fallback | Windsurf | .windsurf/rules/prismag-routing.md | runs via prismag run | GitHub Copilot | .github/copilot-instructions.md | runs via prismag run | Cline | .clinerules/prismag-routing.md | runs via prismag run | Roo Code | .roo/rules/prismag-routing.md | runs via prismag run | Aider | CONVENTIONS.md | runs via prismag run | generic | .prismag/rules.md | runs via prismag run | prismag connect cursor or: claude, windsurf, copilot, cline, roo, aider, generic Subagent dispatch gives true per-block model switching where the editor exposes it Cursor, Claude Code . Everywhere else, the agent runs prismag run and shows the sectioned output verbatim — same routing, same result. @@