---
title: "Selan practices: find what Claude Code spends, and cut it · Selan"
description: "A long, stale CLAUDE.md is paid for on every request, and missing checks let broken changes through. Selan practices reads your sessions on your machine and proposes the fixes, with the numbers behind each."
url: https://selan.ai/blog/2026-10-16-selan-practices
updated: 2026-10-16T11:24:22+03:00
---

[← All posts](https://selan.ai/blog)

Blog

# Selan practices: find what Claude Code spends, and cut it

A long, stale CLAUDE.md is paid for on every request, and missing checks let broken changes through. Selan practices reads your sessions on your machine and proposes the fixes, with the numbers behind each.

16 October 2026FeatureIn the docs: [Selan practices](https://selan.ai/docs/practices)

Many of the repositories we see are not set up well for Claude Code. Their `CLAUDE.md` has grown long, it names paths that no longer exist, and Claude Code sends all of it with every request. The checks that would catch a broken change are often missing, or run only after the merge.

Selan practices is a Claude Code plugin that helps with both. It reads the transcripts Claude Code keeps of every session in the repository you are in, counts what those sessions did, and proposes changes to how the repository is set up. Each proposal quotes the line it came from and the saving over the period the transcripts cover, and it writes only the changes you pick.

## Why it matters

Claude Code sends `CLAUDE.md` with every request, so every turn pays for all of it again, even when it comes from the prompt cache. Its size times your request count is often the largest single cost in a repository. A section only one kind of task needs is paid for by every other task too, and a path that no longer exists sends the agent looking for it.

Missing checks cost you differently. When a check runs only after the merge, a broken change is already merged by the time it fails. When a red pipeline does not block the merge, every check in it is only a suggestion.

![Terminal output of the quality gates script on a sample repository: a table of ten checks from format to review, with the local command, hook, blocking CI job and advisory CI job for each, and integration, e2e, budget, secrets and review run nowhere](https://selan.ai/img/blog/2026-10-16-selan-practices/quality-gates.webp)

quality-gates on a sample repository made up for this post: where each check runs, and which run nowhere.

That is the plugin's `quality-gates` audit on a sample repository. Format, lint, typecheck, build and unit tests each run somewhere, though lint in CI only advises. Integration, e2e, budget, secrets and review run nowhere, and some commits went in with no check since the last edit.

## Install it

If you use the Selan CLI, it is already installed: Selan's plugin catalog adds it by default. Anywhere else, run these two lines inside Claude Code:

```text
/plugin marketplace add selan-ai/selan-practices
/plugin install selan-practices@selan-practices
```

It needs `python3` on your `PATH`, and nothing else. The source is public and MIT licensed, at [github.com/selan-ai/selan-practices](https://github.com/selan-ai/selan-practices).

## Start with setup

Start Claude Code inside the repository and run:

```text
/selan-practices:setup
```

It works from the files alone, so it suits a new repository with no history. It shows what the repository has in five lines at most: the stack, its checks, whether a red pipeline blocks a merge, its `CLAUDE.md`, and how many sessions there are to learn from. Then it proposes a plan of at most five items and leaves out anything already in place.

Two of those items are components you add with one command each:

```text
/selan-practices:install code-review
/selan-practices:install dead-code
```

`code-review` adds an agent that reviews every merge request, the practice described in [Code review](https://selan.ai/docs/agents/code-review). `dead-code` finds code nothing reaches, locally and in CI, with the tool that suits the stack: knip, deadcode, vulture, clippy, Periphery, detekt or PMD. When a component needs a secret, the plugin names the CI variable to create and never asks for its value.

## Then the audits

The three audits read what the repository's sessions did, so they need a few weeks of them.

`/selan-practices:context-audit` looks at what every request carries. Besides `CLAUDE.md` itself, it counts command output filtered after the fact, large and generated files read, work done in another repository from this one, and paths `CLAUDE.md` names that no longer exist. It proposes a `CLAUDE.md` under 200 lines, with the sections only one kind of task needs moved into a rule file or a skill.

![Terminal output of the context audit script on a sample repository: token totals, Bash habits, two paths in CLAUDE.md that do not exist, the CLAUDE.md loaded into every request, reads over the cap, files by tokens carried, and commands whose output was filtered after the fact](https://selan.ai/img/blog/2026-10-16-selan-practices/context-audit.webp)

context-audit's counts for the same sample repository. Claude sees this summary, never the transcripts.

On the same sample, the audit's script finds the `CLAUDE.md` that goes out with every request, two paths in it that no longer exist, a generated lock file that sessions kept reading, and two commands whose output was cut down with `grep` or `tail` after it had been produced. A proposal quotes lines like these.

`/selan-practices:skill-audit` lists every skill and agent a session had (the repository's, your own and the ones plugins bring) and finds which ran, which failed and which sessions worked around by running the skill's commands by hand. It flags two skills with the same name, and throwaway scripts written to `/tmp` session after session. It never deletes a personal or plugin skill itself; it tells you what to remove.

`/selan-practices:quality-gates` draws the ladder shown above, cheapest check first, and shows where each one runs: a command someone has to remember, a hook, a CI job that only advises, or one that blocks the merge. It counts commits made with no check since the last edit, and proposes the gaps worth closing.

## You pick, it writes

Setup and the audits work over two turns. The first lists the changes, each quoting the line it comes from and naming the file it touches; an audit also gives the numbers and puts the largest saving first. You answer with the numbers you want. The second turn makes only those changes and shows you the diff. It never commits, so you review the diff and commit it yourself.

## Your transcripts stay on your machine

A standard-library Python script reads the transcripts locally and prints a summary of counts, like the two above. Claude sees that summary, as it would the output of any other command, and never the transcripts. To read the merge setting, `quality-gates` asks GitLab or GitHub through `glab` or `gh`, with your own login. If a repository has no sessions yet, an audit says so and stops.

[The docs](https://selan.ai/docs/practices) cover every command in full.

**How it works today.** A post says what changed on its day; the docs say how Selan works now.

[Selan practices](https://selan.ai/docs/practices)
