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.
npx agentmods add commands/arkatom/ai-instructions/serenagit clone --depth 1 https://github.com/arkatom/ai-instructionsWhat 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.
| Model | Per session | Once 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 |
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.
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
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.
- 2d ago First seen · 179 lines · 12 tokens per session scan A 1f871b3380a9
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.
Other commands, from other repositories
git
Git operations with intelligent commit messages and workflow optimization.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.