init

A command for setting up Self-Care, a project tool that collects and examines traces of an AI agent's work.

In plain words
What is it for?
Use it to connect a project to LangSmith or LangFuse, validate the relevant API key, and initialize the `.self-care/` directory.
Why use it?
It removes the manual setup needed to choose a trace service, check credentials, and create the project's local configuration.

Command

Install

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.

agentmods
npx agentmods add commands/not-diamond/self-care/init
Clone the repo
git clone --depth 1 https://github.com/Not-Diamond/self-care
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,817 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00010 $0.01817
Opus 5 $0.00005 $0.00908
Sonnet 5 $0.00002 $0.00363
Haiku 4.5 $0.00001 $0.00182

Measured 2d ago against content hash 4b1a706d58c7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

init 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 2d 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.

commands/init.md · 253 lines

How it starts

The opening of the file, as written. The whole thing — 253 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Self-Care Init

Set up Self-Care for this project. Configures the trace source (LangSmith or LangFuse), validates credentials, and creates the local directory structure.

Step 1: Determine Config Path

The config lives in the project-local .self-care/ directory:

CONFIG_PATH=".self-care/config.json"

Store CONFIG_PATH for use throughout.

Step 2: Check Existing Config

Read $CONFIG_PATH. If the file exists and contains valid JSON:

Output the current configuration:

Self-Care is already configured:
  Source: <source>
  Project: <project name if applicable>
  Initialized: <initialized_at>

Then ask via AskUserQuestion:

Would you like to reconfigure? (yes/no)

If "no": stop here. If "yes" or if no config exists: continue.

Step 3: Choose Trace Source

Ask via AskUserQuestion:

Where are your agent traces?

1. LangSmith
2. LangFuse

Store the choice as source.

Step 4: Validate Credentials

If source = LangSmith:

Check that LANGSMITH_API_KEY is set:

"${CLAUDE_PLUGIN_ROOT}/scripts/check-env.sh" LANGSMITH_API_KEY

If the output shows LANGSMITH_API_KEY=unset, output the following and stop:

✗ LANGSMITH_API_KEY not set.
  Add it to your .env file or export it in your shell:
  export LANGSMITH_API_KEY=lsv2_pt_...

If set, fetch available projects (source .env again since each Bash call is a fresh shell):

if [ -f .env ]; then set -a && source .env && set +a; fi
node "${CLAUDE_PLUGIN_ROOT}/lib/validate-creds.mjs" --source langsmith --list-projects

Parse the JSON output. The response contains { projects: [{ name, run_count }] }.

If the command exits non-zero, output the stderr message and stop.

If projects were fetched successfully, present them via AskUserQuestion as a numbered list:

Select your LangSmith project:

1. <project_name> (<run_count> traces)
2. <project_name> (<run_count> traces)
...

Include all fetched projects as numbered options. The user selects one.

Read the full file on GitHub · 253 lines

Changes

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.

  1. 2d ago First seen · 253 lines · 10 tokens per session scan A 4b1a706d58c7

Subscribe to this mod's changes

init is a command published in the GitHub repository Not-Diamond/self-care (28 stars, last pushed 4mo ago), licensed MIT. It adds 10 tokens to every session and 1,817 once invoked, about $0.0001 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-30.