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.
npx agentmods add instructions/smartwatermelon/claude-wrapper/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.svg" alt="Measured on agentmods" 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 | $0.02491 | $0.02491 |
| Opus 5 | $0.01246 | $0.01246 |
| Sonnet 5 | $0.00498 | $0.00498 |
| Haiku 4.5 | $0.00249 | $0.00249 |
Grade A, and why
claude-wrapper CLAUDE.md scanned grade A with 0 findings 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 5d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 151 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
There is no test runner script — run individual test files directly. No npm test or make test.
Lint
shellcheck --external-sources lib/*.sh bin/claude-wrapper tests/*.sh
Use --external-sources because lib files source each other via variables (${WRAPPER_LIB}/logging.sh), and plain shellcheck emits false SC1091 warnings.
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. 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 - 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 remote-control args —
build_remote_control_argscomputes--remote-control <session-name>for interactive sessions (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 with the real binary, applying the remote-control args from step 7
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.
- 5d 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 (5 stars, last pushed 16d ago), licensed MIT. It adds 2,491 tokens to every session, about $0.0125 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
lade AGENTS.md
AGENTS.md instructions for zifeo/lade, covering agents.md, build & test, house rules, project layout and maintainer note.
dotfiles AGENTS.md
Instructions for helderberto/dotfiles, covering agents.md, before coding, surgical changes, verification and code principles.
dotfiles AGENTS.md
AGENTS.md instructions for sfc-gh-eraigosa/dotfiles, covering dotfiles repository, repository structure, usage guidelines, asking the user (blocking questions must be colorized) and portability & best practices.
shellnium CLAUDE.md
Instructions for Rasukarusan/shellnium, covering claude.md, project overview, repository structure, common commands and bootstrap.
bash-lsp CLAUDE.md
Instructions for zircote/bash-lsp, covering claude.md, project overview, setup, key files and conventions.
rust-bash AGENTS.md
Instructions for shantanugoel/rust-bash, covering agents.md, canonical spec, steps to do for any task and agent execution rules.