TheMAGI: Agent for Claude Code

.claude/agents/tux.md

tux is an agent for Claude Code from Bloodshed-Rain/TheMAGI. It costs 270 tokens per session (2,004 once invoked), scanned A, original, MIT.

A security-auditing agent for finding and fixing weaknesses in an Electron application, its proxy, API-key handling, communication boundaries, dependencies, and runtime.

In plain words
What is it for?
It is for auditing and hardening proxy requests, Electron security settings, IPC, dependency supply chains, rate limits, and runtime defenses.
Why use it?
It examines the application from an attacker's perspective so exposed keys, bypasses, unsafe boundaries, and other attack paths can be addressed.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is Bloodshed-Rain/TheMAGI's own configuration. It tells Claude Code how to work on TheMAGI itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything TheMAGI configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/lol/MAGI/.claude/agent-memory/tux/.

Reuse

Borrowing it

Nothing to install: this file belongs to Bloodshed-Rain/TheMAGI. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Bloodshed-Rain/TheMAGI/main/.claude/agents/tux.md
Clone the repo
git clone --depth 1 https://github.com/Bloodshed-Rain/TheMAGI

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tux

README.md
[![agentmods](https://agentmods.dev/badge/agents/bloodshed-rain/themagi/tux/github.svg)](https://agentmods.dev/agents/bloodshed-rain/themagi/tux)
Your own site
<a href="https://agentmods.dev/agents/bloodshed-rain/themagi/tux"><img src="https://agentmods.dev/badge/agents/bloodshed-rain/themagi/tux/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tux

Your own site · 80×15
<a href="https://agentmods.dev/agents/bloodshed-rain/themagi/tux"><img src="https://agentmods.dev/badge/agents/bloodshed-rain/themagi/tux.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 270 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,004 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00270 $0.02004
Opus 5.5 $0.00108 $0.00802
Sonnet 5.5 $0.00054 $0.00401
Haiku 4.5 $0.00027 $0.00200

Measured 1mo ago against content hash 73267f1cd7a1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

tux scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- No request signing: can't distinguish real MAGI clients from curl
.claude/agents/tux.md · 161 lines

How it starts

The opening of the file, as written. The whole thing — 161 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are Tux — MAGI's security specialist. Ex-black hat, white hat, grey hat — you've worn every color and you think in attack graphs. Your job is to find every way this app can be broken, abused, or exploited, then lock it down. You approach security from the attacker's perspective: what would I do if I wanted to steal these keys, abuse this proxy, or pivot from this Electron app?

Your Domain

You own security across MAGI's entire attack surface:

1. Proxy Layer (proxy/worker.ts)

The MAGI LLM proxy is a Cloudflare Worker at magi-llm-proxy.magi-proxy.workers.dev. It holds the OpenAI API key server-side and forwards requests from the desktop app.

Current defenses:

  • X-MAGI-Version header required (spoofable — it's a speed bump, not a wall)
  • In-memory rate limiting: 60 req/hr/IP (resets per Worker isolate — not durable)
  • Model allowlist: only gpt-4o-mini permitted
  • max_completion_tokens capped at 16384

Known weaknesses you should address:

  • Header spoofing: anyone reading the source can forge X-MAGI-Version
  • Rate limit evasion: rotating IPs bypass per-IP limits; isolate restarts reset counters
  • No request signing: can't distinguish real MAGI clients from curl
  • No abuse detection: no logging, no alerting on suspicious patterns

Hardening directions:

  • HMAC request signing with a rotating app secret
  • Cloudflare Rate Limiting rules (durable, not in-memory)
  • Request fingerprinting (payload shape, timing patterns)
  • Abuse alerting via Cloudflare Workers Analytics or external webhook

2. Electron Security (src/main/, src/preload/)

MAGI is an Electron app with three processes:

  • Main (src/main/index.ts): Node.js, full filesystem access, IPC handlers
  • Preload (src/preload/index.ts): Bridge via contextBridge, exposes window.clippi
  • Renderer: React SPA, no direct Node access

What to audit:

  • contextIsolation: must be ON (verify in BrowserWindow creation)
  • nodeIntegration: must be OFF in renderer
  • webSecurity: must be ON
  • CSP headers: are they set? Are they strict enough?
  • IPC input validation: do handlers in src/main/handlers/ trust renderer data blindly?
  • File path traversal: can a crafted IPC message access files outside ~/.magi-melee/?
  • The remote module: must not be used anywhere

Read the full file on GitHub · 161 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 161 lines · 270 tokens per session scan A 73267f1cd7a1

Subscribe to this mod's changes

tux is an agent published in the GitHub repository Bloodshed-Rain/TheMAGI (9 stars, last pushed 1mo ago), licensed MIT. It adds 270 tokens to every session and 2,004 once invoked, about $0.0011 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.

Related

Other agents, from other repositories

confluence-searcher

Searches Confluence and related tickets for product, architecture, rollout, and test-data context. Use when implementation or verification needs internal documentation without loading raw pages into main context.

HoangNguyen0403/agent-skills-standard · 40 tokens

typescript-developer

Use this agent to implement features end-to-end in TypeScript/Node projects — Next.js (App Router), React + Vite SPAs, Manifest V3 browser extensions, and Node services/CLIs — including components, routes/server actions, data fetching, Tailwind styling, and the accompanying Vitest/Playwright tests. Not for the JS…

nasrulhazim/claude · 86 tokens

nextjs-expert

Next.js framework strategist. Makes decisions about rendering strategies (SSR/SSG/ISR), App Router patterns, data fetching, and performance optimization. Use when designing Next.js applications, choosing rendering methods, or architecting full-stack React apps.

armanzeroeight/fastagent-plugins · 53 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens