A passive second brain for coding sessions. Sediment hooks into Claude Code and Pi to automatically distill decisions, patterns, gotchas, context, and progress into an Obsidian vault.
You don't change your workflow. Sediment captures knowledge in the background while you code.
Three layers:
- Capture — hooks (Claude Code) and extensions (Pi) trigger the session's own agent to distill what happened.
- Structure — a shared
sediment-writerskill teaches the agent vault conventions, note formats, and tagging. - Retrieval — at session start, relevant past notes are injected into the agent's context.
No external API calls. The agent doing your coding work is the same one writing the notes.
- Node.js and npm
- git
- jq
- Obsidian (download) — for viewing your vault
- Obsidian CLI — enable in Obsidian under Settings → General → Command line interface (requires Obsidian 1.12+ installer)
- Claude Code and/or Pi — at least one must be installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/davegomez/sediment/main/install.sh)"Or clone and run manually:
git clone https://github.com/davegomez/sediment.git
cd sediment
./install.shThe installer will:
- Check prerequisites
- Detect which harnesses you have (Claude Code, Pi, or both)
- Ask for global or per-project install scope
- Auto-detect Obsidian vaults or create a new one
- Install CLI tools (
defuddle-cli) - Install Obsidian skills from kepano/obsidian-skills
- Install the
sediment-writerskill - Set up hooks (Claude Code) and/or extensions (Pi)
- Seed the vault with folders, templates, and MOC views
Run the same command again:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/davegomez/sediment/main/install.sh)"The installer detects the existing installation, skips all prompts, and refreshes skills, hooks, scripts, and extensions from the latest source. The version is updated in the config.
| Component | Global location | Project location |
|---|---|---|
| Claude Code hooks | ~/.claude/settings.json |
.claude/settings.json |
| Claude Code skills | ~/.claude/skills/ |
.claude/skills/ |
| Pi extension | ~/.pi/agent/extensions/sediment/ |
.pi/extensions/sediment/ |
| Pi skills | ~/.pi/agent/skills/ |
.pi/skills/ |
| Scripts | ~/.sediment/scripts/ |
~/.sediment/scripts/ |
| Config | ~/.sediment/config.json |
~/.sediment/config.json |
YourVault/
├── 00-Inbox/ ← All automated captures land here
├── 01-Decisions/ ← Promoted ADRs
├── 02-Patterns/ ← Promoted reusable patterns
├── 03-Reference/ ← Promoted context & gotchas
├── 04-Archive/ ← Decayed or superseded notes
├── 05-MOCs/ ← Maps of Content (.base views)
├── _templates/ ← Note templates
└── _attachments/ ← Binary files
Folders represent lifecycle stage, not topic. Tags and frontmatter handle topical organization.
| Type | What it captures | Default confidence |
|---|---|---|
| Decision | Technology or design choice with reasoning, alternatives, consequences | 0.9 |
| Pattern | Reusable technique — what it is, when to use it, trade-offs | 0.85 |
| Gotcha | Surprising problem — what went wrong, root cause, solution | 0.9 |
| Context | Domain/project background — key facts and implications | 0.7 |
| Progress | Session milestone — what was accomplished, next steps | 0.6 |
Notes use Zettelkasten-style naming: YYYYMMDDHHmm-slugified-title.md
A Stop hook fires at the end of each session. It blocks the agent from stopping and asks it to follow the sediment-writer skill. The agent evaluates the session, writes any notes worth capturing, then stops. A stop_hook_active flag prevents infinite loops.
A PreCompact hook runs before /compact or auto-compaction, placing a marker that the Stop hook picks up. When distillation eventually fires, the instruction tells Claude to pay extra attention to the compaction summary so knowledge from the compressed portion isn't overlooked.
Pi uses deferred distillation and inline distillation depending on the trigger:
- Session end —
session_shutdownwrites a marker file. At the start of the next session, the extension detects the marker and sends a message asking the agent to distill the previous session. - Compaction —
session_compacttriggers inline distillation immediately after/compactor auto-compaction, while the compaction summary is still fresh. - New session —
session_before_switchsaves a marker before/new, andsession_switchtriggers distillation at the start of the new session.
| Claude Code | Pi | |
|---|---|---|
| Session end | Stop hook (blocks) | Deferred to next session start |
| Compaction | PreCompact marker → Stop hook notes it | Inline distillation via sendUserMessage |
| New session | N/A | Marker saved before switch, distilled after |
At session start, a script scans the vault for notes matching the current project (by source_project frontmatter or project/ tag). Recent high-confidence notes from other projects are included for cross-pollination. The result is injected into the agent's system prompt.
Example context injection:
[Sediment] Relevant notes from your vault:
DECISIONS:
- [[chose-postgresql-over-mongodb]]: PostgreSQL with JSONB for user data (3 days ago)
GOTCHAS:
- [[prisma-json-field-typing]]: Prisma requires JsonValue cast for JSONB (1 day ago)
Not every note stays relevant forever. A decay script runs at session start:
| Note type | Decays after | Scope |
|---|---|---|
| Progress | 7 days | 00-Inbox/ only |
| Context | 30 days | 00-Inbox/ only |
| Decision, Pattern, Gotcha | Never | — |
Decay replaces the status/unreviewed tag with status/decayed. No files are moved or deleted. Promoted notes (in 01–03) are permanent — only inbox notes decay.
Notes arrive in 00-Inbox/ with status/unreviewed. To review:
- Open the Inbox base view in
05-MOCs/Inbox.base - Read each note — verify accuracy, fix details
- Change
status/unreviewedtostatus/reviewed - Move the note to the appropriate folder:
- Decisions →
01-Decisions/ - Patterns →
02-Patterns/ - Gotchas, Context →
03-Reference/
- Decisions →
The 05-MOCs/ folder contains Obsidian Bases views (no plugins required):
- Inbox.base — unreviewed notes grouped by type
- Decisions.base — all decisions grouped by project
- Patterns.base — all patterns
- Gotchas.base — all gotchas
- Context.base — context notes with decay status
- Progress.base — progress notes with decay status
- By-Project.base — all active notes grouped by project
- Recent-Activity.base — last 30 notes
~/.sediment/uninstall.shThis removes hooks, extensions, skills, and ~/.sediment/. Your vault is left untouched. The defuddle-cli tool is left installed.
AGPL-3.0-or-later