craft-project-audit

craft-project-audit is a skill for Claude Code, Codex from derjochenmeyer/claude-code-craft. It costs 79 tokens per session (4,992 once invoked), scanned A, original, MIT.

A quick local health check for a Claude Code project. It examines files, Git activity, hooks, decisions, memory, and project history without using research agents or external fetching.

In plain words
What is it for?
Checking project setup, stale files, hook behavior, decision records, memory usage, recent work, and when a future planning or “dream” review may be useful.
Why use it?
It gives a fast view of whether the project's working structure is complete and current. This helps decide whether a deeper audit is needed.

Skill for Claude CodeCodex

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 skills/derjochenmeyer/claude-code-craft/craft-project-audit
Any agent
npx skills add derjochenmeyer/claude-code-craft --skill craft-project-audit
Clone the repo
git clone --depth 1 https://github.com/derjochenmeyer/claude-code-craft

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for craft-project-audit

README.md
[![agentmods](https://agentmods.dev/badge/skills/derjochenmeyer/claude-code-craft/craft-project-audit.svg)](https://agentmods.dev/skills/derjochenmeyer/claude-code-craft/craft-project-audit)
Your own site
<a href="https://agentmods.dev/skills/derjochenmeyer/claude-code-craft/craft-project-audit"><img src="https://agentmods.dev/badge/skills/derjochenmeyer/claude-code-craft/craft-project-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,992 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 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.00079 $0.04992
Opus 5 $0.00039 $0.02496
Sonnet 5 $0.00016 $0.00998
Haiku 4.5 $0.00008 $0.00499

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

Security

Grade A, and why

craft-project-audit scanned grade A 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 4d 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 directorieslowAgent snooping

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

CLAUDE_IMPORTS=$(grep -c "^@" CLAUDE.md 2>/dev/null || grep -c "^@" .claude/CLAUDE.md 2>/dev/null || true)

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

skills/craft-project-audit/SKILL.md · 395 lines

How it starts

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

craft-project-audit

Fast health check. Tells you: is the structure complete? are the hooks functional? are the decisions well-formed? does the memory show adoption? when does the next dream make sense?

For deep analysis (feature adoption, session patterns, new releases): /craft-project-audit-full.


Step 1: Gather data

Run this entire block as one bash command:

CWD=$(pwd)
PROJECT_NAME=$(basename "$CWD")
NOW=$(date +%s)

# Git
LAST_COMMIT_TS=$(git log -1 --format="%ct" 2>/dev/null || echo "0")
LAST_COMMIT_REL=$(git log -1 --format="%cr" 2>/dev/null || echo "no commits")
COMMITS_30D=$(git log --since="30 days ago" --oneline 2>/dev/null | wc -l | tr -d ' ')
UNCOMMITTED=$(git status --porcelain 2>/dev/null | wc -l | tr -d ' ')
BRANCH=$(git branch --show-current 2>/dev/null || echo "—")
HAS_GIT=false
git rev-parse --git-dir >/dev/null 2>&1 && HAS_GIT=true

# Portable age helpers
file_age() {
  local ts
  ts=$(stat -f "%m" "$1" 2>/dev/null || stat -c "%Y" "$1" 2>/dev/null)
  [[ -z "$ts" ]] && echo "missing" || echo $(( (NOW - ts) / 86400 ))
}
dir_birth() {
  local ts
  ts=$(stat -f "%B" "$1" 2>/dev/null || stat -c "%W" "$1" 2>/dev/null)
  [[ -z "$ts" || "$ts" == "0" || "$ts" == "-" ]] && echo "?" || echo $(( (NOW - ts) / 86400 ))
}

# --- Structure completeness ---
EXPECTED=(
  "CLAUDE.md"
  ".claude/settings.json"
  ".craft/PROJECT_STATE.md"
  ".craft/BACKLOG.md"
  ".craft/HANDOVER.md"
  ".craft/DECISIONS.md"
  ".craft/QUALITY.md"
  ".craft/memory/MEMORY_INDEX.md"
  ".craft/memory/learned-rules.md"
  ".craft/rules/coding.md"
)
MISSING_STRUCT=()
for p in "${EXPECTED[@]}"; do
  [[ ! -e "$p" ]] && MISSING_STRUCT+=("$p")
done
STRUCT_OK=$(( ${#EXPECTED[@]} - ${#MISSING_STRUCT[@]} ))
STRUCT_TOTAL=${#EXPECTED[@]}
CRAFT_AGE=$(dir_birth ".craft")

# --- Namespace purity: .craft/ must only contain craft-owned files ---
# Project work data (analyses, research, outputs) belongs in visible folders,
# never in .craft/. Flag anything that is not a known craft name.
CRAFT_WHITELIST="^(PROJECT_STATE\.md|BACKLOG\.md|HANDOVER\.md|DECISIONS\.md|DREAM_LOG\.md|QUALITY\.md|MEMORY_INDEX\.md|learned-rules\.md|rules|memory|dreams|archive|skills)$"
CRAFT_INTRUDERS=""
if [[ -d .craft ]]; then
  CRAFT_INTRUDERS=$(ls .craft/ 2>/dev/null | grep -vE "$CRAFT_WHITELIST" | head -10 | xargs)
fi

# --- File ages ---
STATE_AGE=$(file_age ".craft/PROJECT_STATE.md")
BACKLOG_AGE=$(file_age ".craft/BACKLOG.md")
HANDOVER_AGE=$(file_age ".craft/HANDOVER.md")
DECISIONS_AGE=$(file_age ".craft/DECISIONS.md")
CLAUDE_AGE=$(file_age "CLAUDE.md")
[[ "$CLAUDE_AGE" == "missing" ]] && CLAUDE_AGE=$(file_age ".claude/CLAUDE.md")

# --- CLAUDE.md content ---
CLAUDE_LINES=$(wc -l < CLAUDE.md 2>/dev/null || wc -l < .claude/CLAUDE.md 2>/dev/null || echo "0")
CLAUDE_LINES=$(echo "$CLAUDE_LINES" | tr -d ' ')
CLAUDE_IMPORTS=$(grep -c "^@" CLAUDE.md 2>/dev/null || grep -c "^@" .claude/CLAUDE.md 2>/dev/null || true)
CLAUDE_IMPORTS=${CLAUDE_IMPORTS:-0}
RULES_COUNT=$(ls .craft/rules/ 2>/dev/null | wc -l | tr -d ' ')
CLAUDE_WHY=$(grep -cE "\b(because|reason|why|—|->|so that)\b" CLAUDE.md 2>/dev/null || true)
CLAUDE_WHY=${CLAUDE_WHY:-0}
CLAUDE_RULES=$(grep -cE "^[-*]|^[0-9]+\." CLAUDE.md 2>/dev/null || true)
CLAUDE_RULES=${CLAUDE_RULES:-1}
[[ "$CLAUDE_RULES" == "0" ]] && CLAUDE_RULES=1
WHY_RATIO=$(( CLAUDE_WHY * 100 / (CLAUDE_RULES > 0 ? CLAUDE_RULES : 1) ))

# --- Backlog ---
BACKLOG_OPEN=$(grep -c "^- \[ \]" .craft/BACKLOG.md 2>/dev/null || true)
BACKLOG_OPEN=${BACKLOG_OPEN:-0}
BACKLOG_DONE=$(grep -c "^- \[x\]" .craft/BACKLOG.md 2>/dev/null || true)
BACKLOG_DONE=${BACKLOG_DONE:-0}

# --- Staleness: commits + file-changes since each marker file's mtime ---
changes_since() {
  local target="$1"
  [[ ! -f "$target" ]] && { echo "0|0"; return; }
  local mtime
  mtime=$(stat -f "%m" "$target" 2>/dev/null || stat -c "%Y" "$target" 2>/dev/null || echo 0)
  local commits=0 files=0
  if $HAS_GIT; then
    commits=$(git log --since="@$mtime" --oneline 2>/dev/null | wc -l | tr -d ' ')
  fi
  files=$(find . -maxdepth 3 -type f -newer "$target" \
    -not -path "./.craft/*" -not -path "./.git/*" \
    -not -path "./node_modules/*" -not -path "./dist/*" -not -path "./build/*" \
    -not -path "./.next/*" -not -path "./.astro/*" -not -path "./vendor/*" \
    -not -path "./__pycache__/*" -not -path "./.venv/*" -not -path "./venv/*" \
    2>/dev/null | wc -l | tr -d ' ')
  echo "${commits}|${files}"
}
STATE_ACTIVITY=$(changes_since ".craft/PROJECT_STATE.md")
BACKLOG_ACTIVITY=$(changes_since ".craft/BACKLOG.md")
HANDOVER_ACTIVITY=$(changes_since ".craft/HANDOVER.md")

# --- Dream history ---
DREAM_COUNT=0
LAST_DREAM_AGE="never"
if [[ -d .craft/dreams ]]; then
  DREAM_COUNT=$(ls .craft/dreams/ 2>/dev/null | wc -l | tr -d ' ')
  if [[ $DREAM_COUNT -gt 0 ]]; then
    LAST_DREAM=$(ls -t .craft/dreams/ 2>/dev/null | head -1)
    [[ -n "$LAST_DREAM" ]] && LAST_DREAM_AGE=$(file_age ".craft/dreams/$LAST_DREAM")
  fi
fi

# --- Memory adoption (defaults vs custom entries) ---
MEMORY_FILES=$(ls .craft/memory/ 2>/dev/null | wc -l | tr -d ' ')
MEM_DEFAULTS=$(ls .craft/memory/ 2>/dev/null | grep -cE "^(MEMORY_INDEX\.md|learned-rules\.md|archive)$" || true)
MEM_DEFAULTS=${MEM_DEFAULTS:-0}
MEM_CUSTOM=$(( MEMORY_FILES - MEM_DEFAULTS ))
(( MEM_CUSTOM < 0 )) && MEM_CUSTOM=0

# --- DECISIONS format ---
DEC_ENTRIES=0
DEC_WELLFORMED=0
if [[ -f .craft/DECISIONS.md ]]; then
  DEC_ENTRIES=$(grep -c "^## D[0-9]" .craft/DECISIONS.md 2>/dev/null || true)
  DEC_ENTRIES=${DEC_ENTRIES:-0}
  DEC_WELLFORMED=$(awk '
    /^## D[0-9]/ {if (in_e && date && decision && why && apply) count++; in_e=1; date=0; decision=0; why=0; apply=0; next}
    in_e && /^\*\*Date:\*\*/ {date=1}
    in_e && /^\*\*Decision:\*\*/ {decision=1}
    in_e && /^\*\*Why:\*\*/ {why=1}
    in_e && /^\*\*How to apply:\*\*/ {apply=1}
    END {if (in_e && date && decision && why && apply) count++; print count+0}
  ' .craft/DECISIONS.md 2>/dev/null)
fi

# --- Hook functionality ---
HOOK_JSON_VALID="n/a"
HOOK_EXEC_STATUS="n/a"
HOOK_COUNT=0
HOOK_FAILURES=()
if [[ -f .claude/settings.json ]]; then
  if jq empty .claude/settings.json 2>/dev/null; then
    HOOK_JSON_VALID="yes"
    HOOK_COUNT=$(jq '[.hooks // {} | to_entries[] | .value[]? | .hooks[]?] | length' .claude/settings.json 2>/dev/null)
    HOOK_EXEC_STATUS="ok"
    while IFS= read -r cmd; do
      [[ -z "$cmd" || "$cmd" == "null" ]] && continue
      output=$(bash -c "$cmd" 2>&1)
      # Valid: empty output, or output that parses as JSON
      if [[ -n "$output" ]] && ! echo "$output" | jq empty 2>/dev/null; then
        HOOK_EXEC_STATUS="fail"
        HOOK_FAILURES+=("${cmd:0:60}...")
      fi
    done < <(jq -r '.hooks // {} | to_entries[] | .value[]? | .hooks[]? | .command' .claude/settings.json 2>/dev/null)
  else
    HOOK_JSON_VALID="no"
    HOOK_EXEC_STATUS="skipped"
  fi
fi

# --- Global settings (user-level) ---
EFFORT=$(jq -r '.effortLevel // "not set"' ~/.claude/settings.json 2>/dev/null || echo "not set")
STATUSLINE=$(jq -r 'if .statusLine.command then "configured" else "not set" end' ~/.claude/settings.json 2>/dev/null || echo "not set")
HOOK_EVENTS=$(jq -r '.hooks // {} | keys | join(", ")' ~/.claude/settings.json 2>/dev/null || echo "none")

# --- Craft skills installed ---
# Array syntax used intentionally — zsh does not word-split unquoted
# strings in `for s in $VAR`, so the string form loops only once.
CRAFT_SKILLS_LIST=(
  craft-project-setup craft-project-status craft-project-audit
  craft-project-audit-full craft-project-dream craft-project-explore
  craft-global-audit craft-session-solidify craft-update-self craft-project-remember
)
MISSING_SKILLS=""
for s in "${CRAFT_SKILLS_LIST[@]}"; do
  [[ ! -d "$HOME/.claude/skills/$s" ]] && MISSING_SKILLS="$MISSING_SKILLS $s"
done
MISSING_SKILLS=$(echo "$MISSING_SKILLS" | xargs)

echo "=== DATA ==="
echo "PROJECT=$PROJECT_NAME BRANCH=$BRANCH COMMITS_30D=$COMMITS_30D HAS_GIT=$HAS_GIT"
echo "LAST_COMMIT=$LAST_COMMIT_REL LAST_COMMIT_TS=$LAST_COMMIT_TS UNCOMMITTED=$UNCOMMITTED"
echo "STRUCT_OK=$STRUCT_OK STRUCT_TOTAL=$STRUCT_TOTAL MISSING_STRUCT=${MISSING_STRUCT[*]}"
echo "CRAFT_AGE=$CRAFT_AGE"
echo "CRAFT_INTRUDERS=$CRAFT_INTRUDERS"
echo "STATE_AGE=$STATE_AGE BACKLOG_AGE=$BACKLOG_AGE HANDOVER_AGE=$HANDOVER_AGE DECISIONS_AGE=$DECISIONS_AGE CLAUDE_AGE=$CLAUDE_AGE"
echo "CLAUDE_LINES=$CLAUDE_LINES CLAUDE_IMPORTS=$CLAUDE_IMPORTS RULES_COUNT=$RULES_COUNT WHY_RATIO=$WHY_RATIO%"
echo "BACKLOG_OPEN=$BACKLOG_OPEN BACKLOG_DONE=$BACKLOG_DONE"
echo "STATE_ACTIVITY=$STATE_ACTIVITY BACKLOG_ACTIVITY=$BACKLOG_ACTIVITY HANDOVER_ACTIVITY=$HANDOVER_ACTIVITY"
echo "DREAM_COUNT=$DREAM_COUNT LAST_DREAM_AGE=$LAST_DREAM_AGE"
echo "MEMORY_FILES=$MEMORY_FILES MEM_CUSTOM=$MEM_CUSTOM"
echo "DEC_ENTRIES=$DEC_ENTRIES DEC_WELLFORMED=$DEC_WELLFORMED"
echo "HOOK_JSON_VALID=$HOOK_JSON_VALID HOOK_EXEC_STATUS=$HOOK_EXEC_STATUS HOOK_COUNT=$HOOK_COUNT HOOK_FAILURES=${HOOK_FAILURES[*]}"
echo "EFFORT=$EFFORT STATUSLINE=$STATUSLINE HOOK_EVENTS=$HOOK_EVENTS"
echo "MISSING_SKILLS=$MISSING_SKILLS"

Read the full file on GitHub · 395 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. 4d ago First seen · 395 lines · 79 tokens per session scan A f3f5d02b1035

Subscribe to this mod's changes

craft-project-audit is a skill published in the GitHub repository derjochenmeyer/claude-code-craft (2 stars, last pushed 4mo ago), licensed MIT. It adds 79 tokens to every session and 4,992 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A 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.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens