claude-code-setup CLAUDE.md

Project instructions for petekp/claude-code-setup, a repository that manages Claude Code and Codex configuration. It covers shell scripts, skills, hooks, settings, symlinks, validation, and setup checks.

In plain words
What is it for?
Editing skills and scripts, validating frontmatter, checking symlink health, and maintaining the setup that connects the repository to Claude Code and Codex.
Why use it?
They help an agent change the configuration without breaking symbolic links or committing machine-specific links. A symbolic link is a filesystem pointer to another file or directory.

Instructions file

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 instructions/petekp/claude-code-setup/claude-md
Clone the repo
git clone --depth 1 https://github.com/petekp/claude-code-setup
Per session 816 This file is loaded in full into every session.
When invoked 816 The same file — it is already loaded in full.
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.00816 $0.00816
Opus 5 $0.00408 $0.00408
Sonnet 5 $0.00163 $0.00163
Haiku 4.5 $0.00082 $0.00082

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

Security

Grade B, and why

claude-code-setup CLAUDE.md 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.

- `~/.claude/settings.json` must remain a symlink to this repo's `settings.json`. Editing it in place can silently replace the symlink with a regular file — after any settings change, confirm the symlink is intact and re
CLAUDE.md · 12 lines

What it actually says

This repo is my version-controlled configuration for Claude Code and Codex: skills, hook scripts, settings, and the symlink setup that wires them into ~/.claude and ~/.codex. It is bash and markdown only — no application code, build step, or test suite.

  • Shell scripts live in scripts/ and setup.sh. Keep scripts with a #!/bin/sh shebang POSIX-compatible (no bashisms).
  • After changing skills or scripts, run ./scripts/validate.sh (frontmatter checks) and ./setup.sh --verify (symlink health).
  • ~/.claude/settings.json must remain a symlink to this repo's settings.json. Editing it in place can silently replace the symlink with a regular file — after any settings change, confirm the symlink is intact and restore it if not.
  • Entries in skills/ are a mix of real directories and symlinks out to ~/.agents/skills and other repos. Edit symlinked skills at their source; never dereference a symlink into a copy.
  • Symlinked skills are not committed — their targets are absolute paths on one machine, so committing them hands anyone else a dangling link. They are recorded in SKILLS.md and ignored via skills/.gitignore, both generated. After adding or removing a skill, run ./scripts/gen-skills-manifest.sh; --check verifies they are current without rewriting.
  • scripts/skill-doctor.sh runs on every SessionStart (--quiet) and is the safety net for skill wiring. It auto-fixes what cannot be got wrong — relative symlinks rewritten absolute, a stale SKILLS.md regenerated, dangling store links that point at deleted repo skills pruned — and only reports things needing judgment: dangling links in skills/, a repo skill shadowed by an enabled plugin, and ~/.claude/settings.json having stopped being a symlink. Run it with no arguments for the full report. It never repairs the settings symlink; that needs a diff first.
  • scripts/skill-manager.sh is the on-demand counterpart to skill-doctor: doctor answers "is the wiring intact," this answers "is the skill set still worth carrying." Subcommands: report (full audit, runs all the checks below), usage [--top N], dupes, check (availability across Claude/Codex/agent dirs), sync, update (pending npx skills updates), prune (removal candidates). It reads ~/.claude/skill-usage.jsonl, which is written by skill-usage-tracker.sh (wired to PostToolUse and UserPromptSubmit in settings.json) — not by this script. Its own log <name> subcommand has no callers and is vestigial. Note that the usage log misses Codex and cloud sessions, so a zero there is not proof a skill is unused.
  • Removing a skill installed by npx skills means clearing four things, not one: the skills/ entry, the ~/.agents/skills content copy, the ~/.agents/.skill-lock.json key, and any links in other agent directories (~/.codex, ~/.config/goose, …). The lockfile key matters most — skills update -g iterates keys rather than scanning disk, so a leftover key reinstalls the skill everywhere on the next update. skills remove <name> cannot clear a key whose files are already gone; use jq for those. sync-codex-skills.sh cleans up its own links; the other agent directories need a manual sweep.
  • Hook scripts referenced by settings.json run on every session. Test changes to them before committing (they fail silently in the harness).
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 · 12 lines · 816 tokens per session scan B e904bfa1f598

Subscribe to this mod's changes

claude-code-setup CLAUDE.md is an instructions file published in the GitHub repository petekp/claude-code-setup (45 stars, last pushed 26d ago), licensed MIT. It adds 816 tokens to every session, about $0.0041 per session on Opus 5. 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.