Borrowing it
Nothing to install: this file belongs to smartwatermelon/claude-wrapper. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/smartwatermelon/claude-wrapper/main/CLAUDE.mdgit clone --depth 1 https://github.com/smartwatermelon/claude-wrapperWrote 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.
[](https://agentmods.dev/instructions/smartwatermelon/claude-wrapper/claude-md)<a href="https://agentmods.dev/instructions/smartwatermelon/claude-wrapper/claude-md"><img src="https://agentmods.dev/badge/instructions/smartwatermelon/claude-wrapper/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/smartwatermelon/claude-wrapper/claude-md"><img src="https://agentmods.dev/badge/instructions/smartwatermelon/claude-wrapper/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.03723 | $0.03723 |
| Opus 5.5 | $0.01489 | $0.01489 |
| Sonnet 5.5 | $0.00745 | $0.00745 |
| Haiku 4.5 | $0.00372 | $0.00372 |
Grade B, and why
claude-wrapper 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 9d 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.
- **`machine-settings.sh`** — passes `~/.config/claude-code/machine-settings.json` (or `$CLAUDE_MACHINE_SETTINGS`) with `--settings` for interactive sessions, so one machine can enable what the git-shared `~/.claude/sett How it starts
The opening of the file, as written. The whole thing — 189 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What This Is
A Bash wrapper around the Claude Code CLI (claude) that intercepts invocations to inject git identity, GitHub tokens, 1Password secrets, SSH key isolation, and automatic remote-control session naming before delegating to the real claude binary. Installed by symlinking bin/claude-wrapper to ~/.local/bin/claude so it shadows the real binary in $PATH.
Commands
Run tests
bash tests/test-wrapper.sh
bash tests/test-gh-token-permissions.sh
bash tests/test-remote-session.sh
bash tests/test-machine-settings.sh
bash tests/test-claude-wrapper-lite.sh
There is no test runner script — run individual test files directly. No npm test or make test.
Lint
shellcheck -S info lib/*.sh bin/claude-wrapper bin/claude-wrapper-lite tests/*.sh tests/lib/*.sh
CI (standards-check) runs shellcheck with the canonical config from smartwatermelon/github-workflows (standards/shellcheckrc: external-sources=true, source-path=SCRIPTDIR, disable=SC2310). To match CI locally, add --rcfile <path to that file>. Lib and test files source each other through variable paths (${WRAPPER_LIB}/logging.sh, ${TEST_DIR}/lib/op-guard.sh), which shellcheck cannot resolve unless external sourcing is enabled — without it, the # shellcheck source=... directives at those call sites are ignored and each one raises a false SC1091.
This repo has no .shellcheckrc of its own. A plain local run reads ~/.shellcheckrc instead, which CI never sees, so use --rcfile when the result must match CI — see PR #122.
Debug mode
CLAUDE_DEBUG=true claude
Enables verbose DEBUG: output to stderr from all modules.
Architecture
Execution flow (bin/claude-wrapper)
The wrapper is a single orchestrator that sources modules in dependency order, then execs the real binary:
- Resolve own path —
realpathto handle symlinks - Source libs —
logging.sh→permissions.sh→path-security.sh→launch-dir-check.sh→git-identity.sh→credentials.sh→secrets-loader.sh→binary-discovery.sh→pre-launch.sh→remote-session.sh→machine-settings.sh. Sourcingcredentials.shhas the side effect of fetchingOP_SERVICE_ACCOUNT_TOKENfrom the macOS Keychain andGH_TOKENfrom the 1Password Automation vault (see below). - Check launch directory —
check_launch_dirwarns (non-blocking) if CWD is exactly$HOMEor$HOME/Developer, since neither is a git repo and both carry an unrelated accumulated MCP server surface in~/.claude/.claude.json - Locate caffeinate — hardcoded to
/usr/bin/caffeinate, checked for executability; hard-fails if absent - Find real claude binary — scans
$PATHforclaude, skipping itself (the wrapper) - Validate binary — ownership and permission checks on the discovered binary
- Initialize secrets loader —
init_secrets_loaderdiscovers per-project secrets files and authenticates if needed - Build injected args —
build_remote_control_argscomputes--remote-control <session-name>, thenbuild_machine_settings_argsadds--settings <machine file>, both for interactive sessions only (applied later, at exec) - Inject 1Password secrets — if secrets are available,
inject_secretsrunsop injectto resolveop://Automation/...references from per-project.claude/secrets.op; authentication usesOP_SERVICE_ACCOUNT_TOKEN(no TouchID prompt) - Run pre-launch hook — if secrets are available,
run_pre_launch_hookruns.claude/pre-launch.shfrom the git root if it exists and passes security validation exec— replaces the wrapper process withcaffeinate -is <claude>, applying the injected args from step 8
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.
- 9d ago Changed · +5 lines · +198 tokens per session efd1b2739d03
- 14d ago Changed · +2 lines · +149 tokens per session scan A → B ddeb0f766515
- 17d ago Changed · -18 tokens per session 3917f4907857
- 28d ago Changed · +43 tokens per session aa6f86e6ec94
- 1mo ago Changed · +2 lines · +98 tokens per session ab96bad4d23c
- 1mo ago Changed accc84a2abf7
- 1mo ago Changed · +29 lines · +762 tokens per session cbfc89fa497f
- 2mo ago First seen · 151 lines · 2,491 tokens per session scan A 02cf4e2a08e5
claude-wrapper CLAUDE.md is an instructions file published in the GitHub repository smartwatermelon/claude-wrapper (6 stars, last pushed 9d ago), licensed MIT. It adds 3,723 tokens to every session, about $0.0149 per session on Opus 5.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.
Other instructions, from other repositories
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
deno copilot-instructions.md
Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.