update

A command that updates project context documents in .claude/context/ to match the current repository state. It reviews recent Git changes, commits, and existing context files.

In plain words
What is it for?
Use it at the end of a development session to refresh context documentation from the repository's recent changes.
Why use it?
It keeps the project notes aligned with ongoing development, so later coding sessions have current background information. It also stops if there is no context to update.

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/update
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,823 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.01823
Opus 5 $0.00000 $0.00911
Sonnet 5 $0.00000 $0.00365
Haiku 4.5 $0.00000 $0.00182

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

Security

Grade B, and why

update scanned grade B with 1 finding 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- Check context file ages: `find .claude/context -name "*.md" -type f -exec ls -lt {} + | head -5`
.claude/commands/context/update.md · 221 lines

How it starts

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

Update Context

This command updates the project context documentation in .claude/context/ to reflect the current state of the project. Run this at the end of each development session to keep context accurate.

Required Rules

IMPORTANT: Before executing this command, read and follow:

  • .claude/rules/datetime.md - For getting real current date/time

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 Validation

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

2. Change Detection

Gather information about what has changed:

Git Changes:

  • Run: git status --short to see uncommitted changes
  • Run: git log --oneline -10 to see recent commits
  • Run: git diff --stat HEAD~5..HEAD 2>/dev/null to see files changed recently

File Modifications:

  • Check context file ages: find .claude/context -name "*.md" -type f -exec ls -lt {} + | head -5
  • Note which context files are oldest and may need updates

Dependency Changes:

  • Node.js: git diff HEAD~5..HEAD package.json 2>/dev/null
  • Python: git diff HEAD~5..HEAD requirements.txt 2>/dev/null
  • Check if new dependencies were added or versions changed

3. Get Current DateTime

  • Run: date -u +"%Y-%m-%dT%H:%M:%SZ"
  • Store for updating last_updated field in modified files

Instructions

1. Systematic Change Analysis

For each context file, determine if updates are needed:

Check each file systematically:

progress.md - Always Update
  • Check: Recent commits, current branch, uncommitted changes
  • Update: Latest completed work, current blockers, next steps
  • Run: git log --oneline -5 to get recent commit messages
  • Include completion percentages if applicable

Read the full file on GitHub · 221 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 · 221 lines · 0 tokens per session scan B 8504ff323547

Subscribe to this mod's changes

update 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,823 tokens. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.