Agent skill

Metacognitive Self Mod

by athola in athola/claude-night-market

Analyze and improve the improvement process. An agent skill from athola/claude-night-market.

MITAuto-check passedAgent Workflows

Install Metacognitive Self Mod

skills CLI
$ npx skills add athola/claude-night-market --skill metacognitive-self-mod -a claude-code

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

GitHub CLI
$ gh skill install athola/claude-night-market metacognitive-self-mod --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/athola/claude-night-market.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/abstract/skills/metacognitive-self-mod .claude/skills/metacognitive-self-mod && 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
metacognitive-self-mod
GitHub stars
341
Token cost
~2.2k tokens
SKILL.md length
593 words
Files
2
Skills in repo
152
Repo updated
First seen
Licence
MIT

At a glance

Analyze and improve the improvement process. An agent skill from athola/claude-night-market.

  • Works in 7 steps: Load improvement data → Classify improvement outcomes → Extract meta-patterns → …
  • Detecting regressions and meta-optimization
  • SKILL.md covers Overview, Context Triggers…, When To Use (Manual) and When NOT To Use, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Metacognitive Self Mod is an agent skill from athola/claude-night-market. Analyze and improve the improvement process. Use for detecting regressions and meta-optimization.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `modules/trace-capture.md`).

It sits in Agent Workflows. The repository describes itself as: 23 Claude Code plugins: TDD enforcement hooks, git/PR workflows, spec-driven development, code review, project lifecycle, fix-from-error, maintenance automation, context… The licence is MIT.

When your agent uses it

  • Detecting regressions and meta-optimization

Example prompts

  • “/metacognitive-self-mod”

Requirements

  • Python 3

Workflow steps

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

  1. Load improvement data
  2. Classify improvement outcomes
  3. Extract meta-patterns
  4. Analyze improvement trends
  5. Generate strategy recommendations
  6. Store meta-insights
  7. Update skill-improver strategy

What it can do on your machine

Read from SKILL.md and the folder at commit 9f3eb00. 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 python and bash).

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

  • Network

    No URLs in SKILL.md.

    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

Metacognitive Self Mod loads about 2.2k tokens when it runs. Until then it costs about 30 tokens; SKILL.md has 593 words of instructions outside code blocks.

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

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 athola/claude-night-market at commit 9f3eb00, republished under its MIT licence (© athola). 593 words, ~2,225 tokens.

Download SKILL.mdSave it as .claude/skills/metacognitive-self-mod/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
metacognitive-self-mod
description
Analyze and improve the improvement process. Use for detecting regressions and meta-optimization.
category
meta-skills
alwaysApply
false
trigger
metacognitive, self-modification, improve the improver, meta-improvement, improvement effectiveness, regression detected, improvement failed
model_hint
standard
progressive_loading
true
modules
modules/trace-capture.md

Metacognitive Self-Modification

Overview

Analyze the effectiveness of past skill improvements and refine the improvement process itself. This is the core innovation from the Hyperagents paper: not just improving skills, but improving HOW skills are improved.

Context Triggers (auto-invocation)

This skill should be invoked automatically when:

  1. Regression detected: The homeostatic monitor finds a skill's evaluation window ended in pending_rollback_review status. The improvement made things worse, and we need to understand why.

  2. Low effectiveness rate: When ImprovementMemory.get_effective_strategies() vs get_failed_strategies() shows effectiveness below 50%, the improvement process itself needs refinement.

  3. Degradation despite improvements: When PerformanceTracker.get_improvement_trend() returns negative for a skill that was recently improved.

  4. Periodic check: After every 10 improvement cycles (tracked via outcome count in ImprovementMemory).

Hook integration

The homeostatic monitor emits "improvement_triggered": true when a skill crosses the flag threshold. At that point, before dispatching the skill-improver, check if metacognitive analysis is warranted:

python
from abstract.improvement_memory import ImprovementMemory
from pathlib import Path

memory = ImprovementMemory(Path.home() / ".claude/skills/improvement_memory.json")

# Check if metacognitive analysis is warranted
effective = memory.get_effective_strategies()
failed = memory.get_failed_strategies()
total = len(effective) + len(failed)

needs_metacognition = False

# Trigger 1: Low effectiveness rate
if total >= 5 and len(effective) / total < 0.5:
    needs_metacognition = True

# Trigger 2: Periodic check (every 10 outcomes)
if total > 0 and total % 10 == 0:
    needs_metacognition = True

# Trigger 3: Recent regression
if failed and failed[-1].get("outcome_type") == "failure":
    needs_metacognition = True

if needs_metacognition:
    # Run metacognitive analysis before next improvement
    pass  # Skill(abstract:metacognitive-self-mod)

When To Use (Manual)

  • After a batch of skill improvements to assess what worked
  • When improvement outcomes show regressions
  • Periodically (monthly) to refine improvement strategy
  • When the skill-improver agent seems ineffective

When NOT To Use

  • Routine skill improvements (use skill-improver directly)
  • First-time skill creation (use skill-authoring)

Workflow

Step 1: Load improvement data

Read improvement memory and performance tracker data:

bash
# Check for improvement memory
MEMORY_FILE=~/.claude/skills/improvement_memory.json
TRACKER_FILE=~/.claude/skills/performance_history.json

if [ ! -f "$MEMORY_FILE" ]; then
  echo "No improvement memory found."
  echo "Run skill-improver first to generate improvement data."
  exit 0
fi

Load the JSON files using Python:

python
from abstract.improvement_memory import ImprovementMemory
from abstract.performance_tracker import PerformanceTracker
from pathlib import Path

memory = ImprovementMemory(Path.home() / ".claude/skills/improvement_memory.json")
tracker = PerformanceTracker(Path.home() / ".claude/skills/performance_history.json")
Step 2: Classify improvement outcomes

For each improvement outcome in memory, classify:

  • Effective: after_score - before_score >= 0.1
  • Neutral: -0.1 < improvement < 0.1
  • Regression: after_score < before_score
python
effective = memory.get_effective_strategies()
failed = memory.get_failed_strategies()

# Calculate effectiveness rate
total = len(effective) + len(failed)
if total > 0:
    effectiveness_rate = len(effective) / total
Step 3: Extract meta-patterns

Analyze WHAT types of improvements succeed vs fail:

Success patterns to look for:

  • Adding error handling (reduces failure rate)
  • Adding examples (improves user ratings)
  • Adding quiet/verbose modes (reduces friction)
  • Simplifying workflow steps (reduces duration)

Failure patterns to look for:

  • Over-engineering (adding too many options)
  • Breaking existing workflows (regression)
  • Adding complexity without validation
  • Token budget overflow from verbose additions

For each pattern found, record as a causal hypothesis:

python
memory.record_insight(
    skill_ref="_meta",  # Special ref for meta-insights
    category="causal_hypothesis",
    insight="Error handling improvements have 85% success rate",
    evidence=["skill-A v1.1.0: +0.3", "skill-B v2.1.0: +0.15"],
)

Use PerformanceTracker to identify:

  • Skills with sustained improvement (positive trend)
  • Skills with degradation despite improvement attempts
  • Domains where improvements are most effective
python
for skill_ref in tracker.get_all_skill_refs():
    trend = tracker.get_improvement_trend(skill_ref)
    if trend is not None:
        if trend > 0.05:
            # Sustained improvement - what's working?
            pass
        elif trend < -0.05:
            # Degrading despite improvements - investigate
            pass
Show full SKILL.md (261 more words)Show less
Step 5: Generate strategy recommendations

Based on the meta-analysis, generate recommendations for the skill-improver:

  1. Priority formula adjustments: If certain issue types have higher improvement success rates, weight them higher.

  2. Approach selection: If "add error handling" has 85% success vs "restructure workflow" at 30%, bias toward error handling.

  3. Threshold adjustments: If improvements below priority 3.0 consistently fail, raise the minimum threshold.

  4. Avoidance rules: Document anti-patterns to avoid in future improvements.

Step 6: Store meta-insights

Record all findings back into ImprovementMemory under the special _meta skill ref:

python
# Record strategy recommendation
memory.record_insight(
    skill_ref="_meta",
    category="strategy_success",
    insight="Recommendation: Prioritize error handling and examples over restructuring",
    evidence=[f"Success rate: error_handling={eh_rate:.0%}, restructure={rs_rate:.0%}"],
)
Step 7: Update skill-improver strategy

If significant meta-insights are found, propose concrete modifications to the skill-improver agent:

  • Update priority weights in the priority formula
  • Add avoidance rules for known anti-patterns
  • Adjust thresholds based on empirical data
  • Add new improvement patterns that proved effective

Important: Propose changes, do not auto-apply. The user must approve modifications to the improvement process.

Output

Metacognitive Self-Modification Report

Improvement Data:
  Total outcomes analyzed: 15
  Effective improvements: 11 (73%)
  Regressions: 2 (13%)
  Neutral: 2 (13%)

Success Patterns:
  1. Error handling additions: 5/6 success (83%)
  2. Example additions: 3/3 success (100%)
  3. Quiet mode additions: 2/2 success (100%)

Failure Patterns:
  1. Workflow restructuring: 1/3 success (33%)
  2. Token-heavy additions: 0/1 success (0%)

Performance Trends:
  Improving: 8 skills (positive trend)
  Stable: 4 skills (no trend)
  Degrading: 1 skill (negative trend despite attempts)

Recommendations:
  1. Weight error handling improvements 2x in priority
  2. Avoid workflow restructuring below priority 8.0
  3. Cap additions at 200 tokens to prevent budget overflow
  4. Focus next improvement cycle on degrading skill X

Meta-insights stored: 5 new entries in improvement memory
  • abstract:skill-improver - The agent this skill analyzes and proposes modifications for
  • abstract:skills-eval - Evaluation framework whose criteria could be refined by meta-insights
  • abstract:aggregate-logs - Data source for improvement metrics

Exit Criteria

  • The metacognitive report lists total outcomes analyzed (effective / regression / neutral counts) sourced from ~/.claude/skills/improvement_memory.json.
  • At least one causal hypothesis is recorded under skill_ref: "_meta" in improvement_memory.json with cited evidence (skill refs and score deltas).
  • Any Tier 3 strategy recommendation (modify skill-improver priority weights, add avoidance rules, adjust thresholds) is presented as a proposal requiring explicit user approval before any change is applied.
  • If effectiveness rate is below 50% across 5+ outcomes, this condition is surfaced as the primary trigger reason in the report output.

© athola, 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 1 other file in plugins/abstract/skills/metacognitive-self-mod of athola/claude-night-market.

  • SKILL.md
  • modules/trace-capture.md

Open the folder on GitHubat commit 9f3eb00

Compare with similar skills

Metacognitive Self Mod 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.

Metacognitive Self Mod compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Metacognitive Self Mod this skillathola/claude-night-market341—~2.2kAutomated safety check: PassMIT
MCP Server Builderanthropics/skills180k63 repos~2.3kAutomated safety check: PassApache-2.0
Hook Development for Claude Code Pluginsanthropics/claude-plugins-official38k10 repos~4.1kAutomated safety check: NotesApache-2.0
Using Superpowersfarm-fe/farm5.6k35 repos~1.4kAutomated safety check: PassMIT
Executing Plans Inlineobra/superpowers297k2 repos~5.1kAutomated safety check: PassMIT
Skill CreatorAzure/azqr79689 repos~8.2kAutomated safety check: PassApache-2.0

Similar skills

  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 63 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • Hook Development for Claude Code Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.

    38k GitHub starsUsed in 10 repos~4.1k tokens
    Agent WorkflowsAuto-check: notes
  • Using Superpowers

    farm-fe/farm

    A skill your agent uses when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions

    5.6k GitHub starsUsed in 35 repos~1.4k tokens
    Agent WorkflowsAuto-check passed
  • Executing Plans Inline

    obra/superpowers

    Has the agent carry out an implementation plan itself, task by task in the current session, keeping a ledger, proving each step with a test and ending with one whole-branch review.

    297k GitHub starsUsed in 2 repos~5.1k tokens
    Agent WorkflowsAuto-check passed
  • Skill Creator

    Azure/azqr

    Official

    Create new skills, modify and improve existing skills, and measure skill performance.

    796 GitHub starsUsed in 89 repos~8.2k tokens
    Agent WorkflowsAuto-check passed
  • Claude Code Agent Development

    anthropics/claude-plugins-official

    Official

    Explains how to write agents for Claude Code plugins: the markdown file with YAML frontmatter, trigger descriptions, model and color settings, and system prompt design.

    38k GitHub starsUsed in 7 repos~2.8k tokens
    Agent WorkflowsAuto-check passed

More from athola/claude-night-market

All 152 skills in this repo
  • Night Market Diagnostics Toolkit

    athola/claude-night-market

    Run and interpret repo diagnostic scripts (ratchets, validators, token stats).

    341 GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed
  • Skills Eval

    athola/claude-night-market

    Evaluate Claude skill quality through auditing. An agent skill from athola/claude-night-market.

    341 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Agent Teams

    athola/claude-night-market

    Coordinates Claude agent teams via filesystem protocol. An agent skill from athola/claude-night-market.

    341 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • Delegation Core

    athola/claude-night-market

    Delegates execution to eight CLIs (Gemini, Qwen, MiniMax, GLM, Muse, Codex, OpenCode, Glimmer).

    341 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • Elegant Code

    athola/claude-night-market

    Guide minimal code via a decision ladder with full safety, edge, and negative-case coverage.

    341 GitHub stars~2.1k tokensUpdated yesterday
    Auto-check passed
  • Skill Library Mission

    athola/claude-night-market

    Build a project skill library in .claude/skills/ via discovery, parallel authoring, and review.

    341 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Metacognitive Self Mod

What does Metacognitive Self Mod do?

Analyze and improve the improvement process. An agent skill from athola/claude-night-market. Metacognitive Self Mod is an agent skill from athola/claude-night-market. Analyze and improve the improvement process.

When should I use Metacognitive Self Mod?

Metacognitive Self Mod fits situations like: detecting regressions and meta-optimization.

How do I install Metacognitive Self Mod in Claude Code?

Run `npx skills add athola/claude-night-market --skill metacognitive-self-mod -a claude-code`. Or copy the skill folder (plugins/abstract/skills/metacognitive-self-mod in athola/claude-night-market) into .claude/skills/metacognitive-self-mod in your project. Claude Code loads it when a task matches its description.

How do I install Metacognitive Self Mod in Codex?

Run `npx skills add athola/claude-night-market --skill metacognitive-self-mod -a codex`. Or copy the skill folder (plugins/abstract/skills/metacognitive-self-mod in athola/claude-night-market) into .agents/skills/metacognitive-self-mod in your project. Codex loads it when a task matches its description.

Can I use Metacognitive Self Mod 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 athola/claude-night-market --skill metacognitive-self-mod -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/metacognitive-self-mod, .gemini/skills/metacognitive-self-mod, .github/skills/metacognitive-self-mod and .opencode/skills/metacognitive-self-mod in your project.

What does Metacognitive Self Mod need to run?

SKILL.md names no scripts, command-line tools or credentials: Metacognitive Self Mod is instructions for the agent only. Our summary lists: Python 3.

Does Metacognitive Self Mod access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Metacognitive Self Mod 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 Metacognitive Self Mod use?

Metacognitive Self Mod 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 Metacognitive Self Mod use?

About 2.2k tokens (SKILL.md is roughly 8.9k 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 Metacognitive Self Mod?

Skills that share tags, products or a category with Metacognitive Self Mod: MCP Server Builder (anthropics/skills, 180k stars), Hook Development for Claude Code Plugins (anthropics/claude-plugins-official, 38k stars), Using Superpowers (farm-fe/farm, 5.6k stars) and Executing Plans Inline (obra/superpowers, 297k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Metacognitive Self Mod?

athola (a GitHub user) maintains it in athola/claude-night-market, which has 341 GitHub stars. The repository holds 152 skills in this directory. The repository was last updated on October 9, 2026.

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