# Layered analysis loop

> Layered analysis loop is an open-source agent skill for developer tools. Guides an agent through layered passes that deepen an analysis one question at a time. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/mtarcure/claude-vibe-squad/tree/main/.agents/skills/layered-analysis-loop
- **Repository:** https://github.com/mtarcure/claude-vibe-squad
- **GitHub stars:** 227
- **License:** MIT
- **Skill name:** layered-analysis-loop
- **Collection:** https://github.com/mtarcure/claude-vibe-squad
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

This skill tells the agent to analyze a target in distinct layers instead of one open-ended read. Before each layer it fixes a single question, then runs a structure pass, a behavior pass that follows primary paths in order, an edge-case pass covering error paths, boundary inputs and unenforced assumptions, and a contradiction pass that tries to break the model built so far.

Each layer closes with a written delta describing what changed in the model, and only evidence-backed findings carry forward. The agent stops when a full layer yields no change, or when an explicit budget limit is reached, and reports which layers ran and where convergence happened.

The skill is a method rather than a script: it runs no code and uses no external tools, and it works on whatever target the user names, such as a codebase, document or system.

## When your agent uses it

> Use when analyzing a target deeply enough to require distinct structural, behavioral, edge-case, and contradiction passes rather than one undirected read—fix a question for each layer, record its evidence-backed delta, and stop only at a no-delta layer or an explicit budget cutoff.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/mtarcure/claude-vibe-squad/tree/HEAD/.agents/skills/layered-analysis-loop)
- [License: MIT](https://github.com/mtarcure/claude-vibe-squad/tree/HEAD/.agents/skills/layered-analysis-loop)

## Features

- **Question-per-layer structure:** Each analysis pass is bound to one written question that is set before the pass begins.
- **Structural and behavioral passes:** The first two layers map how a target is organized and trace its primary paths step by step.
- **Edge-case review:** A dedicated layer examines error paths, boundary inputs, concurrency and assumed but unenforced states.
- **Contradiction testing:** A final layer deliberately looks for cases that would falsify the model built by earlier layers.
- **Convergence stopping rule:** Analysis ends at a layer with no delta or at an explicit budget cutoff, and the stop point is reported.

## Good for

- Analyze an unfamiliar codebase in structured passes before proposing changes
- Trace primary execution paths and then list their error and boundary cases
- Stress-test an existing design model by hunting for inputs that break it
- Review a system's assumptions and document where they are not enforced

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/layered-analysis-loop` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/layered-analysis-loop &&
cp -R "$tmp/.agents/skills/layered-analysis-loop" ~/.claude/skills/layered-analysis-loop &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/layered-analysis-loop` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/layered-analysis-loop` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/layered-analysis-loop &&
cp -R "$tmp/.agents/skills/layered-analysis-loop" ~/.agents/skills/layered-analysis-loop &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/layered-analysis-loop` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/layered-analysis-loop` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/layered-analysis-loop &&
cp -R "$tmp/.agents/skills/layered-analysis-loop" ~/.cursor/skills/layered-analysis-loop &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/layered-analysis-loop` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/mtarcure/claude-vibe-squad.git --path .agents/skills/layered-analysis-loop
```

Or copy the folder to `~/.gemini/skills/layered-analysis-loop` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/layered-analysis-loop`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/layered-analysis-loop &&
cp -R "$tmp/.agents/skills/layered-analysis-loop" ~/.copilot/skills/layered-analysis-loop &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/layered-analysis-loop` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git
```

Then copy `claude-vibe-squad/.agents/skills/layered-analysis-loop` into your agent's skills folder as `layered-analysis-loop`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run?

It needs no scripts or external tools. It is a set of written instructions the agent follows on whatever target is being analyzed.

### When does Layered analysis loop trigger?

It is meant for analysis deep enough to need separate structural, behavioral, edge-case and contradiction passes rather than a single read.

### How does Layered analysis loop decide when to stop?

It stops when a full layer produces no delta, or when an explicit budget cutoff is reached, and it reports the layers run and the convergence point.

### How do I install Layered analysis loop in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/layered-analysis-loop to use it in all your projects, or to .claude/skills/layered-analysis-loop in one project.

### Does Layered analysis loop run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Layered analysis loop?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Layered analysis loop?

The closest alternatives to Layered analysis loop are Meta cognition parallel, Agent architecture audit, Deep discuss, Continuous agent loop and Gap analysis.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Meta cognition parallel](https://ai-powered.com/skills/meta-cognition-parallel): Meta cognition parallel is an open-source agent skill for developer tools.
- [Agent architecture audit](https://ai-powered.com/skills/agent-architecture-audit): Agent architecture audit is an open-source agent skill for developer tools.
- [Deep discuss](https://ai-powered.com/skills/deep-discuss): Deep discuss is an open-source agent skill for developer tools.
- [Continuous agent loop](https://ai-powered.com/skills/continuous-agent-loop): Continuous agent loop is an open-source agent skill for developer tools.
- [Gap analysis](https://ai-powered.com/skills/gap-analysis): Gap analysis is an open-source agent skill for developer tools.
- [Code review loop](https://ai-powered.com/skills/code-review-loop): Code review loop is an open-source agent skill for developer tools.
- [Agentic engineering](https://ai-powered.com/skills/agentic-engineering): Agentic engineering is an open-source agent skill for developer tools.
- [Skill creator](https://ai-powered.com/skills/skill-creator): Skill creator is a free agent skill for ai models and llm tooling.

---
Source: https://ai-powered.com/skills/layered-analysis-loop
