# Moodle performance

> Moodle performance is an open-source agent skill for developer tools. Guides an agent through performance tuning for Moodle plugins: caching, queries, tasks. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/SaadRahman01/claude-moodle-dev/tree/main/skills/moodle-performance
- **Repository:** https://github.com/saadrahman01/claude-moodle-dev
- **GitHub stars:** 44
- **License:** MIT
- **Skill name:** moodle-performance
- **Collection:** https://github.com/SaadRahman01/claude-moodle-dev
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

This skill gives an AI coding agent a performance playbook for Moodle plugin development. It covers defining and using Moodle Universal Cache (MUC) definitions with the right mode and key/data settings, cutting database load with recordsets, batched lookups and index design, and moving slow work into ad-hoc or scheduled tasks guarded by locks.

The skill also walks through diagnosis: enabling the performance debug footer and the $PERF counter, reading slow-query logs and running EXPLAIN on suspect queries, and using the profiling tool. It adds guidance on batching capability checks, lazy-loading AMD modules, OPcache and APCu settings, Redis sessions, and frontend build and caching flags, along with a table of common mistakes to avoid.

The agent works with PHP code in a Moodle codebase and uses its config.php, db/caches.php, db/tasks.php and XMLDB index definitions as the reference points. The skill itself is instructions only and runs no scripts.

## When your agent uses it

> Use when optimizing Moodle plugin performance — MUC caching definitions, query optimization, recordsets vs records, ad-hoc and scheduled tasks, lazy loading, OPcache, query log analysis, $PERF, and performance debug toolbar.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/SaadRahman01/claude-moodle-dev/tree/HEAD/skills/moodle-performance)
- [License: MIT](https://github.com/SaadRahman01/claude-moodle-dev/tree/HEAD/skills/moodle-performance)

## Features

- **MUC cache definitions:** Explains choosing application, session or request cache modes and setting simplekeys and simpledata for faster lookups.
- **Database query tuning:** Covers recordsets over full loads, batching N+1 lookups with get_in_or_equal, and index and EXPLAIN checks.
- **Background task patterns:** Shows how to queue ad-hoc tasks, define scheduled tasks and prevent overlapping runs with locks.
- **Capability check batching:** Replaces per-row has_capability calls with a single get_users_by_capability query.
- **Profiling and debug tools:** Describes the performance debug footer, the $PERF counter, slow-query logs and the profiling tool.
- **Server and frontend settings:** Covers OPcache, APCu, Redis sessions, session lock release, AMD lazy loading and production theme settings.

## Good for

- Find out why a Moodle plugin page runs too many database queries
- Convert a loop that loads a huge table into a streamed recordset
- Move email sending out of a form POST handler into an ad-hoc task
- Add a MUC cache definition with invalidation for a settings-driven value
- Set up OPcache and session storage for a production Moodle server

## Install

### Claude Code

This skill ships in the `moodle-dev` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add SaadRahman01/claude-moodle-dev
/plugin install moodle-dev@moodle-dev
```

Or copy only this skill to `~/.claude/skills/moodle-performance`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/moodle-performance &&
cp -R "$tmp/skills/moodle-performance" ~/.claude/skills/moodle-performance &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/moodle-performance` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/moodle-performance` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/moodle-performance &&
cp -R "$tmp/skills/moodle-performance" ~/.agents/skills/moodle-performance &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/moodle-performance` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/moodle-performance` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/moodle-performance &&
cp -R "$tmp/skills/moodle-performance" ~/.cursor/skills/moodle-performance &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/moodle-performance` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/SaadRahman01/claude-moodle-dev.git --path skills/moodle-performance
```

Or copy the folder to `~/.gemini/skills/moodle-performance` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/moodle-performance`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/moodle-performance &&
cp -R "$tmp/skills/moodle-performance" ~/.copilot/skills/moodle-performance &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/moodle-performance` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git
```

Then copy `claude-moodle-dev/skills/moodle-performance` into your agent's skills folder as `moodle-performance`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run?

It is instructions only. It bundles no scripts, and its frontmatter sets no allowed tools. It assumes a Moodle plugin codebase in PHP.

### When does Moodle performance trigger?

The description says it applies when optimizing Moodle plugin performance, covering MUC caching, query optimization, recordsets, tasks, lazy loading, OPcache, query log analysis, $PERF and the debug toolbar.

### Which cache modes does Moodle performance describe?

It describes three MUC modes: application (persistent until invalidated), session (lasts for the session) and request (a single PHP request).

### Does Moodle performance change the Moodle site automatically?

No. It gives code patterns and configuration examples for the agent to apply, such as config.php, php.ini and db/tasks.php settings.

### How do I install Moodle performance in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/moodle-performance to use it in all your projects, or to .claude/skills/moodle-performance in one project. Or install the moodle-dev plugin, which includes it: /plugin marketplace add SaadRahman01/claude-moodle-dev, then /plugin install moodle-dev@moodle-dev.

### Does Moodle performance run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Moodle performance?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Moodle performance?

The closest alternatives to Moodle performance are Moodle phpunit testing, Moodle plugin development, Moodle security audit, Moodle accessibility and Moodle upgrade migration.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Moodle phpunit testing](https://ai-powered.com/skills/moodle-phpunit-testing): Moodle phpunit testing is an open-source agent skill for developer tools.
- [Moodle plugin development](https://ai-powered.com/skills/moodle-plugin-development): Moodle plugin development is an open-source agent skill for developer tools.
- [Moodle security audit](https://ai-powered.com/skills/moodle-security-audit): Moodle security audit is an open-source agent skill for security.
- [Moodle accessibility](https://ai-powered.com/skills/moodle-accessibility): Moodle accessibility is an open-source agent skill for developer tools.
- [Moodle upgrade migration](https://ai-powered.com/skills/moodle-upgrade-migration): Moodle upgrade migration is an open-source agent skill for developer tools.
- [Moodle theme development](https://ai-powered.com/skills/moodle-theme-development): Moodle theme development is an open-source agent skill for developer tools.
- [Moodle behat testing](https://ai-powered.com/skills/moodle-behat-testing): Moodle behat testing is an open-source agent skill for developer tools.
- [Moodle mobile app](https://ai-powered.com/skills/moodle-mobile-app): Moodle mobile app is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/moodle-performance
