Skip to content
Security
Command

/init-user

Set up a user-level ~/.claude/CLAUDE.md with opt-in Bitwarden behavioral modules through a guided Q&A

BOOST
From plugin
ai-plugins
15910 skills4 agents10 commands1 MCP
Install
> /plugin marketplace add bitwarden/ai-plugins

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/init-user

Context preview

What this command does when you run it.

Set up a user-level ~/.claude/CLAUDE.md with opt-in Bitwarden behavioral modules through a guided Q&A

Command definition

init-user.md
description: Set up a user-level ~/.claude/CLAUDE.md with opt-in Bitwarden behavioral modules through a guided Q&A
allowed-tools: Read, Write, Edit, Bash(diff:*), Bash(cp:*), Bash(date:*), Bash(rm:*), Glob

Walk the user through a guided Q&A to assemble a user-level CLAUDE.md at `~/.claude/CLAUDE.md`. The file contains behavioral rules that apply to **every project and every conversation** Claude Code is launched in.

This represents one engineer's opinion on what belongs at the user scope. Modules are opt-in; the user picks which to include and is free to edit afterward.

Target

`~/.claude/CLAUDE.md` (resolve the `~` against the current user's home directory).

Module library

The plugin ships ten user-level modules under `${CLAUDE_PLUGIN_ROOT}/templates/user/`:

| Module file | One-line summary | | -------------------------- | -------------------------------------------- | | `intellectual-honesty.md` | Don't fake progress; surface uncertainty | | `think-before-coding.md` | State assumptions, surface tradeoffs | | `simplicity.md` | Minimum code that solves the problem | | `no-comments-default.md` | Comments only when the WHY is non-obvious | | `surgical-changes.md` | Touch only what you must | | `goal-driven-execution.md` | Define success criteria, loop until verified | | `verify-references.md` | Never hallucinate APIs or packages | | `security-baseline.md` | Sanitize inputs, never hardcode secrets | | `testing-discipline.md` | Test behavior, not implementation | | `code-review-lockdown.md` | PR mutations locked down; gh tools only |

Steps

1. **Detect existing file.** Read `~/.claude/CLAUDE.md`. If it exists, use `AskUserQuestion` to ask whether to:

  • **Merge** (add modules that aren't already present, leave existing content untouched)
  • **Replace** (back up and overwrite)
  • **Abort**

Default: Abort. If it doesn't exist, proceed straight to step 2.

2. **Module selection.** Use `AskUserQuestion` with `multiSelect: true` and the ten modules above as options. Each option's `description` should be the one-line summary from the table.

3. **Render preview.** For each selected module:

  • Read its file from `${CLAUDE_PLUGIN_ROOT}/templates/user/<slug>.md`.
  • If **Merge** mode, skip any module whose top-level `## Heading` is already present in the existing file.

Concatenate the selected module bodies in the order shown above, separated by a single blank line. Prepend this header (do NOT include the surrounding code fence):

   # CLAUDE.md

   <!-- Generated by bitwarden-init v{VERSION} on {YYYY-MM-DD}.
        This is a starting point assembled from opt-in modules — not a Bitwarden standard.
        Edit freely; remove what doesn't fit you; replace [YOUR-PREFERENCE] placeholders with your actual preferences. -->

Read the current plugin version from `${CLAUDE_PLUGIN_ROOT}/.claude-plugin/plugin.json` to substitute `{VERSION}`. Use today's date for `{YYYY-MM-DD}`.

4. **Diff + confirm.**

  • If the target file exists, write the rendered content to a temp file (e.g. `/tmp/claude-md-preview-$$.md`) and run `diff -u "$HOME/.claude/CLAUDE.md" /tmp/claude-md-preview-$$.md` via `Bash`. Display the diff to the user.
  • If the target does not yet exist, display the full rendered content.

Then use `AskUserQuestion` with options **Apply**, **Show diff again**, **Cancel**. On **Show diff again**, redisplay and ask again. On **Cancel**, stop without writing.

5. **Backup, then write.**

  • **If the target file already exists** (Merge or Replace path from step 1): copy it to `~/.claude/CLAUDE.md.bak-$(date -u +%Y%m%dT%H%M%SZ)` using `Bash` and capture the backup path. Then use `Edit` to update `~/.claude/CLAUDE.md` with the full rendered content. Fall back to `Write` only if `Edit`'s old-string match fails — which shouldn't happen since step 1 already Read the file.
  • **If the target file is new** (step 1 found nothing to read): use `Write` to create `~/.claude/CLAUDE.md` with the rendered content. `Edit` is not viable here because Edit requires a previously-Read file.
  • Clean up the temp preview file.

6. **Summary.** Report:

  • The target path written.
  • Which modules were included.
  • The backup file path (if any).
  • A reminder that `~/.claude/CLAUDE.md` is loaded into context on every Claude Code launch — and to revisit any `[YOUR-PREFERENCE]` placeholders before relying on it.

Notes

  • **Never write without an explicit Apply confirmation.** This file is global state.
  • **Never skip the backup step** when overwriting.
  • Preserve `[YOUR-PREFERENCE]` placeholders verbatim — they're intentional and signal opinion the user should make their own. Do not invent answers for them.
  • If the user runs this from outside their home directory, the target is still `~/.claude/CLAUDE.md` — don't substitute cwd.
Read more
Ships withai-plugins

A curated collection of plugins for AI-assisted development at Bitwarden. Enables discovery and distribution of quality-controlled plugins for use with Claude Code.

Get the whole plugin

Other commands on ai-plugins.