# Init

> Discover an Obsidian vault or validate a user-provided local directory, confirm the choice, save Chronicle configuration, and initialize its local Markdown layout. Use when Chronicle is first installed, a SessionStart reports that setup is required, the vault moved, configuration is invalid, or the user asks to set up or reconfigure Chronicle.

- Skill: `r-jelly/init` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add r-jelly/init`
- Raw SKILL.md: https://api.skillmd.com/api/skills/r-jelly/init/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: r-jelly (https://skillmd.com/u/r-jelly)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/r-jelly/init

---


# Initialize Chronicle

Set up Chronicle through a short, explicit confirmation flow. Never silently
choose a vault or crawl the user's entire home directory.

## Resolve Chronicle

Let `<plugin-root>` be `${CLAUDE_PLUGIN_ROOT}` when Claude Code supplies it;
otherwise use the directory two levels above this `SKILL.md`. Run:

```bash
python3 "<plugin-root>/scripts/chronicle.py" <command>
```

## Discover

Run:

```bash
python3 "<plugin-root>/scripts/chronicle.py" discover-vaults --cwd "$PWD"
```

The command only checks existing Chronicle and legacy TIL settings, the nearest
`.obsidian` ancestor, the macOS Obsidian registry, and common vault locations.
Treat its JSON as candidate data, not permission to write.
If it returns `warnings`, explain them briefly and continue with valid
candidates so the user can repair a broken configuration.

## Confirm

Match the user's language and ask one question at a time.

- If a valid configured path exists, show it and ask whether to keep it or
  choose another path.
- If only a valid `legacy TIL config` exists, explain that confirmation copies
  its vault path into the common Chronicle config and leaves the legacy file
  untouched for backward compatibility.
- If one candidate exists, recommend it and ask for confirmation.
- If multiple candidates exist, show a numbered list with each path and source,
  then ask the user to select one.
- If none exists, ask for an absolute or home-relative path. Chronicle supports
  any existing local directory, even without `.obsidian`.
- If the selected directory does not exist, stop and ask for a valid path.
- Before writing, state that Chronicle will save its common config and create
  `<vault>/chronicle/`. It will not move, delete, commit, or push vault content,
  and it will leave `<vault>/til/` unchanged.

Do not accept a candidate solely because it is first in the list. Do not create
a missing vault directory on the user's behalf.

## Initialize

Only after confirmation, run:

```bash
python3 "<plugin-root>/scripts/chronicle.py" init \
  --vault "<confirmed-vault>" \
  --save-config
```

Require `"initialized": true`, `"config_saved": true`, and an existing
`chronicle_root` in the JSON result. If any check fails, report the error and do
not claim setup completed.

## Report

Show the confirmed vault, Chronicle data directory, local `state_root`, and
config location (`CHRONICLE_CONFIG` when set, otherwise
`~/.config/chronicle/config.json`). Explain that Markdown is stored in the
vault while transient queues stay in local state, separated by computer, vault,
and agent. Future sessions use this setting automatically, and `init` can be
run again to change it.

