From keyward
Use when a prompt references a file path under ~/.claude/secrets/, or contains a `<<secret:NAME stored at ...>>` reference, or asks to use a saved API key. Teaches the correct pattern for reading vaulted secrets WITHOUT leaking them into bash output, the model context, or the session transcript.
How this skill is triggered — by the user, by Claude, or both
Slash command
/keyward:using-keywardThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The Keyward plugin saves intercepted API keys to `~/.claude/secrets/<name>.txt`
The Keyward plugin saves intercepted API keys to ~/.claude/secrets/<name>.txt
with chmod 600 permissions. When the user's prompt references one of these
files — directly or via a <<secret:NAME stored at ~/.claude/secrets/NAME.txt>>
reference — you must read and use the value WITHOUT printing it.
Never cat a secret file as a top-level command, never echo its contents,
never paste its value into your reply, never write it into a file the user can
read alongside their code.
The contents of bash stdout are added to your context window and persist in the
transcript. If you cat ~/.claude/secrets/openai.txt, the value is now in the
conversation — defeating the entire purpose of the vault.
Always inline-expand the secret as a shell variable in the same command that uses it. The value flows from disk → process env → tool, never appearing in your stdout.
export OPENAI_API_KEY=$(cat ~/.claude/secrets/openai.txt) && curl https://api.openai.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY"
GITHUB_TOKEN=$(cat ~/.claude/secrets/github_pat_classic.txt) gh api /user
ANTHROPIC_API_KEY=$(cat ~/.claude/secrets/anthropic.txt) python3 my_script.py
cat ~/.claude/secrets/openai.txt # value into stdout → context
KEY=$(cat ~/.claude/secrets/openai.txt); echo $KEY # explicit echo
head ~/.claude/secrets/openai.txt # value into stdout
with open(os.path.expanduser("~/.claude/secrets/openai.txt")) as f:
print(f.read()) # printed → captured by stdout
<<secret:NAME ...>> in the prompt,
or ask if ambiguous).OPENAI_API_KEY, ANTHROPIC_API_KEY, GITHUB_TOKEN, etc.).If you need to check whether a slot is populated WITHOUT reading the value:
test -s ~/.claude/secrets/openai.txt && echo "openai slot OK" || echo "openai slot empty/missing"
The hook handles it automatically: detection → save → sanitized re-paste.
You'll see a <<secret:NAME ...>> reference in the sanitized prompt instead
of the raw value. Treat that reference exactly like a slot path.
/raw prompt before Keyward was installed)..env files, or anywhere
on disk outside ~/.claude/secrets/. If the user needs an .env, write a
reference like OPENAI_API_KEY=$(cat ~/.claude/secrets/openai.txt) into
their shell rc, not the raw value into .env.tee, set -x mode, verbose curl).npx claudepluginhub albemiglio/keyward --plugin keywardGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.