serena

A command for structured problem-solving through Serena, an MCP-based development assistant. MCP is a standard way for an AI agent to use connected tools.

In plain words
What is it for?
Use it to debug issues, design systems, review or optimize code, implement features step by step, and create implementation todos.
Why use it?
It gives common development tasks a repeatable format and lets you choose how much analysis, detail, research, or implementation guidance to request.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/arkatom/ai-instructions/serena
Clone the repo
git clone --depth 1 https://github.com/arkatom/ai-instructions

Made for: Claude Code.

Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,710 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00012 $0.01710
Opus 5 $0.00006 $0.00855
Sonnet 5 $0.00002 $0.00342
Haiku 4.5 $0.00001 $0.00171

Measured 2d ago against content hash 1f871b3380a9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

serena scanned grade A with 0 findings 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 2d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/serena.md · 179 lines

How it starts

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

Quick Reference

/serena <problem> [options]           # Basic usage
/serena debug "memory leak in prod"   # Debug pattern (5-8 thoughts)
/serena design "auth system"          # Design pattern (8-12 thoughts)
/serena review "optimize this code"   # Review pattern (4-7 thoughts)
/serena implement "add feature X"     # Implementation (6-10 thoughts)

Options

Option Description Usage Use Case
-q Quick mode (3-5 thoughts/steps) /serena "fix button" -q Simple bugs, minor features
-d Deep mode (10-15 thoughts/steps) /serena "architecture design" -d Complex systems, major decisions
-c Code-focused analysis /serena "optimize performance" -c Code review, refactoring
-s Step-by-step implementation /serena "build dashboard" -s Full feature development
-v Verbose output (show process) /serena "debug issue" -v Learning, understanding process
-r Include research phase /serena "choose framework" -r Technology decisions
-t Create implementation todos /serena "new feature" -t Project management

Usage Patterns

Basic Usage

# Simple problem solving
/serena "fix login bug"

# Quick feature implementation
/serena "add search filter" -q

# Code optimization
/serena "improve load time" -c

Advanced Usage

# Complex system design with research
/serena "design microservices architecture" -d -r -v

# Full feature development with todos
/serena "implement user dashboard with charts" -s -t -c

# Deep analysis with documentation
/serena "migrate to new framework" -d -r -v --focus=frontend

Context (Auto-gathered)

  • Project files: !find . -maxdepth 2 -name "package.json" -o -name "*.config.*" | head -5 2>/dev/null || echo "No config files"
  • Git status: !git status --porcelain 2>/dev/null | head -3 || echo "Not git repo"

Core Workflow

1. Problem Detection & Template Selection

Automatically select thinking pattern based on keywords:

  • Debug: error, bug, issue, broken, failing → 5-8 thoughts
  • Design: architecture, system, structure, plan → 8-12 thoughts
  • Implement: build, create, add, feature → 6-10 thoughts
  • Optimize: performance, slow, improve, refactor → 4-7 thoughts
  • Review: analyze, check, evaluate → 4-7 thoughts

Read the full file on GitHub · 179 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. 2d ago First seen · 179 lines · 12 tokens per session scan A 1f871b3380a9

Subscribe to this mod's changes

serena is a command published in the GitHub repository arkatom/ai-instructions (1 stars, last pushed 9mo ago), licensed MIT. It adds 12 tokens to every session and 1,710 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.