Configure Lode's two-layer config: global user preferences and per-project identity.
Lode separates concerns between what's shared (knowledge vault path, reporting
preferences) and what's project-specific (project name, project slug). The global
config lives at ~/.lode/config.yaml; project identity lives at
{project-root}/.lode/config.yaml. The interview detects context and writes to the
appropriate target.
Goal
Create or update valid Lode configuration:
Global config (~/.lode/config.yaml):
knowledge_vaultprofile.report_languageprofile.weekly_modeprofile.team_contextartifact_index.enabledauto_capture.enabled
Project config ({project-root}/.lode/config.yaml, when CWD is a project repo):
project_slugprofile.project_name
Then register the project in {vault}/raw/projects.json.
If an existing config is present, preserve fields that are unrelated to this
interview, including daily_note, weekly_outline, monthly_review, and any
custom keys.
Step 0: Scope Detection — MUST Complete Before Step 1
CRITICAL: Step 0 is a mandatory gate. You MUST read both config files (if they exist) and check completeness BEFORE asking any questions. Do not skip to Step 1 until Step 0 is done.
Check the current working directory:
-
Is there a
.git/directory or.lode/directory in CWD or its parents?- Yes: This is a project setup. The interview will write project identity
to
{project-root}/.lode/config.yamland user preferences to~/.lode/config.yaml. - No: This is a global-preferences-only setup. Write everything to
~/.lode/config.yaml(backward-compatible single-project behavior).
- Yes: This is a project setup. The interview will write project identity
to
-
Read
~/.lode/config.yamlif it exists.- Global config is complete when ALL of these are present and non-empty:
knowledge_vault,profile.report_language,profile.weekly_mode,profile.team_context,artifact_index.enabled,auto_capture.enabled. - Partial: Some fields present. Interview only asks for the missing fields.
- Missing: No file exists. Full interview needed.
- Global config is complete when ALL of these are present and non-empty:
-
If CWD is a project (has
.git/or.lode/), read{project-root}/.lode/config.yamlif it exists.- Project config is complete when BOTH
project_slugandprofile.project_nameare present and non-empty. - Missing: Project identity not yet set. Interview only asks for these two fields (project_name, project_slug) — do NOT re-ask global questions.
- Project config is complete when BOTH
Early-Exit Gate
If global config is complete AND (CWD is not a project OR project config is also complete), STOP immediately. Reply with a brief status summary listing both config paths and their contents. Do not ask any questions. The setup is done.
If global config is complete but project config is missing (in a project), only ask project_name and project_slug. Do not ask knowledge_vault, report_language, weekly_mode, team_context, auto_capture questions — they are already set.
If global config is partial, only ask the specific fields that are missing. Do not re-ask fields that already have values.
Step 1: Interview
Ask for any missing values in one compact pass:
- Knowledge vault path: directory where Lode stores raw JSON and human-readable
reports. Expand
~and accept absolute paths. If the path does not exist, ask before creating it. Target: global config. - Project name: human-readable name for reports. Target: project config (or global config if no project context).
- Project slug: kebab-case identifier. Suggest a slug from the current repo directory or project name. Target: project config (or global config if no project context).
- Report language:
zh,en, ormixed. Target: global config. - Weekly mode:
techfor engineering narrative orreportfor manager-facing status. Target: global config. - Team context:
solo,team, ormixed. Target: global config. - Auto-capture: should
/lode:capturerun automatically at session end? Default: yes for configured vaults. Target: global config. Explain that this config is Lode's intent flag; Claude Code only runs it automatically when aStophook is present in~/.claude/settings.json.
Prefer sensible defaults over long discussion:
profile:
report_language: mixed
weekly_mode: tech
team_context: solo
Step 2: Write Config
Global config
Write to ~/.lode/config.yaml:
knowledge_vault: /absolute/path/to/knowledge-vault
profile:
report_language: mixed
weekly_mode: tech
team_context: solo
artifact_index:
enabled: true
auto_capture:
enabled: true
If an existing global config contains project_slug or profile.project_name,
preserve them — do not remove fields that single-project users may depend on.
Project config (when in a project)
Write to {project-root}/.lode/config.yaml:
project_slug: my-project
profile:
project_name: My Project
If the user wants to override a global preference for this project (e.g. different
report_language), include that override in the project config.
Write rules
- Keep YAML machine-readable and avoid prose comments in the written file.
- Normalize
project_slugto lowercase kebab-case. - Do not overwrite an existing
knowledge_vaultunless the user confirms. - Preserve unknown top-level keys and nested sections from existing configs.
- Never store secrets, credentials, or remote sync tokens.
Step 3: Check Auto-Capture Hook
If auto_capture.enabled is true after config resolution, check whether
~/.claude/settings.json exists and contains a hooks.Stop command hook that
runs /lode:capture.
Use this as the expected minimal hook shape:
{
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "/lode:capture"
}
]
}
]
}
}
Check only; do not write or modify ~/.claude/settings.json unless the user
explicitly asks for that. Preserve the distinction in the final report:
auto_capture.enabled: true+ hook present -> automatic capture is active.auto_capture.enabled: true+ hook missing -> Lode's auto-capture preference is enabled, but Claude Code will not trigger it until the Stop hook is added.auto_capture.enabled: false-> automatic capture is disabled; users can still run/lode:captureor say "收工".
If ~/.claude/settings.json is missing, report the path and the minimal hook
snippet. If it exists but has other hooks, tell the user to add the Lode command
under hooks.Stop without replacing unrelated hooks.
Step 4: Register Project
After writing config, register the project in the knowledge vault:
python <this-skill>/scripts/lode_raw.py register-project --cwd "$PWD"
If the helper is unavailable, manually write or update
{vault}/raw/projects.json following this shape:
[
{
"name": "My Project",
"slug": "my-project",
"path": "/absolute/path/to/project",
"priority": "core"
}
]
Use path-based dedup: if an entry with a matching path already exists, update it
in place rather than appending a duplicate.
After Setup
Report:
- The global config path and what was written there
- The project config path (if created) and what was written there
- The resolved vault path
- Auto-capture status: active, enabled-but-missing-hook, or disabled
- Confirmation that the project was registered in
projects.json
Then recommend the Tier 1 habit loop:
Lode is configured. From today on, only two actions are needed:
- At the end of each work session, say "收工" or run
/lode:capture- At the start of the next work session, run
/lode:recallAfter persisting for 1-2 weeks to accumulate data, the daily report (
/lode:daily), weekly report (/lode:weekly), and decision queries (/lode:query) will automatically become richer.
If auto-capture is enabled and the Stop hook is present, mention that ending a
Claude Code session can now trigger capture automatically. If the hook is
missing, say clearly that the config switch is on but automatic capture is not
active yet, and show the ~/.claude/settings.json path.
Also mention:
- Another project to set up: switch to that directory and run
/lode:cold-start-interviewagain
Keep the final response concise.