DEV Community

albert nahas
albert nahas

Posted on

I Built a Claude Code Plugin That Enforces My Development Standards in Every Session

I use Claude Code daily, and one thing that kept bugging me was how I'd start every project with the same intent — "follow best practices, no shortcuts, fix root causes" — but there was no structured way to enforce that consistently across sessions and projects.

So I built a plugin that lets you define your development standards in a YAML file and automatically injects them into every Claude Code session.

What It Does

You define your values once:

# ~/.claude/core-values.yml
motto: "Excellence is not negotiable. Quality over speed."

sections:
  - name: Quality Commitment
    values:
      - "No Half Solutions: Always fix everything until it's 100% functional."
      - "No Corner Cutting: Do the real work until completion."
      - "No Band-Aid Solutions: Fix the root cause, not the symptom."
      - "Follow Through: Continue until completely done and verified."

  - name: Standards
    values:
      - "Follow best practices and highest industry standards."
      - "Build efficient, modular code with separation of concerns."
      - "Always consider performance, scalability, and maintainability."

  - name: Problem Solving
    values:
      - "Exhaust all possibilities before assuming external failures."
      - "Avoid over-engineering  minimal changes required for the task."
      - "Consider all possible solutions to select the best one."
Enter fullscreen mode Exit fullscreen mode

The plugin handles the rest. Every session, every prompt — your standards are present.

How It Works

The plugin uses Claude Code's hooks system to inject your values at two key moments:

1. Session start — Your full values are injected when a session begins. This hook also fires after context compaction, so your standards are automatically restored when Claude compresses the conversation to free up space.

2. Every prompt — A single-line motto reminder reinforces your core principle throughout the session. This is lightweight (~15 tokens) but keeps your standards top of mind as the conversation grows.

## Core Values & Development Standards

**Excellence is not negotiable. Quality over speed.**

### Quality Commitment
- **No Half Solutions**: Always fix everything until it's 100% functional.
- **No Corner Cutting**: Do the real work until completion.
...
Enter fullscreen mode Exit fullscreen mode

That's what Claude sees at the start of every session. Clean, structured, unambiguous.

Starter Templates

Not everyone wants to write their own values from scratch. The plugin ships with four templates you can pick from:

Template Philosophy
Craftsman Quality-obsessed. No half solutions. No shortcuts.
Startup Ship fast, iterate rapidly, pragmatic quality. Bias for action.
Security-First Defense in depth, zero trust, OWASP compliance.
Minimal Simple baseline: working code, follow patterns, test before push.

Run /core-values init, pick one, and you're set. Or use a template as a starting point and customize it.

Per-Project Overrides

The plugin checks two locations in order:

  1. Project-level: .claude/core-values.yml in your repo
  2. User-level: ~/.claude/core-values.yml (global default)

Project-level takes precedence. This means you can run "startup" values on your side project while keeping "craftsman" standards on your main codebase — without changing any global config.

Team Distribution

This is where it gets practical for teams. Instead of telling every developer "paste these 30 lines into your CLAUDE.md," you distribute values as a plugin:

/plugin marketplace add albertnahas/claude-core-values
/plugin install claude-core-values@claude-core-values
/core-values init
Enter fullscreen mode Exit fullscreen mode

Three commands. Everyone gets identical standards. No drift, no "I forgot to update mine."

And because it's YAML, diffs are clean. When you update the team's values, the change is easy to review and version.

Why YAML Over Freeform Text?

I considered just writing values in markdown, but YAML gives you:

  • Sections: Group related values (quality, security, problem-solving)
  • A motto field: The single line used for per-prompt reinforcement
  • Diffable structure: Easy to review changes in PRs
  • Machine-readable: The plugin parses and formats it — you don't have to worry about markdown formatting

The Token Budget

A question I get: "Doesn't injecting values on every prompt waste context?"

The numbers:

  • Session start: ~300-400 tokens for the full injection (one time, plus after compactions)
  • Per-prompt reminder: ~15 tokens (just the motto)
  • 50-turn session total: ~750 tokens from reminders

Against a 200k context window, that's 0.375%. A rounding error.

Installation

/plugin marketplace add albertnahas/claude-core-values
/plugin install claude-core-values@claude-core-values
Enter fullscreen mode Exit fullscreen mode

Then:

/core-values init    # Pick a template
/core-values show    # View active values
Enter fullscreen mode Exit fullscreen mode

Edit ~/.claude/core-values.yml directly anytime. Changes take effect on the next session.

Requirements

  • Claude Code
  • Python 3 (ships with macOS and most Linux distros)
  • PyYAML optional — includes a zero-dependency fallback parser

The plugin is open source and MIT licensed: github.com/albertnahas/claude-core-values

If you have ideas for new templates or improvements, PRs are welcome.

Top comments (0)