Skip to main content
skill CX Codex

setup · awrshift — Claude Code skill: what it does, how to install

Scaffolds Agent Memory Kit layers inside a repository, configures safe permission rails, and manages coexistence with Claude Code native auto memory.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add awrshift/agent-memory-kit --skill setup -a claude-code
Open on GitHub

What setup does

The skill provisions a repository for structured agent memory. Before touching disk, it inspects existing files and asks for single confirmation. It creates the shared memory layers: .claude/memory/MEMORY.md as the hot cache, context/handoffs/ for session notes, the knowledge/ deep index, and project folders under projects/<name>/.

It resolves conflicts between two memory systems. By default, it turns off native Claude Code auto memory via "autoMemoryEnabled": false in .claude/settings.json. Pointing autoMemoryDirectory directly to .claude/memory breaks because the setting requires absolute paths and Claude Code rewrites files in its own index format.

Running with the rails argument updates permission rails without touching existing project scaffolding. In unattended -p runs, it skips interactive steps, picks documented defaults, and lists unresolved questions at the end.

What it helps with

  • scaffold memory layers across single or multi-project repositories
  • disable Claude Code native auto memory to avoid split state
  • refresh project permission rails via /memory-kit:setup rails
  • map project documentation paths without breaking existing docs

Example prompts for the agent

  • /memory-kit:setup
  • /memory-kit:setup rails
  • set up the memory kit in this repository

How to install setup

1Skills CLI (Vercel)

npx skills add awrshift/agent-memory-kit --skill setup -a claude-code

2Manually: put the files in place

~/.claude/skills/setup/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/setup/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about setup

How to install the setup skill in Claude Code?

Run npx skills add awrshift/agent-memory-kit --skill setup -a claude-code. You can also place the skill file manually at ~/.claude/skills/setup/SKILL.md.

What does the setup skill do?

It inspects the workspace and sets up Agent Memory Kit files, including .claude/memory/MEMORY.md, knowledge/index.md, and project backlog templates. It also configures permissions and memory settings in .claude/settings.json.

Can setup run alongside Claude Code auto memory?

Yes, though by default it disables auto memory to prevent conflicting records. If kept enabled, native auto memory writes to machine-local paths while the kit keeps repository-tracked files.

Source text

SKILL.md · MIT
---
name: setup
description: Adopt the Memory Kit in THIS repository — scaffold the memory layers, decide how the kit coexists with Claude Code's native auto memory, and install safe permission rails (`/memory-kit:setup rails` re-runs only the rails step on an adopted repo). Use when the user says "/memory-kit:setup", "/memory-kit:setup rails", "set up the memory kit", "adopt the kit here", "настрой кит", or when a session starts in a repo where the kit plugin is installed but no .claude/memory/MEMORY.md exists.
allowed-tools: Read, Glob, Grep
---

# /memory-kit:setup — adopt the kit in an existing repository

The plugin ships behaviour; the repository owns the state. This skill creates that state —
**always asking before the first write**, and never touching files the repo already has.

Running without a user who can answer (a headless or `-p` run)? Then "offer" means **skip and
report**: take the documented default where one exists, install nothing that the skill marks as
opt-in, and finish with a list of what was deliberately not installed and what question is still
open. Never invent a preference on the user's behalf and never present a skipped step as done.

## Step 0 — look before you write

Report in two lines what already exists: `.claude/memory/MEMORY.md`, `context/handoffs/`,
`knowledge/`, `projects/`, an existing documentation home (`docs/`, `doc/`, `documentation/`),
`.claude/settings.json`, `.gitignore`, and whether this repo already holds work of its own —
code, or documents other than a bare README (a real project) — or is effectively empty (a fresh
memory workspace). Being a git repo decides nothing; content does. Everything after this is a proposal the user
confirms once, not a sequence of prompts.

## Step 1 — the shared memory layers

These four are shared across every project in the repo. Create only what is missing, copying
from `${CLAUDE_PLUGIN_ROOT}/templates/`:

| Path | From | Purpose |
|---|---|---|
| `.claude/memory/MEMORY.md` | `templates/MEMORY-TEMPLATE.md` | the hot cache the hook injects every session |
| `context/handoffs/HANDOFF-TEMPLATE.md` | `templates/HANDOFF-TEMPLATE.md` | the per-session note format |
| `knowledge/index.md` | `templates/workspace/knowledge-index.md` | the catalog of deep memory |
| `knowledge/concepts/.gitkeep` | — | where promoted patterns land |
| `.claude/state/.gitkeep` | — | hook bookkeeping (gitignored) |

## Step 1b — the project layer (`projects/<name>/`)

The four layers above hold MEMORY. The work's own documents — tasks, specs, research, decisions,
QA — belong to a PROJECT, and the kit is multi-project by design: one folder per client or
product, so that a decision ledger, a findings registry and a QA protocol each count and describe
exactly ONE thing. **This applies to a single-product code repository too** — it simply has one
project folder, named after the product. (Earlier versions told you to skip `projects/` in a code
repo. That left specs, backlogs and research with no home, and they scattered into the repo root.)

Ask for the name(s), then create per project — nothing more:

| Path | From | Purpose |
|---|---|---|
| `projects/<name>/README.md` | `templates/workspace/project/README-TEMPLATE.md` | what it is + **the map of where its documents live** |
| `projects/<name>/BACKLOG.md` | `templates/workspace/project/BACKLOG-TEMPLATE.md` | tasks and their real status |

The rest of the project layer — `plans/`, `research/`, `decisions-log.md`, `review-findings.md`,
`qa/`, `materials/` — is **created on first use by whoever produces the artifact**, never
scaffolded upfront. An empty folder is not a layer; it is a promise nobody kept. `plans/` appears
with the first spec, written from `templates/workspace/project/SPEC-TEMPLATE.md`; an `executor`
told to build past a missing decision may add one `plans/<date>-<slug>-assumed.md` from
`ASSUMED-SPEC-TEMPLATE.md`, and nothing else in that folder is an agent's to create.

**If the repository already has a documentation home**, do NOT move anything and do NOT propose a
migration. Fill the README's map table with the paths it already uses, written from the repo root
with a leading `/` so they can't be misread as project-relative. That table is the SSOT for "where
does a plan go" — the defaults are a default, not a law, and a repo's own layout outranks them.

The test for "already has one" is **committed content, not a folder**: a `docs/` (or `doc/`,
`documentation/`) holding at least one markdown file that git tracks and that a human wrote. An
empty directory, or one holding only scaffolding you cannot attribute to anyone, does not count —
use the defaults. When the call is genuinely close, ASK; it decides where every future plan gets
looked for, and it is cheap to ask once and expensive to split a repo's documents across two homes.

Brand-new empty workspace, first time with the kit? Also offer the `experiments/` sandbox from
`templates/workspace/`, and — **only when there is exactly one project** —
`templates/workspace/ONBOARDING-BACKLOG.md` as its backlog: five guided tasks for day one. With
two or more real projects on day one, skip it (a tutorial mixed into a client's backlog is noise,
and a third fake project to hold it is worse) and offer `/memory-kit:tour` instead.

## Step 2 — the auto-memory decision (ask, do not assume)

Claude Code has its own auto memory (`~/.claude/projects/<project>/memory/`, loaded every
session, written by Claude without asking). Running it alongside the kit means two writers and
two truths. Put the choice to the user in one question:

- **Kit owns memory (default).** Write `"autoMemoryEnabled": false` into `.claude/settings.json`
  (for CI or a headless run, `CLAUDE_CODE_DISABLE_AUTO_MEMORY=1` does the same). You get dated
  entries, human-confirmed promotion, handoffs, and one file the user can read.
- **Both, side by side.** Leave auto memory on. It keeps writing its own index under
  `~/.claude/projects/<project>/memory/` (machine-local, outside the repo); the kit keeps the
  repo files and the ritual. Two writers, two truths — say so, and make the kit's `MEMORY.md`
  the one that counts for handoffs and promotion.

Do NOT point `autoMemoryDirectory` at the kit's `.claude/memory`: the setting only accepts an
absolute path or one starting with `~/` (so it cannot be committed portably), and Claude Code
would rewrite the kit's `MEMORY.md` in its own index format, overwriting the dated cache.

Whichever is chosen, say plainly which system now owns the file.

## Step 3 — permission rails (v2)

**`/memory-kit:setup rails`** (the argument `rails`, e.g. from the SessionStart «Rails:» line) runs
THIS step alone on an already adopted repo: skip Steps 0–2 and 4–6, build the proposal below, show
the diff of `.claude/settings.json`, merge on a yes and write `.claude/state/rails-v2`; on a no,
write `.claude/state/rails-declined`. Either file silences the nudge. A full setup writes the same
marker after this step. Headless: write nothing, report the proposal.

The plugin cannot ship permissions (Claude Code only honours `agent` and `subagentStatusLine`
from a plugin's `settings.json`) — the destructive git operations are already guarded by the
kit's git-guard hook (force push, `reset --hard`, `clean -f`, `branch -D`, `checkout .`,
`restore .`, `push --mirror`; opt-out `CMK_GIT_GUARD=off`). The rails cover the rest. Build the
proposal from what is actually in this repo:

1. **Env files that exist.** List the repo root: `.env`, `.env.local`, `.env.*.local`,
   `.env.development`, `.env.production`, `.env.test`, `*.pem`. For each one PRESENT, a
   `Read(./<name>)` and an `Edit(./<name>)` deny. Never `.env.example` / `.env.sample` — those
   are meant to be read.
2. **Ask before acting outside the repo:**

```json
{
  "permissions": {
    "deny": ["Read(./.env)", "Edit(./.env)"],
    "ask": [
      "Bash(gh pr create *)", "Bash(gh pr merge *)", "Bash(gh pr comment *)",
      "Bash(gh pr edit *)", "Bash(gh pr close *)", "Bash(gh pr review *)",
      "Bash(gh api -X *)", "Bash(gh api * -X *)", "Bash(gh api --method *)", "Bash(gh api * --method *)",
      "Bash(docker * down *)", "Bash(docker * down)", "Bash(docker rm *)", "Bash(docker * rm *)",
      "Bash(docker stop *)", "Bash(docker * stop *)", "Bash(docker kill *)", "Bash(docker * kill *)",
      "Bash(docker * prune*)"
    ]
  }
}
```

   (the `deny` pair shown is for a repo whose root holds `.env`; one pair per file found.)
3. **Drop the v1 prefix denies** `Bash(git push --force:*)` / `Bash(git push -f:*)` if present:
   a prefix cannot express «this flag anywhere», and the hook covers them. Say so in the diff.

State the rules out loud while you do it:

1. **A permission entry is a speed bump for the agent, never a guard on a script.** Anything that
   must not happen belongs inside the script or a hook. And **no broad allow** for git, gh,
   docker, curl or an interpreter (`Bash(git *)`, `Bash(node *)`, `Bash(python3 *)`, `Bash(*)`):
   in auto mode NARROW allow rules resolve BEFORE the classifier (Claude Code docs,
   auto-mode-config), so a broad one lets a destructive argument through unseen. The v5
   allowlist did exactly that — force pushes, hard resets, `node -e` — while reading as safety.
   A narrow allow names the EXACT script — `Bash(node scripts/foo.mjs *)`, never
   `Bash(node scripts/*)` / `Bash(python3 scripts/*)`: a path wildcard lets the agent write a new
   file into that folder and run it before the classifier sees it. The same for a runner whose
   subcommand executes arbitrary code: not `Bash(npx wp-env run *)`, only `Bash(npx wp-env run cli wp *)`.
   Point out broad allows already there; never remove the user's rules without a yes.
2. **An env file that a stand or script needs is loaded INTO a process, never read by the agent.**
   Preferred: a project launch script that loads it itself (`scripts/stand.sh`:
   `set -a; . ./.env; set +a; exec node …`) plus ONE narrow allow `Bash(bash scripts/stand.sh *)` —
   a narrow allow resolves before the classifier AND before Claude Code's built-in static check,
   which blocks an inline `set -a` whatever the settings say. Fallback only: one `autoMode.allow`
   sentence naming the file and the purpose.
3. **Env backups live outside the repo** (a `.env.bak` at the root is one more file to deny).
4. **Before adding `ask` rules, list the scripts that call `claude -p`** with gh or docker:
   headless mode turns an `ask` into a deny, so those scripts would start failing.

How to prove the rails afterwards: `${CLAUDE_PLUGIN_ROOT}/reference/harness-measurement.md` (M1).

## Step 4 — .gitignore

Append only the lines that are missing, each with its reason in one comment:

```gitignore
.claude/state/*
!.claude/state/.gitkeep
.claude/memory/MEMORY.md      # personal hot cache — commit deliberately if the team shares it
context/handoffs/*.md         # session notes; keep the template
!context/handoffs/HANDOFF-TEMPLATE.md
```

For a **team** repository — more than one human committing, or a shared remote anyone on the
team can push to — ask instead: shared memory (commit both) is often the point. Solo or private:
the defaults above.

## Step 5 — the optional layers (offer, install nothing by default)

The plugin also carries a builder's toolkit. None of it costs context until invoked, so it is
already available — the only thing that needs a decision is the always-loaded rule:

- **Building with subagents?** Offer to copy `${CLAUDE_PLUGIN_ROOT}/templates/rules/orchestration.md`
  into `.claude/rules/`. Seven invariants, always loaded, ~30 lines — that is the entire cost.
  The agents (`executor`, `recon`, `idea-validator`) and `/memory-kit:session-review` +
  `/memory-kit:second-opinion` work without it; the rule is what makes the discipline binding.
- **Shipping a product with a UI?** `/memory-kit:qa-sweep` needs a protocol first: copy
  `${CLAUDE_PLUGIN_ROOT}/reference/qa-PROTOCOL-TEMPLATE.md` → `projects/<name>/qa/README.md`,
  fill every `<placeholder>`, and merge `reference/qa-mcp.json.example` into the project
  `.mcp.json`. Do this only when the user asks for QA — never as part of a default setup.
- **Adding your own skills, hooks or agents to this repo?** `${CLAUDE_PLUGIN_ROOT}/reference/project-extensions.md`
  is the decision table for which shape a repeated workflow takes and what it costs when idle.
- Depth for the rest lives in `${CLAUDE_PLUGIN_ROOT}/reference/` and is read on demand.

## Step 6 — verify, then hand back

The files you just created were NOT in context when this session started, so nothing you can see
right now proves the injection works. Prove it the only honest way — run the hook yourself and
read what it would inject next time:

```bash
HOOK="${CLAUDE_PLUGIN_ROOT}/hooks/session-start.py"
# the variable expands in this skill's text, not in your shell — fall back to finding the file
[ -f "$HOOK" ] || HOOK=$(find ~/.claude/plugins -path '*memory-kit*' -name session-start.py | head -1)
CLAUDE_PLUGIN_ROOT="$(dirname "$(dirname "$HOOK")")" python3 "$HOOK" <<< '{"source":"startup"}'
```

1. The output must contain the working agreement AND a section holding your new `MEMORY.md`
   body. If it still shows the "not set up in this repository" pointer, the scaffold landed in
   the wrong place — say so; do not claim the kit is live.
2. Then, in an interactive session only, `/context` as a second check — it shows THIS session's
   opening injection, so a missing hot cache there is expected today and confirmed on the next
   start. In a headless run there is no `/context`; the hook output above is the whole proof.
3. Tell the user, in three lines: what was created, who owns memory now, and that
   `/memory-kit:close-session` is what they type at the end of the day. Offer `/memory-kit:tour`.

## What NOT to do

- Don't scaffold silently, and don't create the project subfolders (`plans/`, `research/`,
  `qa/`, …) upfront — they appear when something is actually written into them.
- Don't move a repository's existing `docs/` into `projects/`. Map it, never migrate it.
- Don't overwrite an existing `MEMORY.md`, `settings.json` or `.gitignore` — merge, and show
  the diff before writing.
- Don't invent layers. Memory is `MEMORY.md`, `context/handoffs/`, `knowledge/concepts/`,
  `.claude/rules/`; the work's documents live in `projects/<name>/`. That is the whole system.
- Don't declare success from the file listing alone. The v5 kit spent a year claiming the hot
  cache was "always loaded" while it was never injected; the only proof is seeing it in context.

© awrshift · MIT · awrshift/agent-memory-kit

Similar skills

All skills for Agent setup: memory, context, orchestration →

setup by other authors comes first.

setup Alireza Rezvani Sets up an autoresearch experiment by collecting its target file, evaluation command, metric, and optimization direction. Use it before starting an optimization loop. 1,480installs setup aws This skill kicks off the connection setup for AWS DevOps Agent and AWS Security Agent. Reach for it when MCP tools go missing or you are wiring the toolkit up for the first time. CX Codex +1 1,500installs setup marketcalls Sets up a Python backtesting environment with VectorBT and OpenAlgo. It configures the virtual environment, installs dependencies, and prepares .env. CX Codex +1 2,000installs setup assistant-ui This skill guides assistant-ui project creation, setup in an existing app, and runtime selection. Use it when starting a chat UI or wiring one to a backend. CX Codex +1 6,100installs setup aladicf Scans project files and asks UX questions to capture audience, brand personality, and UI defaults into .better-web-ui.md. CX Codex +1 605installs setup-matt-pocock-skills Matt Pocock This skill configures a repository for Matt Pocock's engineering skills by setting its issue tracker, triage labels, and domain docs layout. Run it before using the other skills. 1,052,851installs ask-matt Matt Pocock Routes you to the right Matt Pocock skill or flow for the task at hand. Use it when you need a starting point for a feature, prototype, incoming issue, or hard bug. 766,587installs to-tickets Matt Pocock Turns a plan, spec, or conversation into small end-to-end tickets with explicit blockers. Use it to agree on the work breakdown before tickets go to a tracker. 711,230installs writing-plans Jesse Vincent This skill turns requirements for a multi-step task into an implementation plan before code changes begin. It helps when another engineer needs exact files, interfaces, and checks. CX Codex 282,859installs caveman-review JuliusBrussee Turns code review comments into one line per finding: location, problem, fix. Useful when a diff or PR needs a fast pass without the filler. CX Codex +1 411,800installs caveman-compress JuliusBrussee Compresses CLAUDE.md, todo lists, and other prose files into a shorter format while retaining a readable backup. CX Codex +1 411,500installs

From the same set10

tour This skill walks through Memory Kit using files from your project. Run it after setup or ask your agent to show how the system is organized. CX Codex +1 ★ 34repo stars system-audit Runs a periodic check of the whole agent system against real files and command output: what works, what drifted, what to delete. Built for repos whose rules and memory have piled up. CX Codex +1 ★ 34repo stars session-review Review a substantial coding session with independent reviewers, then turn their findings into immediate fixes or a measurable follow-up plan. CX Codex +1 ★ 34repo stars second-opinion This skill sends the agent's own answer through independent reviewers before you ever see it. Useful for architecture calls and picking between options. CX Codex +1 ★ 34repo stars qa-sweep Runs a multi-lens agent QA sweep across a running product, verifies findings, and logs backlog tickets with run records. CX Codex +1 ★ 34repo stars memory-audit Reviews MEMORY.md, spots stale or duplicated entries, and prepares a change plan. Use it when the memory cache has crossed its limit. CX Codex +1 ★ 34repo stars document Turns a change into prose a human reads — a PR body, changelog entry, release note or postmortem — and files it in the right place. Drafts come only from git diff and git log. CX Codex +1 ★ 34repo stars code-sync Reconciles project specifications and backlog records with actual repository code after merges, updating statuses only on hard evidence. CX Codex +1 ★ 34repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor