# How to install the Astral plugins for Claude Code


Astral publishes an [official Claude Code plugin](https://github.com/astral-sh/claude-code-plugins) that bundles three skills (`/astral:uv`, `/astral:ruff`, `/astral:ty`) and a [ty](https://pydevtools.com/handbook/reference/ty.md) language server. The skills give Claude up-to-date usage guidance for each tool, and the language server feeds live type-checking diagnostics into the conversation.

> [!TIP]
> The [project setup tutorial](https://pydevtools.com/handbook/tutorial/set-up-a-python-project-for-claude-code.md) installs this plugin as part of a complete Claude Code configuration on a fresh uv project.

## Prerequisites

* [Claude Code](https://claude.com/product/claude-code) installed
* [uv installed](https://pydevtools.com/handbook/how-to/how-to-install-uv.md) (required by the ty language server)

## Install the plugin for yourself

### 1. Add the Astral marketplace

Run this slash command inside Claude Code:

```
/plugin marketplace add astral-sh/claude-code-plugins
```

### 2. Install the plugin

```
/plugin install astral@astral-sh
```

You can also browse available plugins interactively with `/plugin`.

## Install the plugin for your team

To enable the plugin for everyone who works in a repository, add the following to `.claude/settings.json` at the project root:

```json
{
  "extraKnownMarketplaces": {
    "astral-sh": {
      "source": {
        "source": "github",
        "repo": "astral-sh/claude-code-plugins"
      }
    }
  },
  "enabledPlugins": {
    "astral@astral-sh": true
  }
}
```

Team members will be prompted to install the plugin when they trust the repository.

## Use the skills

Once installed, invoke a skill by name whenever you want Claude to follow best practices for that tool:

| Skill | What it covers |
|---|---|
| `/astral:uv` | Project setup, dependency management, scripts, and the pip compatibility interface |
| `/astral:ruff` | Linting with `ruff check`, formatting with `ruff format`, and migration from Black, Flake8, or isort |
| `/astral:ty` | Type checking with `ty check`, rule configuration, and migration from mypy or pyright |

To make Claude reach for these skills automatically, add a line to your project's `CLAUDE.md`:

```markdown
When working with Python, invoke the relevant `/astral:<skill>` for `uv`, `ty`, and `ruff` to ensure best practices are followed.
```

## What the language server provides

The plugin also starts a ty language server for `.py` and `.pyi` files. This gives Claude access to type-checking diagnostics without running `ty check` manually. The language server requires `uvx` to be available on `PATH` because it runs `uvx ty@latest server` under the hood.

## Learn more

* [Astral plugin repository on GitHub](https://github.com/astral-sh/claude-code-plugins)
* [How to configure Claude Code to use uv](https://pydevtools.com/handbook/how-to/how-to-configure-claude-code-to-use-uv.md)
* [How to configure Ruff with Claude Code](https://pydevtools.com/handbook/how-to/how-to-configure-ruff-with-claude-code.md) walks through `/astral:ruff`
* [How to configure Claude Code with a Python type checker](https://pydevtools.com/handbook/how-to/how-to-configure-claude-code-with-a-python-type-checker.md) walks through `/astral:ty`
* [ty reference](https://pydevtools.com/handbook/reference/ty.md)
* [ruff reference](https://pydevtools.com/handbook/reference/ruff.md)
* [uv reference](https://pydevtools.com/handbook/reference/uv.md)
