Skip to content
Back to skills

003 Name Skill A23fac79

ASecurity

This skill should be used when the user asks to update, refresh, optimize, or clean up CLAUDE.md, or when documentation is stale, verbose, or out of sync with codebase reality. Triggers on "update CLAUDE.md", "refresh the docs", "sync CLAUDE.md with the codebase", "optimize project instructions", "clean up CLAUDE.md", "improve CLAUDE.md", "fix CLAUDE.md".

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
documentationgobashdatabasedocumentation

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 003-name-skill_a23fac79 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 003 Name Skill A23fac79?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 003 Name Skill A23fac79
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-003-name-skill-a23fac79/badge)](https://www.skillsdirectory.com/skills/tools-only-003-name-skill-a23fac79)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
name: updateclaudemd
description: >
  This skill should be used when the user asks to update, refresh, optimize, or
  clean up CLAUDE.md, or when documentation is stale, verbose, or out of sync
  with codebase reality. Triggers on "update CLAUDE.md", "refresh the docs",
  "sync CLAUDE.md with the codebase", "optimize project instructions",
  "clean up CLAUDE.md", "improve CLAUDE.md", "fix CLAUDE.md".
allowed-tools:
  - Read
  - Glob
  - Grep
  - Edit
  - Write
  - Bash(wc:*)
  - AskUserQuestion
hooks:
  PreToolUse:
    - matcher: "Write"
      command: "cp CLAUDE.md CLAUDE.md.bak 2>/dev/null || true"
      once: true
---

# Update and Optimize CLAUDE.md

## Principles

Content in CLAUDE.md is justified only if it changes how Claude acts in the next session. Apply this test to every line — remove anything that does not influence behavior. Aim for 150-250 lines; favor patterns and principles over verbose documentation.

## Step 1: Read Current State and Explore Codebase

If no `CLAUDE.md` exists, inform the user and begin from scratch using codebase exploration only. Otherwise, read the existing `CLAUDE.md` and note its line count, section structure, and any content that looks stale or duplicated. Then explore the project systematically: read configuration files (package.json, Cargo.toml, requirements.txt, etc.), map the directory structure, identify the tech stack, and note established patterns and conventions. Focus on what would change how a future Claude session works in this codebase.

Stop exploration when the major directories, tech stack, and 3-5 key patterns are identified — patterns that affect how code should be written, tested, or deployed in this project. Do not attempt exhaustive coverage.

## Step 2: Reconcile and Optimize

Compare codebase reality with current documentation. Apply the governing principle to every line.

Verify that commands, paths, dependencies, and environment variables are still accurate.

The dividing line: remove content Claude would infer from reading the codebase itself; keep content that would cause errors or suboptimal behavior without explicit documentation.

Cut: code blocks duplicating source files, verbose explanations, one-time setup troubleshooting, philosophical "why this matters" sections, anything Claude can derive from file inspection.

Keep: architecture decisions, essential development commands, coding conventions, critical gotchas, non-obvious behaviors that need documentation to prevent errors.

Proceed to Step 3 when every section has been evaluated against the governing principle and all inaccurate references are corrected.

## Step 3: Structure for Scanning

Organize into scannable sections appropriate for this project type. Common sections: project overview, development commands, architecture principles, project structure, coding conventions, and development notes. Add conditional sections (design system, database schema, environment variables) only when the project warrants them.

If the existing CLAUDE.md has content whose purpose is unclear, use AskUserQuestion to confirm before removing it.

## Step 4: Write the Optimized Version

Write the updated CLAUDE.md. Ensure scannable headers, concise actionable content, accurate reflection of the current codebase, and minimal redundancy.

A `CLAUDE.md.bak` backup was created automatically before this write. Inform the user it exists for diffing and suggest removing it after review.

## Output Summary

Summarize what changed: line count before vs after, sections added or removed, and key corrections applied.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.