atlas.pattern

A codebase-analysis command that learns how a specific project implements a requested design pattern. It scans a small number of strong examples and can save the findings for later use.

In plain words
What is it for?
Use it to study an implementation pattern, inspect representative files, cite where the pattern appears, and optionally cache the result.
Why use it?
It helps developers follow the project's existing conventions instead of applying generic patterns that may not fit its code.

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/lis186/sourceatlas/atlas.pattern
Clone the repo
git clone --depth 1 https://github.com/lis186/SourceAtlas

Made for: Claude Code.

Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,667 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.00008 $0.04667
Opus 5 $0.00004 $0.02334
Sonnet 5 $0.00002 $0.00933
Haiku 4.5 $0.00001 $0.00467

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

Security

Grade A, and why

atlas.pattern 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.

.claude/commands/atlas.pattern.md · 595 lines

How it starts

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

SourceAtlas: Pattern Learning Mode

Constitution: This command operates under ANALYSIS_CONSTITUTION.md v1.0

Key principles enforced:

  • Article I: High-entropy priority (scan 2-3 best examples, not all)
  • Article II: Mandatory directory exclusions
  • Article IV: Evidence format (file:line references)

Context

Pattern requested: $ARGUMENTS

Goal: Learn how THIS specific codebase implements the requested pattern, so you can follow the same approach for new features.

Time Limit: Complete in 5-10 minutes maximum.


Cache Check (Highest Priority)

If --force is NOT in arguments, check cache first:

  1. Extract pattern name from $ARGUMENTS (remove --save, --force)

  2. Convert to filename: spaces→-, lowercase, remove special characters, truncate to 50 characters

    • Example: "api endpoint"api-endpoint.md
    • Example: "very long pattern name that exceeds limit"very-long-pattern-name-that-exceeds-limit.md (truncated)
  3. Check cache:

    ls -la .sourceatlas/patterns/{name}.md 2>/dev/null
    
  4. If cache exists:

    • Calculate days since modification
    • Use Read tool to read cache content
    • Output:
      📁 Loading cache: .sourceatlas/patterns/{name}.md (N days ago)
      💡 Add --force to re-analyze
      
    • If over 30 days, also show:
      ⚠️ Cache is over 30 days old, recommend re-analysis
      
    • Then output:
      ---
      [cache content]
      
    • End, do not execute subsequent analysis
  5. If cache does not exist: Continue with the analysis flow below

If --force is in arguments: Skip cache check, execute analysis directly


Output Mode (Progressive Disclosure)

Parse output mode parameters from $ARGUMENTS:

Parameter Behavior Use Case
--brief Only list files, no full analysis Quick browse, file selection
--full Force full analysis of all found files Deep learning
(no parameter) Smart mode: ≤5 files→full analysis; >5 files→show selection interface Default

Read the full file on GitHub · 595 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 · 595 lines · 0 tokens per session scan A 72ea3c946872

Subscribe to this mod's changes

atlas.pattern is a command published in the GitHub repository lis186/SourceAtlas (46 stars, last pushed 1mo ago), licensed MIT. It adds 8 tokens to every session and 4,667 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-30.