django-orm-expert

django-orm-expert is an agent for Claude Code from nodnarbnitram/claude-code-extensions. It costs 39 tokens per session (5,267 once invoked), scanned A, original, MIT.

A specialist for improving how Django applications read and write database data through Django’s built-in query tools. It examines models, relationships, indexes, and query patterns before suggesting changes.

In plain words
What is it for?
Use it to optimize Django queries, improve database schemas, add indexes, fix N+1 queries, and create migrations for database changes.
Why use it?
It helps find slow database operations and common problems such as repeated queries for related records. It also keeps performance changes aligned with the existing project structure.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the cce-django plugin — 3 agents shipped together

Good fit Use it to optimize Django queries, improve database schemas, add indexes, fix N+1 queries, and create migrations for database changes.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/nodnarbnitram/claude-code-extensions/django-orm-expert
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.

Clone the repo
git clone --depth 1 https://github.com/nodnarbnitram/claude-code-extensions

Made for: Claude Code.

Or install cce-django, the plugin that ships this one along with the rest of its 3 agents.

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 django-orm-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/nodnarbnitram/claude-code-extensions/django-orm-expert.svg)](https://agentmods.dev/agents/nodnarbnitram/claude-code-extensions/django-orm-expert)
Your own site
<a href="https://agentmods.dev/agents/nodnarbnitram/claude-code-extensions/django-orm-expert"><img src="https://agentmods.dev/badge/agents/nodnarbnitram/claude-code-extensions/django-orm-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,267 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00039 $0.05267
Opus 5 $0.00019 $0.02634
Sonnet 5 $0.00008 $0.01053
Haiku 4.5 $0.00004 $0.00527

Measured 3d ago against content hash a545417a97ab, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

django-orm-expert 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 3d 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.

plugins/cce-django/agents/django-orm-expert.md · 828 lines

How it starts

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

Django ORM Expert

You are a Django ORM expert with deep knowledge of database optimization, complex queries, and performance tuning. You excel at writing efficient queries, designing optimal database schemas, and solving performance problems while working within existing project constraints.

Intelligent Query Optimization

Before optimizing any queries, you:

  1. Analyze Current Models: Examine existing model relationships, indexes, and query patterns
  2. Identify Bottlenecks: Profile queries to understand specific performance issues
  3. Assess Data Patterns: Understand data volume, access patterns, and growth trends
  4. Design Optimal Solutions: Create optimizations that work with existing codebase architecture

Structured Performance Reporting

When optimizing database operations, you return structured findings:

## Django ORM Optimization Completed

### Performance Improvements
- [Specific optimizations applied]
- [Query performance before/after metrics]

### Database Changes
- [New indexes, constraints, or schema modifications]
- [Migration files created]

### Code Optimizations
- [QuerySet improvements]
- [N+1 query fixes]
- [Bulk operation implementations]

### Integration Impact
- APIs: [How optimizations affect existing endpoints]
- Backend Logic: [Changes needed in business logic]
- Monitoring: [Metrics to track ongoing performance]

### Recommendations
- [Future optimization opportunities]
- [Monitoring suggestions]
- [Scaling considerations]

### Files Modified/Created
- [List of affected files with brief description]

IMPORTANT: Always Use Latest Documentation

Before implementing any Django ORM features, you MUST fetch the latest Django documentation to ensure optimal performance patterns:

  1. First Priority: Use context7 MCP to get Django documentation: /django/django
  2. Fallback: Use WebFetch to get docs from docs.djangoproject.com
  3. Always verify: Current Django ORM features and optimization techniques

Read the full file on GitHub · 828 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. 3d ago First seen · 828 lines · 39 tokens per session scan A a545417a97ab

Subscribe to this mod's changes

django-orm-expert is an agent published in the GitHub repository nodnarbnitram/claude-code-extensions (16 stars, last pushed 4mo ago), licensed MIT. It adds 39 tokens to every session and 5,267 once invoked, about $0.0002 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-09-03.

Related

Other agents, from other repositories

supabase-architect

Projeta schema + RLS + topologia realtime antes da primeira migration. Entrega plano arquitetural (schema, RLS, realtime, branching). Use ao iniciar app Supabase. Não escreve código. (pesado).

luanpdd/kit-mcp · 50 tokens

evolution-go-integrator

Gera tabelas orgwhatsappconfigs + whatsappmessages, webhook Edge Function e send queue pgmq para WhatsApp (Evolution Go ou Meta Cloud API) em Supabase B2B multi-tenant. (pesado — despacha.

luanpdd/kit-mcp · 53 tokens

backend-architect

Design RESTful APIs, microservice boundaries, and database schemas. Reviews system architecture for scalability and performance bottlenecks. Use PROACTIVELY when creating new backend services or APIs.

einverne/dotfiles · 41 tokens

cqrs-specialist

Use for event-driven and CQRS work: command/outbox writes, idempotent projectors, and read-model handlers. Domain-neutral; never catches errors inside a transaction boundary.

mnzralee/claude-multi-agent-architecture · 41 tokens

Backend Architect

Senior backend architect specializing in scalable system design, database architecture, API development, and cloud infrastructure. Builds robust, secure, performant server-side applications and microservices.

criptogus/agent-evolve-network · 34 tokens

backend

A back-end development agent for the server-side parts of an application, including APIs, databases, authentication, and infrastructure. An API lets software exchange data, while authentication checks identity and authorization controls access.

workdd/my_claude_code_setting · 89 tokens