Deciduous
Persistent decision memory for AI coding assistants. When Claude's context compacts, your reasoning survives.
The Problem
Claude Code loses context. Sessions end. Memory compacts. Six months later, nobody remembers why you chose approach A over approach B. The decisions that shaped your codebase evaporate.
The Solution
Deciduous creates a persistent, queryable graph of every decision made during development. When a new Claude session starts—or when context compacts mid-session—Claude can query the graph to recover reasoning it never saw.
This isn't documentation written after the fact. It's a real-time record of how software gets built, captured as decisions happen.
Quick Start
1. Install
2. Initialize in your project
This creates:
.deciduous/deciduous.db— SQLite database for the graph.claude/commands/— Slash commands for Claude Code.windsurf/rules/— Rules for Windsurf/Cascadedocs/— Static web viewer (deployable to GitHub Pages)CLAUDE.md— Project instructions with the logging workflow
3. Start using with Claude
Tell Claude to use the decision graph, or just start working—the CLAUDE.md instructions will guide it.
What It Does
For context compaction:
- Claude logs decisions to a SQLite database as it works
- When context compacts, the graph survives
- New sessions run
/contextto query past decisions - Claude picks up where it left off, with full reasoning intact
For long-term decision tracking:
- Every goal, decision, action, and outcome is timestamped and linked
- Confidence scores (0-100) show certainty at decision time
- Edge types capture relationships:
chosen,rejected,requires,blocks - The graph is queryable: "What did we decide about auth?" "Why did we reject Redux?"
For multi-user collaboration:
- Export decision patches to share with teammates
- Import patches from others (idempotent—safe to apply multiple times)
- Each node has a globally unique ID for conflict-free merging
For PR generation:
- Generate decision graph visualizations for PRs
- Auto-generate writeups from the graph
- Show reviewers why you made the choices you made
Usage Flow
Session Start
Claude runs /context to recover past decisions:
> /context
Current branch: feature/auth
Decision graph shows:
- Goal #12: "Add user authentication" (confidence: 90)
└─> Decision #13: "Choose auth method" (confidence: 75)
├─> Option #14: "JWT tokens" (chosen)
└─> Option #15: "Session cookies" (rejected: "stateless preferred")
Last action: #18 "Implementing JWT refresh flow"
Status: in_progress
During Work
Claude logs decisions in real-time:
# Starting a new feature
# Making a choice
# Implementing
# Recording outcome
Before Push
PR Time
# Generate branch-specific visualization
# Generate PR writeup
Multi-User Sync
Share decisions across team members working on the same codebase.
The Problem
Each user has a local .deciduous/deciduous.db (gitignored). How do you share decisions?
The Solution
Export/import patches using globally unique change IDs (inspired by jj/Jujutsu):
# Export your branch's decisions
# Apply patches from teammates (idempotent)
# Preview before applying
# Check available patches
PR Workflow
- Create nodes while working
- Export:
deciduous diff export --branch my-feature -o .deciduous/patches/my-feature.json - Commit the patch file (NOT the database)
- Open PR with patch file included
- Teammates apply:
deciduous diff apply .deciduous/patches/my-feature.json
Same patch applied twice = no duplicates.
Viewing the Graph
Terminal UI (TUI)
A rich, vim-style terminal interface for browsing your decision graph.
Navigation:
| Key | Action |
|---|---|
j/k |
Move down/up in timeline |
gg |
Jump to top |
G |
Jump to bottom |
Ctrl+d/Ctrl+u |
Page down/up |
Enter |
Toggle detail panel |
q |
Quit |
Filtering & Search:
| Key | Action |
|---|---|
/ |
Search by title/description |
f |
Cycle through type filters |
b |
Cycle through branch filters |
B |
Fuzzy branch search |
R |
Toggle timeline order (newest/oldest first) |
Ctrl+c |
Clear all filters |
File Operations:
| Key | Action |
|---|---|
o |
Open associated files in editor |
O |
View commit details (split modal with diff) |
F |
Toggle file browser in detail panel |
n/N |
Next/previous file (when in file browser) |
p |
Preview file content with syntax highlighting |
d |
Show file diff with syntax highlighting |
Other:
| Key | Action |
|---|---|
s |
Show goal story (hierarchy view) |
r |
Refresh graph from database |
? |
Show help |
The TUI includes syntax highlighting for file previews and diffs, using the same highlighting engine as bat.
Web Viewer
Or deploy to GitHub Pages (workflow included with deciduous init).
Four visualization modes:
| View | Purpose |
|---|---|
| Chains | Decision chains with flow visualization |
| Timeline | Chronological view of all nodes |
| Graph | Force-directed interactive graph |
| DAG | Hierarchical directed acyclic graph |
CLI Queries
Node Types
| Type | Purpose | Example |
|---|---|---|
goal |
High-level objective | "Add user authentication" |
decision |
Choice point | "Choose auth method" |
option |
Approach considered | "Use JWT tokens" |
action |
Implementation step | "Added JWT middleware" |
outcome |
Result | "Auth working in prod" |
observation |
Discovery or insight | "Existing code uses sessions" |
Edge Types
| Type | Meaning |
|---|---|
leads_to |
Natural progression |
chosen |
Selected this option |
rejected |
Did not select (include reason) |
requires |
Dependency |
blocks |
Preventing progress |
enables |
Makes something possible |
Confidence Scores
| Range | Meaning |
|---|---|
| 90-100 | Certain, proven, tested |
| 70-89 | High confidence, standard approach |
| 50-69 | Moderate, some unknowns |
| 30-49 | Experimental, might change |
| 0-29 | Speculative, likely to revisit |
Commands Reference
# Initialize
# Add nodes
# Optional metadata
# Connect nodes
# Query
# Multi-user sync
# Visualize
# Export
Branch-Based Grouping
Nodes are automatically tagged with the current git branch.
Configuration (.deciduous/config.toml):
[]
= ["main", "master"]
= true
Usage:
The web UI has a branch dropdown filter in the stats bar.
GitHub Pages Deployment
deciduous init creates a GitHub workflow that:
- Deploys your graph viewer to GitHub Pages on push
- Cleans up branch-specific PNGs after PR merge
Enable Pages: Settings > Pages > Source > Deploy from branch > gh-pages
Your graph will be live at https://<username>.github.io/<repo>/
Live Example
See a real decision graph: deciduous_example
This shows 50+ decision nodes tracking a complete project with goals flowing through decisions to outcomes.
Building from Source
Optional dependency: graphviz (for --png flag)
Why "Deciduous"?
Deciduous trees shed their leaves seasonally but their structure persists. Like Claude's context, the leaves (working memory) fall away—but the decision graph (trunk and branches) remains, ready to support new growth.
License
MIT