analyze-claude-code — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited analyze-claude-code (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Deep dive into Claude Code CLI source code to understand its architecture and implementation.
# One-liner: download, extract, and format
curl -sL "$(curl -s https://registry.npmjs.org/@anthropic-ai/claude-code/latest | jq -r '.dist.tarball')" -o claude-code.tgz && tar -xzf claude-code.tgz && npx js-beautify --replace package/cli.jsAccess official docs via WebFetch tool:
Use the WebFetch tool to query Claude Code's official documentation when you need authoritative information about features, API, or best practices.
Documentation entry point:
https://code.claude.com/docs/llms.txtExample queries:
# Get documentation overview
Use WebFetch tool with:
url: https://code.claude.com/docs/llms.txt
prompt: "Show me the table of contents and main sections"
# Query specific topics
Use WebFetch tool with:
url: https://code.claude.com/docs/llms.txt
prompt: "How do hooks work? Explain with examples"
Use WebFetch tool with:
url: https://code.claude.com/docs/llms.txt
prompt: "What are the available MCP transport types and their differences?"When to use:
System prompts that define Claude's behavior and capabilities.
Quick extraction:
# Find Claude identity
grep -n "You are Claude" package/cli.js
# Find prompt sections (around line 435350)
grep -n "# Tone and style\|# Doing tasks\|# Tool usage policy" package/cli.js
# Find tool descriptions
grep -n "Executes a given bash command\|Reads a file from\|Fast file pattern" package/cli.jsKey locations:
l10 variable: Base identity "You are Claude Code..."rc function: Main system prompt builderSEB for Read, c10 for Glob)Prompt sections: Tone/style, Professional objectivity, Task management, Tool usage policy, Code references
#### Advanced Prompt Discovery
Core Principle: Trace prompts from function entry points using code structure, not content keywords.
Three-Layer Abstraction:
Tracing Flow:
/command → Command registry → Handler function → Prompt constructionKey search patterns:
# Layer 3: Code characteristics (start here)
grep -n "return \`" package/cli.js # Template strings
grep -n "messages\s*:\|system\s*:" package/cli.js # API calls
awk '/return `/{start=NR} /^`/&&NR-start>15{print "Line",start}' package/cli.js # Long strings
# Layer 2: Structure characteristics
grep -n "You are\|Your task\|Please" package/cli.js # Imperative patterns
grep -n "<example>" package/cli.js # Example blocks
grep -n "format.*response\|output.*should" package/cli.js # Format descriptions
# Combined: Long strings with imperative content
grep -n "return \`" package/cli.js | while read l; do
line=$(echo $l | cut -d: -f1)
sed -n "$line,$((line+20))p" package/cli.js | grep -q "You are\|Your task" && echo "Line $line"
doneTracing workflow (from command):
# 1. Find command definition
grep -n 'name.*"compact"' package/cli.js
# → Line 12345
# 2. Extract command object (check type: "prompt" or "local")
sed -n '12340,12370p' package/cli.js
# → type: "local", handler: (args) => kv1(args)
# 3. Find handler function
grep -n 'function kv1\|const kv1' package/cli.js
# → Line 45678
# 4. Search for prompt construction in handler
sed -n '45678,45900p' package/cli.js | grep -n 'return `\|messages:\|system:'
# → Line 23: return `Your task is to create...
# 5. Extract full prompt
sed -n '45700,46200p' package/cli.jsPrompt identification heuristics:
A code block is likely a prompt if it scores ≥4:
<example> or Example: (+2)Example: Trace any local command
COMMAND="init" # or any command name
# Step 1-2: Find command and handler
HANDLER=$(sed -n "$(grep -n "name.*\"$COMMAND\"" package/cli.js | cut -d: -f1),+30p" package/cli.js | \
grep -o 'handler.*[a-zA-Z_][a-zA-Z0-9_]*' | tail -1)
# Step 3: Find handler line
HANDLER_LINE=$(grep -n "function $HANDLER\|const $HANDLER" package/cli.js | cut -d: -f1)
# Step 4-5: Extract prompts
sed -n "$HANDLER_LINE,$((HANDLER_LINE+300))p" package/cli.js | grep -B2 -A20 'return `'Built-in tools: Bash, Read, Write, Edit, Glob, Grep, Task, WebFetch, etc.
Search patterns:
grep -n "tool.*schema\|toolName\|Tool.*definition" package/cli.jsKey aspects:
Specialized agents for task delegation: Explore, Plan, General-purpose, Bash, etc.
Search patterns:
grep -n "subagent\|agentType\|Task.*agent" package/cli.jsKey aspects:
Explore (Haiku, read-only), Plan (inherit model), General-purpose (full tools)Event-driven extensibility mechanism.
Search patterns:
grep -n "registeredHooks\|PreToolUse\|PostToolUse\|hookEvent" package/cli.jsHook events:
| Event | Trigger | Matcher Support |
|---|---|---|
PreToolUse | Before tool execution | Yes |
PostToolUse | After tool success | Yes |
UserPromptSubmit | User sends prompt | No |
SessionStart | Session begins | Yes |
Stop | Agent completes | No |
Key aspects:
allow/deny/ask)updatedInput to modify tool parametersModular knowledge packages (SKILL.md files).
Search patterns:
grep -n "SKILL\.md\|skill.*description\|loadSkill" package/cli.jsKey aspects:
name, description, allowed-tools, model, context, hooks~/.claude/skills/, .claude/skills/, plugin bundlesExtension packages containing skills, commands, MCP servers.
Search patterns:
grep -n "plugin\.json\|loadPlugin\|pluginRoot" package/cli.jsStructure:
plugin/
├── .claude-plugin/plugin.json # Metadata
├── commands/ # Slash commands
├── agents/ # Custom subagents
├── skills/ # Skills
├── hooks/hooks.json # Hook configs
└── .mcp.json # MCP serversKey aspects:
/plugin-name:command)--plugin-dirUser-invoked commands with / prefix.
Search patterns:
grep -n "slashCommand\|commands/.*\.md\|ARGUMENTS" package/cli.jsTypes:
/clear, /compact, /config, /model, etc..claude/commands/*.md/plugin:command/mcp__server__promptFrontmatter: allowed-tools, description, model, context, hooks
External tool integration via MCP servers.
Search patterns:
grep -n "MCP\|mcpServer\|mcp__" package/cli.jsKey aspects:
mcp__<server>__<tool>list_changedPersistent instructions loaded into context.
Search patterns:
grep -n "CLAUDE\.md\|loadMemory\|rules/.*\.md" package/cli.jsHierarchy (high to low priority):
/Library/Application Support/ClaudeCode/CLAUDE.md./CLAUDE.md or ./.claude/CLAUDE.md./.claude/rules/*.md~/.claude/CLAUDE.md./CLAUDE.local.mdConfiguration with four-level scope system.
Search patterns:
grep -n "settings\.json\|loadSettings\|settingsScope" package/cli.jsPriority (high to low):
.claude/settings.local.json.claude/settings.json~/.claude/settings.jsonKey configs: permissions, hooks, model, env, sandbox
Search tools - Examples use grep, but any search tool works:
grep -n "pattern" file - Basic searchrg -n "pattern" file - Ripgrep (faster)ag "pattern" file - The Silver SearcherGrep tool for best integrationView context - After finding line numbers:
sed -n 'START,ENDp' file - Extract line rangerg -A5 -B5 "pattern" file - Show context around matchesKey principles:
${}~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.