init

A setup command for creating a project's knowledge folders under .claude/docs/. These folders can hold lessons, reusable patterns, design decisions, and research notes.

In plain words
What is it for?
Use it to inspect the current setup, create missing knowledge directories after confirmation, and report their state.
Why use it?
It provides a consistent place to store project knowledge when the required folders do not yet exist.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/vladolaru/claude-code-plugins/init
Clone the repo
git clone --depth 1 https://github.com/vladolaru/claude-code-plugins
Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 866 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00009 $0.00866
Opus 5 $0.00005 $0.00433
Sonnet 5 $0.00002 $0.00173
Haiku 4.5 $0.00001 $0.00087

Measured yesterday against content hash 04359696e633, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

init scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/dex/commands/init.md · 98 lines

How it starts

The opening of the file, as written. The whole thing — 98 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/dex:init

Set up the .claude/docs/ knowledge directory for the current project. This is a setup-only command — it creates directories and reports state, nothing else.

Step 1: Discover Existing Infrastructure

Follow the Project Discovery steps from the knowledge-capture skill.

Step 2: Report Current State

Present what was found using this exact format:

Knowledge Infrastructure

Project root:     /path/to/project
CLAUDE.md:        Found (root, 245 lines)

.claude/docs/:
  learnings/      [exists: 7 files] or [missing]
  patterns/       [exists: 3 files] or [missing]
  decisions/      [exists: 2 files] or [missing]
  research/       [exists: 1 file] or [missing]

Step 3: Scaffold If Needed

If everything already exists: Report "Knowledge infrastructure is already set up." and show the summary. Continue to Step 4.

If .claude/docs/ or any subdirectories are missing:

Use AskUserQuestion:

Question: "Create missing knowledge directories?" Options:

  • Yes, create them — creates all missing directories under .claude/docs/
  • No, not now — skip

If user selects yes:

Create all missing directories using mkdir -p. Create empty directories only — no README files, no templates, no boilerplate.

Report what was created:

Created:
  .claude/docs/learnings/
  .claude/docs/patterns/
  .claude/docs/decisions/
  .claude/docs/research/

Ready for knowledge capture. Use /dex:learn, /dex:pattern, or /dex:research to start.

Step 3.5: Offer Migration (If Mismatch Detected)

If discovery flagged a migration mismatch (instructions file resolved to AGENTS.md but knowledge exists in .claude/docs/, not .ai/docs/):

Use AskUserQuestion:

Question: "Knowledge is in .claude/docs/ but project uses AGENTS.md. Migrate to .ai/docs/?"

Show in the description:

This moves .claude/docs/.ai/docs/ for consistency with the AGENTS.md setup. All existing knowledge documents are preserved.

Options:

  • Yes, migrate — creates .ai/ if needed, moves .claude/docs/ to .ai/docs/ via mv
  • Keep as-is — continues using .claude/docs/

Read the full file on GitHub · 98 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 98 lines · 9 tokens per session scan A 04359696e633

Subscribe to this mod's changes

init is a command published in the GitHub repository vladolaru/claude-code-plugins (8 stars, last pushed 4d ago), licensed MIT. It adds 9 tokens to every session and 866 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.