Install command
Not provided
Use the built-in /context command to inspect Claude Code's context-window usage, plus a custom .claude/commands recipe for repeatable codebase-context analysis before refactors.
Open the source and read safety notes before installing.
Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.
Decision playbook
Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.
0
78
—
No baseline selected
No major trust-signal divergence detected in the current selection.
Confirm ownership and provenance before trusting install instructions.
Source link availableRequired
Open the canonical repository and verify ownership.
Source provenance statusRequired
Marked as source-backed.
Metadata reviewed
Registry metadata indicates a reviewed listing.
Validate risk disclosures before installation or API wiring.
Safety notes presentRequired
Review the listed safety guidance before running commands.
Privacy notes presentRequired
Review data handling notes before connecting accounts or secrets.
Trust level risk gateRequired
Trust level does not block evaluation.
Check package metadata and artifact integrity signals.
Install payload available
Install or copy payload is available for review.
Package verification flag
No package verification flag provided.
Checksum metadata
No checksum provided for downloaded artifact.
Use compare context to validate trade-offs before adoption.
Compare tray has multiple entries
Add at least one more entry to compare trust differences.
Baseline comparison available
No baseline peer selected yet.
Diverging trust signals identified
No major trust-signal divergence found.
Setup at a glance
Copy-ready — paste the snippet to get started.
Install command
Not provided
Config snippet
Not provided
Copy snippet
Provided
Prerequisites
None
Platforms
1 listed
Difficulty
100/100
Adoption plan
Current risk score 16/100. Use staged verification before broader rollout.
Validate source and review signals before any execution.
Confirm source provenanceRequired
Source URL/provenance metadata is present.
Confirm metadata review state
Listing has review metadata.
Verify install payload
Install/config payload exists and can be inspected.
Confirm safety, privacy, and package integrity signals.
Review safety notesRequired
Safety notes are present.
Review privacy notesRequired
Privacy notes are present.
Verify package integrity metadata
No package verification/checksum metadata.
Adopt in controlled steps based on the selected plan.
Run in isolated sandbox firstRequired
Use a constrained sandbox and observe behavior across multiple tasks.
Roll out graduallyRequired
Roll out to a small cohort before wider usage.
Set monitoring and fallback
Define rollback path and monitor errors after adoption.
Evidence readiness
Required evidence gates are covered (5/6 signals complete).
Source repository/provenance is listed.
Required in this preset
Review metadata is present.
Required in this preset
Safety notes are present.
Required in this preset
Privacy notes are present.
Optional in this preset
Package integrity metadata is missing.
Optional in this preset
Install payload is available.
Required in this preset
Required evidence gates are covered for this preset.
Decision timeline
5/6 steps complete with no blocking gaps for this preset.
triage
Source/provenance metadata is available.
triage
Review metadata is available.
verify
Safety notes are available.
verify
Privacy notes are available.
verify
Package integrity metadata is missing.
rollout
Install payload is available.
No required blockers for this timeline preset.
Safety & privacy surface
2 safety and 1 privacy notes across 2 risk areas. Review closely: credentials & tokens, permissions & scopes.
/contextClaude Code gives you two practical ways to understand what is filling your context window and to gather codebase context before a big change:
/context command, for inspecting Claude Code's context window./analyze-context command you create yourself, for repeatable codebase analysis before a refactor or feature./context command/context shows a live breakdown of what is currently filling your context window, grouped by category, along with optimization suggestions. It takes no arguments or flags.
/context
It accounts for the things that consume the window, including:
/memory to see exactly which files loaded.ENABLE_TOOL_SEARCH, schemas) from connected MCP servers.Use it when responses start to feel sluggish, when you are deciding whether to run /compact or /clear, or when you want to understand why a session is approaching its limit. For the underlying model of how the window fills and compacts, see the context window documentation.
/compact — summarizes the conversation to free space while preserving startup content (CLAUDE.md, memory, MCP tools reload automatically; the skill listing is the one exception). Claude Code also compacts automatically as you approach the limit./clear — resets the conversation./memory — shows which CLAUDE.md and auto-memory files loaded at startup.Claude Code does not ship a command that auto-generates architecture reports, dependency graphs, or quality metrics. You can, however, create your own custom slash command that asks Claude to analyze a codebase the same way every time. Custom commands are user-created Markdown files — they are not built-in, and the quality of the output depends entirely on the prompt you write and what Claude can read in your repo.
Create a file at .claude/commands/analyze-context.md (project-scoped) or ~/.claude/commands/analyze-context.md (personal). The file name becomes the command name, so this file creates /analyze-context. Custom commands have merged into skills; a file under .claude/commands/ still works and supports the same frontmatter, while skills add optional features like supporting files and automatic invocation.
---
description: Analyze the architecture, patterns, and dependencies of a codebase area
argument-hint: [path]
---
Analyze the code under `$ARGUMENTS` (default to the repo root if empty).
Read the relevant files and report:
1. Tech stack and frameworks actually present (cite package manifests).
2. The architecture / layering you observe, with key directories.
3. Recurring patterns and conventions, with file references.
4. Internal coupling and any obvious refactor risks.
5. Where tests exist and where coverage looks thin.
Cite real files and line ranges. Do not invent metrics or numbers
you cannot derive from the code you actually read.
Invoke it with an optional path:
/analyze-context src/auth
The $ARGUMENTS placeholder is replaced with everything you type after the command name. You can also target a single argument with $0/$ARGUMENTS[0], or declare named arguments in frontmatter. See the arguments reference for the full substitution rules.
/context to understand and manage token usage in the current session./analyze-context command when you want a consistent, repeatable codebase walk-through before a refactor, when onboarding to an unfamiliar area, or before scoping a large change.Because the custom command is just a prompt, its findings are Claude's reading of your code in that session — not a deterministic static-analysis tool. Treat metrics and recommendations it produces as Claude's assessment, and verify anything load-bearing against the actual source.
Show that Inspect Claude Code Context Usage with /context is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.
[](https://heyclau.de/entry/commands/context-analyzer)Inspect Claude Code Context Usage with /context side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
Next steps differ across entries — use the actions in the table below to copy install commands and source links per resource.
| Field | Use the built-in /context command to inspect Claude Code's context-window usage, plus a custom .claude/commands recipe for repeatable codebase-context analysis before refactors. Open dossier | A user-created custom slash command that runs a red-green-refactor TDD loop in Claude Code: write failing tests first, implement until they pass, then refactor. Built with the documented custom-command frontmatter and $ARGUMENTS substitution, not a built-in feature. Open dossier | A user-created custom slash command for Claude Code that turns a file or function into a test suite. You create .claude/commands/generate-tests.md and invoke it with /generate-tests; it is a prompt recipe, not a built-in command, and uses no CLI flags. Open dossier | Intelligent code refactoring command that analyzes code structure and applies best practices for improved maintainability and performance Open dossier |
|---|---|---|---|---|
| Next stepsDiffers | ||||
| Trust | ||||
| Review status | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed |
| Package trust | Package not verified | Package not verified | Package not verified | Package not verified |
| Source provenance | Source-backed | Source-backed | Source-backed | Source-backed |
| Submitter | — | — | — | — |
| Install risk | Review first | Review first | Review first | Review first |
| Notes | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ |
| Brand | — | — | — | — |
| Category | commands | commands | commands | commands |
| Source | source-backed | source-backed | source-backed | source-backed |
| Author | JSONbored | JSONbored | JSONbored | JSONbored |
| Added | 2025-10-25 | 2025-10-25 | 2025-09-16 | 2025-09-16 |
| Platforms | Claude Code | Claude Code | Claude Code | Claude Code |
| Source repo | — | — | — | — |
| Safety notes | ✓The custom /analyze-context command makes Claude read files across your repository; scope it with a path argument to limit how much is pulled into context. Analysis output reflects Claude's reading of the code in that session, not a deterministic static-analysis tool — verify any load-bearing metrics or recommendations against the actual source. | ✓The base recipe does not pre-approve Bash commands. Review the project's test scripts first, then approve the exact test command when Claude Code prompts or add a narrowly scoped command only after you trust it. Claude may create and edit test and source files as part of the loop (Read/Edit/Write). Run it in version control so changes are reviewable and reversible. If you extend the prompt with auto-commit or deploy steps, add explicit safety review; the base recipe does not commit or push. | ✓The recipe asks Claude to run the test suite, which executes project code and test commands locally; review the source and tests before running, especially in an unfamiliar repository. If you add an allowed-tools field (e.g. Bash(npm test:*)), Claude can run those tool calls without a per-use permission prompt while the command is active. Scope it narrowly. Project-level .claude/commands files are shared via git and run for anyone who trusts the workspace; treat a checked-in command as executable content and review it before trusting the repo. | ✓Review generated changes and commands before applying them; slash commands can ask the agent to read, write, edit, or run tools in the current project. Limit scope to the intended files and run in a trusted checkout when the command analyzes code, tests, security findings, or generated output. |
| Privacy notes | ✓Both /context and a custom analysis command operate on whatever files and project memory are loaded in the session; no data leaves your machine beyond the normal Claude Code model request, but file contents you ask Claude to read become part of the conversation context sent to the model. | ✓The command body can read project files via @ references and !`command` injection if you add them; only reference files you are comfortable sending to the model as prompt context. The base recipe asks you to inspect project test scripts instead of injecting package.json automatically. | ✓Dynamic-injection lines (!`...`) and @file references send the output of shell commands and the contents of referenced files into the model context; avoid pointing them at files containing secrets, credentials, or other sensitive data. | ✓Prompts, source files, logs, errors, dependency metadata, and generated reports may be sent to the configured AI model during command execution. Redact secrets, customer data, private repository details, and proprietary code before sharing command output outside the workspace. |
| Prerequisites | — none listed | — none listed | — none listed | — none listed |
| Install | — | — | — | |
| Config | — | — | — | — |
| Citations | ||||
| Claim | Unclaimed | Unclaimed | Unclaimed | Unclaimed |
Source-backed guides for putting this to work.
Use Claude Code checkpoints to rewind code and conversation with /rewind before risky refactors, and know what they do not track.
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.