/client-admin:manage-credentialsfrom client-admin
Create or update the encrypted credentials file (credentials.env.age) in the client's harness repo. Use when setting up API keys for the first time or adding/rotating a key. Run by the client admin.
Ships in client-admin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Execute this skill directly. Do not enter plan mode. Do not expose internal derivation steps to the user. The user should see only: what you found, what you need from them, and the finished result.
credentials.env.age yet in their harness repo).age is not installed on your machine. Install it first: brew install age (Mac) or winget install FiloSottile.age (Windows).This skill is run by the client admin on their own machine. The consultant's role ends at /onboard-client; credential population happens admin-side so the admin controls their own API keys and their own passphrase.
The consultant may run this skill from the master repo for demos, drills, or emergency rotations — that's not the canonical path, and the pre-flight gate below permits both.
The admin chooses how to distribute the passphrase + installer to employees. Options in order of security:
The skill does not prescribe a channel. Use whatever matches your org's existing secrets-distribution conventions. Do not paste the passphrase in the same message as the installer one-liner unless the channel is end-to-end encrypted.
This skill manages secrets and must only run on admin/consultant machines. Matches the /client-admin:generate-installer gate: clients.json is the only automatic signal that survives; everything else falls back to a single conversational question.
# Signals:
# - clients.json in $PWD → consultant (certain)
# - .claude-plugin/marketplace.json in $PWD → admin OR consultant
# (admin working inside their harness checkout, or consultant inside a client repo)
# - Neither present → unknown — ask the user
if [ -f clients.json ]; then
ROLE=consultant
elif [ -f .claude-plugin/marketplace.json ]; then
ROLE=admin_or_consultant
else
ROLE=unknown
fi
If ROLE=unknown, ask the user ONE question (no multi-step triage):
Quick check before I manage credentials — who's running this: admin, consultant, or employee?
Employee refusal text:
This skill manages the encrypted credentials file for the client harness — it's for the admin or consultant, not team members. Contact your admin if you need a key added or rotated.
Context A — Master repo (consultant): clients.json exists in $PWD. List active clients by human name — titlecase the name field (e.g., test-client → "Test Client"). Ask which client if more than one.
Context B — Client repo (admin): .claude-plugin/marketplace.json exists in $PWD. Extract <org>/<repo> from the git remote URL.
Context C — Installed harness (admin's own machine): Run this exact bash to build the candidate list — only client harness repos have a credentials/ directory; marketplace catalogs do not:
for name in $(jq -r 'keys[]' ~/.claude/plugins/known_marketplaces.json 2>/dev/null); do
[ -d "$HOME/.claude/plugins/marketplaces/$name/credentials" ] && echo "$name"
done
Each line of output is a valid client harness name. If no lines are output, fall through to the prompt below. For each candidate, read the human-friendly name from ~/.claude/plugins/marketplaces/<name>/.claude-plugin/marketplace.json → .name field, titlecased. If exactly one candidate, use it automatically. If multiple, ask which.
If none of A/B/C produces a repo, ask: "I couldn't detect a client repo. Are you running this from your master repo, from inside a client's harness repo, or on a machine with the harness installed?"
Passphrase input is handled by age natively — it opens /dev/tty directly and does not echo. Never ask for a passphrase as a chat message. Never include any passphrase value in tool output, responses, chain-of-thought, or subagent prompts. The passphrase never enters Claude's context.
Admin machines have gh authenticated — use gh repo clone so no token is embedded in a URL or echoed.
TMP_WORK=$(mktemp -d)
trap 'rm -rf "$TMP_WORK"' EXIT
gh repo clone "${CLIENT_REPO}" "$TMP_WORK/repo" -- --depth 1
If gh repo clone fails (e.g., gh not installed), fall back to:
git clone --depth 1 "https://github.com/${CLIENT_REPO}.git" "$TMP_WORK/repo"
(The credential helper configured by bootstrap will handle auth. Do NOT construct a token-in-URL string or echo any token value.)
If $TMP_WORK/repo/credentials/credentials.env.age exists, ask the user in chat:
I found an existing credentials file. Do you know the current passphrase?
- Yes — enter it now to load and review the current keys before editing
- No / Start fresh — replace the file with new credentials (existing keys will be lost)
If Yes: execute via Bash tool — age will prompt for the passphrase at the terminal (no echo):
age --decrypt -o "$TMP_WORK/credentials.env" "$TMP_WORK/repo/credentials/credentials.env.age"
Display the current keys, masking values but showing each value's length — a length that's exactly double what you'd expect is the tell-tale sign of a doubled paste (the 2026-06 AVOMA_API_KEY incident, where a 31-char key was stored as 62). Generate the list with this awk one-liner, which prints key names and lengths only, never values:
awk -F= '/^[A-Z_][A-Z0-9_]*=/{k=$1; v=$0; sub(/^[^=]*=/,"",v); print " "k" = **** ("length(v)" chars)"}' "$TMP_WORK/credentials.env"
Current keys:
TAVILY_API_KEY = **** (40 chars)
AVOMA_API_KEY = **** (31 chars)
If No / Start fresh: skip decryption, start with an empty credentials set. Tell the user: "Starting fresh — existing credentials will be replaced when you save."
If no existing file: start with an empty credentials set silently.
Ask the user which API keys they want to add or update. Have the admin paste this setkey helper once at the top of the same terminal session. It reads each value securely (no echo, not in chat, not in shell history), rejects an accidentally-doubled paste, and replaces any existing line for that key instead of appending a duplicate. It uses read -rs without -p — this works in both bash and zsh (-p in zsh means "read from coprocess", not "print prompt"):
setkey() {
local k="$1" v f="$TMP_WORK/credentials.env" L
printf "%s: " "$k" && read -rs v && echo
L=${#v}
if [ "$L" -eq 0 ]; then echo "✗ $k: empty, not saved"; return 1; fi
if [ $((L % 2)) -eq 0 ] && [ "${v:0:$((L/2))}" = "${v:$((L/2))}" ]; then
echo "⚠️ $k looks doubled ($L chars, first half == second half) — pasted twice? Not saved. Re-run and paste once."
return 1
fi
{ grep -v "^${k}=" "$f" 2>/dev/null; printf '%s=%s\n' "$k" "$v"; } > "$f.tmp" && mv "$f.tmp" "$f"
echo "✓ $k saved ($L chars)"
}
Then, for each key the admin names, give them a one-line block (one key at a time):
setkey TAVILY_API_KEY
Replace TAVILY_API_KEY with the actual key name. After each, ask "Any other keys? (say done when finished)".
Why setkey and not echo "KEY=$v" >> file: a bare append leaves TWO lines when you rotate a key that Step 2 already loaded (the old value plus the new one), which silently drifts the file; and a doubled paste (KEYKEY on one line) sails straight through. setkey strips any prior line for the key and refuses a value whose two halves are identical.
To remove a key that Step 2 loaded, drop it explicitly (omitting it is not enough once it's in the file):
grep -v '^KEYNAME=' "$TMP_WORK/credentials.env" > "$TMP_WORK/credentials.env.tmp" && mv "$TMP_WORK/credentials.env.tmp" "$TMP_WORK/credentials.env"
The final $TMP_WORK/credentials.env must never be printed or logged.
Run via Bash tool. age will prompt for the passphrase and confirmation at the terminal — no echo, never enters Claude's context. The admin picks the passphrase from their password manager and types it when prompted.
mkdir -p "$TMP_WORK/repo/credentials"
age --encrypt --passphrase -o "$TMP_WORK/repo/credentials/credentials.env.age" "$TMP_WORK/credentials.env"
The plaintext you collected in Step 3 is sitting at $TMP_WORK/credentials.env. Drop it at the canonical path so your own terminal sessions pick up the keys, and add the source stanza to your shell rc if it isn't already there.
ADMIN_CREDS_DIR="$HOME/.claude/credentials"
mkdir -p "$ADMIN_CREDS_DIR" && chmod 700 "$ADMIN_CREDS_DIR"
cp "$TMP_WORK/credentials.env" "$ADMIN_CREDS_DIR/credentials.env"
chmod 600 "$ADMIN_CREDS_DIR/credentials.env"
# Append source stanza idempotently. Marker matches bootstrap.sh exactly so a
# subsequent bootstrap re-run won't duplicate the line.
case "$(basename "${SHELL:-}")" in
zsh) RC_FILE="$HOME/.zshrc" ;;
bash) RC_FILE="$HOME/.bashrc" ;;
*) RC_FILE="$( [[ "$(uname -s)" == "Darwin" ]] && echo "$HOME/.zshrc" || echo "$HOME/.bashrc" )" ;;
esac
touch "$RC_FILE"
CREDS_MARKER="# Palisades-Labs claude-harness-installer: credentials source"
if ! grep -Fq "$CREDS_MARKER" "$RC_FILE"; then
{
printf '\n%s\n' "$CREDS_MARKER"
printf 'if [ -f "$HOME/.claude/credentials/credentials.env" ]; then\n'
printf ' set -a; source "$HOME/.claude/credentials/credentials.env"; set +a\n'
printf 'fi\n'
} >> "$RC_FILE"
fi
# Splice the harness CLAUDE.md into ~/.claude/CLAUDE.md so every Claude Code
# session sees the harness's orientation (3-layer architecture, directory
# structure, credentials canonical path, skill authoring) — same content
# bootstrap.sh splices for employees, done locally from the clone we already
# have. Marker matches bootstrap.sh exactly so a subsequent bootstrap re-run
# (or re-running this skill) replaces in-place rather than duplicating.
HOME_CLAUDE_SRC="$TMP_WORK/repo/CLAUDE.md"
HOME_CLAUDE_DST="$HOME/.claude/CLAUDE.md"
M_NAME="${CLIENT_REPO##*/}"
M_NAME="${M_NAME%-claude-harness}"
M_NAME="${M_NAME%-harness}"
BEGIN_MARKER="<!-- claude-harness orientation: $M_NAME (begin) -->"
END_MARKER="<!-- claude-harness orientation: $M_NAME (end) -->"
if [[ -f "$HOME_CLAUDE_SRC" ]]; then
mkdir -p "$(dirname "$HOME_CLAUDE_DST")"
touch "$HOME_CLAUDE_DST"
TMP_CLAUDE_MD="$(mktemp)"
if grep -Fq "$BEGIN_MARKER" "$HOME_CLAUDE_DST" 2>/dev/null; then
awk -v begin="$BEGIN_MARKER" -v end="$END_MARKER" -v src="$HOME_CLAUDE_SRC" '
$0 == begin { print; while ((getline line < src) > 0) print line; close(src); skip=1; next }
$0 == end { print; skip=0; next }
!skip { print }
' "$HOME_CLAUDE_DST" > "$TMP_CLAUDE_MD"
else
cp "$HOME_CLAUDE_DST" "$TMP_CLAUDE_MD"
if [[ -s "$TMP_CLAUDE_MD" ]] && [[ "$(tail -c1 "$TMP_CLAUDE_MD" | wc -l)" -eq 0 ]]; then
printf '\n' >> "$TMP_CLAUDE_MD"
fi
{
printf '\n%s\n' "$BEGIN_MARKER"
cat "$HOME_CLAUDE_SRC"
printf '%s\n' "$END_MARKER"
} >> "$TMP_CLAUDE_MD"
fi
mv "$TMP_CLAUDE_MD" "$HOME_CLAUDE_DST"
fi
After this step, opening a new terminal loads the API keys automatically AND every Claude Code session sees the harness's orientation block in ~/.claude/CLAUDE.md — no separate bootstrap step on yourself. The plaintext file lives at chmod 600 in your ~/.claude/credentials/ only; it is never logged, printed, or pushed to GitHub.
GITIGNORE="$TMP_WORK/repo/.gitignore"
if ! grep -Fq "credentials.env" "$GITIGNORE" 2>/dev/null; then
printf '\ncredentials.env\n' >> "$GITIGNORE"
fi
cd "$TMP_WORK/repo"
git add credentials/credentials.env.age .gitignore
git commit -m "chore: update credentials"
git push
Print this as the final output. DO NOT print the passphrase — admin already has it in their password manager.
Credentials updated and pushed to <CLIENT_REPO>/credentials/credentials.env.age.
Your own shell is now wired up. Open a new terminal to verify (e.g. `echo $TAVILY_API_KEY`).
For first-time setup, run `/client-admin:generate-installer` to emit the decrypt-only one-liner. Send the one-liner to employees, and share the passphrase separately through the team password manager.
If adding or rotating a key with the same passphrase, employees do not need a new passphrase. They do need to wait for Claude Desktop marketplace sync, re-run the same decrypt one-liner, enter the same passphrase, and open a new terminal. Marketplace sync fetches the updated encrypted `credentials.env.age`; the one-liner refreshes their local usable `~/.claude/credentials/credentials.env`.
If rotating the passphrase itself, re-run `/client-admin:generate-installer` after this skill and redistribute both the one-liner and the new passphrase; employees re-run the one-liner to decrypt under the new passphrase.
| Scenario | Behavior |
|---|---|
age not installed | Fail immediately: "age is not installed. Run: brew install age (Mac) or winget install FiloSottile.age (Windows)." |
| Wrong existing passphrase | age returns non-zero; fail with: "Wrong passphrase — the existing credentials file could not be decrypted." |
| Clone fails | Fail with: "Could not clone $CLIENT_REPO. Check that gh is authenticated and has repo access." |
| Push fails | Fail with git error; leave temp files for inspection. |
age — install via brew install age (Mac) or winget install FiloSottile.age (Windows)gitgh — authenticated as a user with write access to the client harness repo (gh auth status succeeds)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub palisades-labs/marketplace-admin --plugin client-admin2 skills in this plugin
Other plugins' skills for the same job