Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/hiromaily/go-crypto-walletnpx agentmods add rules/hiromaily/go-crypto-wallet/shell-scriptWrote 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/rules/hiromaily/go-crypto-wallet/shell-script)<a href="https://agentmods.dev/rules/hiromaily/go-crypto-wallet/shell-script"><img src="https://agentmods.dev/badge/rules/hiromaily/go-crypto-wallet/shell-script/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/rules/hiromaily/go-crypto-wallet/shell-script"><img src="https://agentmods.dev/badge/rules/hiromaily/go-crypto-wallet/shell-script.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.00000 | $0.03973 |
| Opus 5 | $0.00000 | $0.01987 |
| Sonnet 5 | $0.00000 | $0.00795 |
| Haiku 4.5 | $0.00000 | $0.00397 |
Grade C, and why
shell-script scanned grade C 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 8d 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
find "$wallet_dir" -mindepth 1 ! -name 'bitcoin.conf' -exec rm -rf {} + 2>/dev/null || true How it starts
The opening of the file, as written. The whole thing — 705 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Shell Script Best Practices
Overview
Rules for writing robust, maintainable shell scripts in go-crypto-wallet. These rules are based on code review feedback and industry best practices.
Critical Shell Options
Always Use Strict Mode
set -euo pipefail
Explanation:
-e: Exit immediately if any command fails-u: Treat unset variables as errors-o pipefail: Fail if any command in a pipeline fails (not just the last one)
Why pipefail matters:
# WITHOUT pipefail (BAD)
set -eu
cat nonexistent.txt | grep "pattern" # Only grep's exit code matters
# WITH pipefail (GOOD)
set -euo pipefail
cat nonexistent.txt | grep "pattern" # Fails immediately if cat fails
Variable Configuration
Make Hardcoded Values Configurable
Bad:
# Hardcoded volume name - brittle if project name changes
docker volume rm "go-crypto-wallet_wallet-mysql"
Good:
# Configurable with default
DOCKER_VOLUME_NAME="${DOCKER_VOLUME_NAME:-go-crypto-wallet_wallet-mysql}"
docker volume rm "$DOCKER_VOLUME_NAME"
Benefits:
- Flexibility for different environments
- No breakage if project structure changes
- Easy to override in CI/CD
Environment Variable Naming
Use descriptive, uppercase names with underscores:
RPC_USER="${RPC_USER:-xyz}"
RPC_PASSWORD="${RPC_PASSWORD:-xyz}"
WALLET_PASSPHRASE="${WALLET_PASSPHRASE:-test}"
DOCKER_VOLUME_NAME="${DOCKER_VOLUME_NAME:-go-crypto-wallet_wallet-mysql}"
Use Environment Variables Instead of Modifying Config Files
Bad (creates backups, modifies files):
# Backup and modify config file
sed -i.bak 's|host: "127.0.0.1:18332"|host: "127.0.0.1:18332/wallet/watch"|' config.yaml
# ... operations ...
# Restore backup
if [ -f "config.yaml.bak" ]; then
mv "config.yaml.bak" "config.yaml"
fi
Good (use environment variables):
# Create wrapper function to set environment variable per-command
watch_with_wallet() {
WALLET_BITCOIN_HOST="127.0.0.1:18332/wallet/watch" watch "$@"
}
# Use wrapper function
watch_with_wallet -c config.yaml create payment
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.
- 8d ago First seen · 705 lines · 0 tokens per session scan C bd30174111cd
shell-script is a cursor rule published in the GitHub repository hiromaily/go-crypto-wallet (127 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,973 tokens. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.