prime

A command that loads a project's saved context documents and checks their basic availability and format before an agent starts work.

In plain words
What is it for?
Use it at the start of a session to read files in `.claude/context/`, count them, and flag empty, unreadable, or incorrectly formatted files.
Why use it?
It helps a new agent understand the project without repeatedly asking for background, and reports when the required context is missing or unusable.

Command for Claude Code

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/kamiazya/scopes/prime
Clone the repo
git clone --depth 1 https://github.com/kamiazya/scopes

Made for: Claude Code.

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 1,183 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.01183
Opus 5 $0.00000 $0.00592
Sonnet 5 $0.00000 $0.00237
Haiku 4.5 $0.00000 $0.00118

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

Security

Grade A, and why

prime 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.

.claude/commands/context/prime.md · 147 lines

How it starts

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

Prime Context

This command loads essential context for a new agent session by reading the project context documentation and understanding the codebase structure.

Preflight Checklist

Before proceeding, complete these validation steps. Do not bother the user with preflight checks progress ("I'm not going to ..."). Just do them and move on.

1. Context Availability Check

  • Run: ls -la .claude/context/ 2>/dev/null
  • If directory doesn't exist or is empty:
    • Tell user: "❌ No context found. Please run /context:create first to establish project context."
    • Exit gracefully
  • Count available context files: ls -1 .claude/context/*.md 2>/dev/null | wc -l
  • Report: "📁 Found {count} context files to load"

2. File Integrity Check

  • For each context file found:
    • Verify file is readable: test -r ".claude/context/{file}" && echo "readable"
    • Check file has content: test -s ".claude/context/{file}" && echo "has content"
    • Check for valid frontmatter (should start with ---)
  • Report any issues:
    • Empty files: "⚠️ {filename} is empty (skipping)"
    • Unreadable files: "⚠️ Cannot read {filename} (permission issue)"
    • Missing frontmatter: "⚠️ {filename} missing frontmatter (may be corrupted)"

3. Project State Check

  • Run: git status --short 2>/dev/null to see current state
  • Run: git branch --show-current 2>/dev/null to get current branch
  • Note if not in git repository (context may be less complete)

Instructions

1. Context Loading Sequence

Load context files in priority order for optimal understanding:

Priority 1 - Essential Context (load first):

  1. project-overview.md - High-level understanding of the project
  2. project-brief.md - Core purpose and goals
  3. tech-context.md - Technical stack and dependencies

Priority 2 - Current State (load second): 4. progress.md - Current status and recent work 5. project-structure.md - Directory and file organization

Priority 3 - Deep Context (load third): 6. system-patterns.md - Architecture and design patterns 7. product-context.md - User needs and requirements 8. project-style-guide.md - Coding conventions 9. project-vision.md - Long-term direction

Read the full file on GitHub · 147 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 · 147 lines · 0 tokens per session scan A 6220fcb90dc0

Subscribe to this mod's changes

prime is a command published in the GitHub repository kamiazya/scopes (2 stars, last pushed 9mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,183 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.