setup

A project setup command that checks for a Git repository and the required agent-memory tool, then builds a searchable project index and creates missing context files.

In plain words
What is it for?
Use it when starting work in a repository to prepare project memory, create claude.md and agents.md, and show the next worktree steps.
Why use it?
It gives the coding agent a consistent starting context without overwriting files that already 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/ruizrica/toolkit/setup
Clone the repo
git clone --depth 1 https://github.com/ruizrica/toolkit
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 516 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.00000 $0.00516
Opus 5 $0.00000 $0.00258
Sonnet 5 $0.00000 $0.00103
Haiku 4.5 $0.00000 $0.00052

Measured 2d ago against content hash 806fb1917656, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

setup 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 2d ago.

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.

docs/commands/setup.md · 74 lines

How it starts

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

/setup

Bootstrap command for project initialization and memory-first context setup.

Usage

/setup

What it does

  1. Validates that the current directory is inside a git repository.
  2. Checks for agent-memory in PATH and fails fast with a clear message if missing.
  3. Runs agent-memory index over the repository.
  4. Creates project context files if missing:
    • claude.md
    • agents.md (reference only, no duplicated context content)
  5. Prints a compact post-setup summary and next /worktree usage steps.

Idempotent behavior

  • If claude.md already exists, the command skips re-writing it.
  • If agents.md already exists, the command skips re-writing it.
  • Re-running /setup is safe and should not overwrite existing files.

Constraints satisfied

  • Memory tool primacy is explicitly documented in generated claude.md.
  • agent-memory is required and checked before any file generation.
  • Both claude.md and agents.md are created only when absent.
  • Git repository validation runs before any operations.

Generated claude.md includes

  • Primary context guidance: use memory lookup before file reads.
  • Memory query guidance using commands such as agent-memory query, agent-memory recall, and related variants.
  • Stack and structure notes for this repository.
  • Coding conventions and architectural notes.

Generated agents.md format

agents.md is intentionally minimal and references the context file only:

# Agent Configuration

See [claude.md](./claude.md) for project context, coding standards, and memory tool usage guidelines.

## Memory Tool Usage
This project uses the agent-memory CLI. Refer to claude.md for detailed instructions on context retrieval.

Example output

Running agent-memory index ...
agent-memory index complete.

Setup summary:
- agent-memory index: done
- claude context file: created (./claude.md)
- agents file: created (./agents.md)

Next steps:
1) Run /worktree to create your first isolated worktree (auto-generates branch)
2) Run /worktree again for additional worktrees, or use /worktree [path] [branch] for custom names

Read the full file on GitHub · 74 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. 2d ago First seen · 74 lines · 0 tokens per session scan A 806fb1917656

Subscribe to this mod's changes

setup is a command published in the GitHub repository ruizrica/toolkit (5 stars, last pushed 17d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 516 tokens. 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.