Agent skill

Codebase Analyzer

by severity1 in severity1/claude-code-auto-memory

This skill should be used when the user asks to "initialize auto-memory", "create CLAUDE.md", "set up project memory", or runs the /auto-memory:init command.

MITAuto-check passedAgent Workflows

Install Codebase Analyzer

skills CLI
$ npx skills add severity1/claude-code-auto-memory --skill codebase-analyzer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install severity1/claude-code-auto-memory codebase-analyzer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/severity1/claude-code-auto-memory.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/codebase-analyzer .claude/skills/codebase-analyzer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
codebase-analyzer
GitHub stars
159
Token cost
~1.5k tokens
SKILL.md length
569 words
Files
6
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

This skill should be used when the user asks to "initialize auto-memory", "create CLAUDE.md", "set up project memory", or runs the /auto-memory:init command.

  • Works in 7 steps: Check Existing CLAUDE.md → Scan Directory Structure → Identify Subtree Candidates → …
  • Asks to initialize auto-memory
  • SKILL.md covers Guidelines, Algorithm, Marker Syntax and Section Definitions, plus 3 more sections
  • Reaches code.claude.com

What it does

Codebase Analyzer is an agent skill from severity1/claude-code-auto-memory. This skill should be used when the user asks to "initialize auto-memory", "create CLAUDE.md", "set up project memory", or runs the /auto-memory:init command. Analyzes codebase structure and generates CLAUDE.md files using the exact template format with AUTO-MANAGED markers.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files.

It sits in Agent Workflows, covering Agent instruction files and Agent memory. The repository describes itself as: Claude Code plugin that automatically maintains CLAUDE.md files. The licence is MIT.

When your agent uses it

  • Asks to initialize auto-memory
  • Create CLAUDE.md
  • Set up project memory
  • Runs the /auto-memory:init command

Example prompts

  • “initialize auto-memory”
  • “create CLAUDE.md”
  • “set up project memory”
  • “/codebase-analyzer”

Requirements

  • Python 3
  • Node.js

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Check Existing CLAUDE.md
  2. Scan Directory Structure
  3. Identify Subtree Candidates
  4. Detect Code Patterns
  5. Fetch Memory Guidelines (Optional)
  6. Present Findings
  7. Generate Memory Files

What it can do on your machine

Read from SKILL.md and the folder at commit d8254a8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • code.claude.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Codebase Analyzer loads about 1.5k tokens when it runs. Until then it costs about 73 tokens; SKILL.md has 569 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~73
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from severity1/claude-code-auto-memory at commit d8254a8, republished under its MIT licence (© severity1). 569 words, ~1,539 tokens.

Download SKILL.mdSave it as .claude/skills/codebase-analyzer/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
codebase-analyzer
description
This skill should be used when the user asks to "initialize auto-memory", "create CLAUDE.md", "set up project memory", or runs the /auto-memory:init command. Analyzes codebase structure and generates CLAUDE.md files using the exact template format with AUTO-MANAGED markers.

Codebase Analyzer

Analyze project structure and generate CLAUDE.md files interactively.

Guidelines

MANDATORY: All rules below must be followed exactly. Violations produce incorrect CLAUDE.md content.

@../shared/references/guidelines.md

Algorithm

1. Check Existing CLAUDE.md

If CLAUDE.md already exists, ask the user how to handle it:

  • Migrate: Convert to auto-managed format (add markers)
  • Backup: Create CLAUDE.md.backup and generate fresh
  • Merge: Keep manual sections, add auto-managed sections
  • Cancel: Abort initialization
2. Scan Directory Structure

Detect frameworks and build systems:

  • package.json - Node.js/JavaScript
  • pyproject.toml, setup.py - Python
  • Cargo.toml - Rust
  • go.mod - Go
  • Makefile - Make-based builds
  • Dockerfile - Container builds

Extract build/test/lint commands from config files.

3. Identify Subtree Candidates

Look for framework boundaries that warrant separate CLAUDE.md files:

  • src/ with 10+ source files
  • lib/ directory
  • packages/* (monorepo packages)
  • apps/* (monorepo applications)
4. Detect Code Patterns

Analyze source files for conventions:

  • Naming: PascalCase, camelCase, snake_case usage
  • Imports: ES6 modules, CommonJS, ordering patterns
  • Architecture: Feature-based, layered, MVC patterns
  • Style: Indentation, quotes, semicolons
5. Fetch Memory Guidelines (Optional)

If network available, fetch from https://code.claude.com/docs/en/memory:

  • Use WebFetch tool
  • Extract relevant sections for context
  • Reference official guidelines above as primary source
6. Present Findings

Use AskUserQuestion to confirm:

  • Detected framework and commands
  • Suggested subtree locations
  • Detected patterns
7. Generate Memory Files

Read .claude/auto-memory/config.json to determine which files to generate based on memoryFiles:

memoryFiles valueFiles to generate
absent or ["CLAUDE.md"]CLAUDE.md only (full content)
["AGENTS.md"]AGENTS.md only (full content)
["CLAUDE.md", "AGENTS.md"]AGENTS.md (full content) + CLAUDE.md (redirect)

Generate full-content files using the EXACT template structure. Follow these steps precisely:

  1. Copy template skeleton - Use the appropriate template (CLAUDE or AGENTS) as the base structure
  2. Use exact marker format - See Marker Syntax section below
  3. Replace placeholders - Substitute {{PLACEHOLDER}} with detected content
  4. Include all required sections - Even if content is minimal, include the section
  5. Add MANUAL section at the end for user notes
  6. Size limits: Root 150-200 lines, Subtrees 50-75 lines

When both CLAUDE.md and AGENTS.md are configured, also generate redirect files:

  • At the root: write CLAUDE.md using CLAUDE.redirect.md.template (static pointer, no markers)
  • For each subtree that gets an AGENTS.md: write a matching CLAUDE.md redirect alongside it
Show full SKILL.md (234 more words)Show less

Marker Syntax

CRITICAL: Use the EXACT marker format below. Do NOT use variations.

markdown
<!-- AUTO-MANAGED: section-name -->
## Section Heading

Content goes here

<!-- END AUTO-MANAGED -->

For user-editable content:

markdown
<!-- MANUAL -->
## Custom Notes

Add project-specific notes here. This section is never auto-modified.

<!-- END MANUAL -->

Common mistakes to avoid:

  • <!-- BEGIN AUTO-MANAGED: name --> - WRONG (no BEGIN prefix)
  • <!-- END AUTO-MANAGED: name --> - WRONG (no name in closing tag)
  • <!-- AUTO-MANAGED section-name --> - WRONG (missing colon)

Section Definitions

Root CLAUDE.md Sections

Generate these sections in order:

Section NameHeadingRequiredPlaceholderContent
project-description## OverviewYes{{DESCRIPTION}}Project name, tagline, key features
build-commands## Build & Development CommandsYes{{BUILD_COMMANDS}}Build, test, lint, run commands
architecture## ArchitectureYes{{ARCHITECTURE}}Directory tree, key files, data flow
conventions## Code ConventionsYes{{CONVENTIONS}}Naming, imports, formatting rules
patterns## Detected PatternsYes{{PATTERNS}}AI-detected recurring code patterns
git-insights## Git InsightsNo{{GIT_INSIGHTS}}Key commits, design decisions
best-practices## Best PracticesNo{{BEST_PRACTICES}}From official Claude Code docs
Subtree CLAUDE.md Sections

Generate these sections in order:

Section NameHeadingRequiredPlaceholderContent
module-description## PurposeYes{{DESCRIPTION}}Module purpose and responsibility
architecture## Module ArchitectureYes{{ARCHITECTURE}}Module structure, key files
conventions## Module-Specific ConventionsYes{{CONVENTIONS}}Module-specific rules
dependencies## Key DependenciesYes{{DEPENDENCIES}}Module dependencies

Templates

Reference the template files for exact structure:

CLAUDE.md Root Template

@templates/CLAUDE.root.md.template

CLAUDE.md Subtree Template

@templates/CLAUDE.subtree.md.template

AGENTS.md Root Template

@templates/AGENTS.root.md.template

AGENTS.md Subtree Template

@templates/AGENTS.subtree.md.template

CLAUDE.md Redirect Template (when both files configured)

@templates/CLAUDE.redirect.md.template

User Interactions

Use AskUserQuestion for:

  1. Existing CLAUDE.md handling (migrate/backup/merge/cancel)
  2. Subtree location confirmation
  3. Final approval before writing files

Output

After generating files, report:

  • Files created/modified
  • Sections populated
  • Any warnings or suggestions

© severity1, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files in skills/codebase-analyzer of severity1/claude-code-auto-memory.

  • SKILL.md
  • templates/AGENTS.root.md.template
  • templates/AGENTS.subtree.md.template
  • templates/CLAUDE.redirect.md.template
  • templates/CLAUDE.root.md.template
  • templates/CLAUDE.subtree.md.template

Open the folder on GitHubat commit d8254a8

Compare with similar skills

Codebase Analyzer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Codebase Analyzer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Codebase Analyzer this skillseverity1/claude-code-auto-memory159—~1.5kAutomated safety check: PassMIT
Neat-Freak Knowledge CloseoutKKKKhazix/khazix-skills21k—~1.9kAutomated safety check: PassMIT
SkillOpt Sleep Cyclemicrosoft/SkillOpt18k—~2.3kAutomated safety check: PassMIT
CLAUDE.md Improveranthropics/claude-plugins-official37k5 repos~1.5kAutomated safety check: PassApache-2.0
Harness Engineering10xChengTu/harness-engineering1021 repos~1kAutomated safety check: PassNone
Self Improving For CodexGODGOD126/self-improving-for-codex130—~1.2kAutomated safety check: PassMIT

Similar skills

  • Neat-Freak Knowledge Closeout

    KKKKhazix/khazix-skills

    Brings project docs, agent rule files, authorized memory and leftover workspace files back in line with what the code and runtime actually do at the end of a work session.

    21k GitHub stars~1.9k tokensUpdated 6 days ago
    Agent WorkflowsAuto-check passed
  • SkillOpt Sleep Cycle

    microsoft/SkillOpt

    Official

    Runs an on-demand or nightly sleep cycle that reviews past Claude Code sessions and proposes validated updates to CLAUDE.md and skills.

    18k GitHub stars~2.3k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • CLAUDE.md Improver

    anthropics/claude-plugins-official

    Official

    Finds every CLAUDE.md file in a repository, scores each against quality criteria, shows a report, then makes targeted updates after you approve.

    37k GitHub starsUsed in 5 repos~1.5k tokens
    Agent WorkflowsAuto-check passed
  • Harness Engineering

    10xChengTu/harness-engineering

    Set up and improve harness engineering (AGENTS.md, docs/, lint rules, eval systems, project-level prompt engineering) for AI-agent-friendly codebases.

    102 GitHub starsUsed in 1 repo~1k tokens
    Agent WorkflowsAuto-check passed
  • Self Improving For Codex

    GODGOD126/self-improving-for-codex

    Build or maintain a Codex-native self-improving memory loop using global AGENTS.md, a persistent memories directory, and optional nightly refinement automation.

    130 GitHub stars~1.2k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • CLAUDE.md Preserve

    EliaAlberti/cpr-compress-preserve-resume

    Writes this session's durable learnings into the project's CLAUDE.md and keeps the file short by archiving stale sections.

    513 GitHub stars~889 tokensUpdated 28 days ago
    Agent WorkflowsAuto-check passed

More from severity1/claude-code-auto-memory

  • Memory Processor

    severity1/claude-code-auto-memory

    Process file changes and update CLAUDE.md memory sections. An agent skill from severity1/claude-code-auto-memory.

    159 GitHub stars~1.3k tokensUpdated 5 mo ago
    Auto-check passed

Categories

Questions about Codebase Analyzer

What does Codebase Analyzer do?

This skill should be used when the user asks to "initialize auto-memory", "create CLAUDE.md", "set up project memory", or runs the /auto-memory:init command. Codebase Analyzer is an agent skill from severity1/claude-code-auto-memory.md", "set up project memory", or runs the /auto-memory:init command.

When should I use Codebase Analyzer?

Codebase Analyzer fits situations like: asks to initialize auto-memory; create CLAUDE.md; set up project memory; runs the /auto-memory:init command.

How do I install Codebase Analyzer in Claude Code?

Run `npx skills add severity1/claude-code-auto-memory --skill codebase-analyzer -a claude-code`. Or copy the skill folder (skills/codebase-analyzer in severity1/claude-code-auto-memory) into .claude/skills/codebase-analyzer in your project. Claude Code loads it when a task matches its description.

How do I install Codebase Analyzer in Codex?

Run `npx skills add severity1/claude-code-auto-memory --skill codebase-analyzer -a codex`. Or copy the skill folder (skills/codebase-analyzer in severity1/claude-code-auto-memory) into .agents/skills/codebase-analyzer in your project. Codex loads it when a task matches its description.

Can I use Codebase Analyzer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add severity1/claude-code-auto-memory --skill codebase-analyzer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/codebase-analyzer, .gemini/skills/codebase-analyzer, .github/skills/codebase-analyzer and .opencode/skills/codebase-analyzer in your project.

What does Codebase Analyzer need to run?

SKILL.md names no scripts, command-line tools or credentials: Codebase Analyzer is instructions for the agent only. Our summary lists: Python 3; Node.js.

Does Codebase Analyzer access the network?

SKILL.md names 1 domain. In commands or code: code.claude.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Codebase Analyzer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Codebase Analyzer use?

Codebase Analyzer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Codebase Analyzer use?

About 1.5k tokens (SKILL.md is roughly 6.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Codebase Analyzer?

Skills that share tags, products or a category with Codebase Analyzer: Neat-Freak Knowledge Closeout (KKKKhazix/khazix-skills, 21k stars), SkillOpt Sleep Cycle (microsoft/SkillOpt, 18k stars), CLAUDE.md Improver (anthropics/claude-plugins-official, 37k stars) and Harness Engineering (10xChengTu/harness-engineering, 102 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Codebase Analyzer?

severity1 (a GitHub user) maintains it in severity1/claude-code-auto-memory, which has 159 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on April 18, 2026.

Source: severity1/claude-code-auto-memory on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.