Project Archaeology
You've got an existing project with months or years of history. Can you build a decision graph retroactively? Absolutely—and it's one of the most valuable things you can do.
The Scenario
Picture this: You're joining a project that's been running for two years. There's code everywhere, scattered documentation, and that one engineer who knew everything just left. The codebase works, but why does it work this way?
Or maybe it's your own project. You built it six months ago. You made decisions. But now you look at the code and think: "Why did I use MongoDB here? Was there a reason?"
This is where archaeology comes in—building a decision graph by mining your existing history.
The One Root Approach
Unlike forward logging where you create many independent goals, archaeology typically flows from one origin point because you're reconstructing a single project's history.
┌─────────────────────┐
│ Project Origin │ Root goal
│ "Build Acme Corp" │
└──────────┬──────────┘
│
┌────────────────┼────────────────┐
▼ ▼ ▼
┌───────────┐ ┌───────────┐ ┌───────────┐
│ Auth │ │ Database │ │ API │ Major themes
│ System │ │ Choice │ │ Design │
└─────┬─────┘ └─────┬─────┘ └─────┬─────┘
│ │ │
┌─────┴─────┐ ┌─────┴─────┐ ┌─────┴─────┐
│ Options │ │ Options │ │ Options │ Branches of
│ Actions │ │ Actions │ │ Actions │ exploration
│ Outcomes │ │ Outcomes │ │ Outcomes │
└───────────┘ └───────────┘ └───────────┘
Step 1: Initialize and Set the Root
Watch how we establish the foundation for reconstructing a project's decision history:
cd ~/projects/acme-corp
deciduous init
deciduous add goal "Acme Corp Platform" -c 100 --prompt-stdin << 'EOF'
Original project goal: Build a B2B SaaS platform for inventory management.
Started January 2023. Team of 3 engineers initially.
Key constraints: Must integrate with existing ERP systems,
handle 10k concurrent users, SOC2 compliance required.
EOF
deciduous show 1
Capture everything you know about the project's original intent. Requirements, constraints, team size, timeline pressures. This context will inform everything that branches from it.
Step 2: Mine the Git Log for Major Themes
Your git history is a goldmine. Watch how we extract patterns:
git log --oneline --reverse | head -15
git branch -a | grep -E 'feature|release' | head -10
gh pr list --state merged --limit 20 --json title | jq '.[].title'
From this mining, we can identify major themes:
- Authentication — JWT tokens, OAuth2 overhaul
- Database — PostgreSQL, MongoDB migration
- Integrations — ERP sync, webhooks
- Architecture — Multi-tenancy, realtime, GraphQL
Step 3: Create Decision Points for Major Themes
Now we translate those themes into decision nodes:
deciduous add decision "Database architecture choice" -c 85
deciduous link 1 2 -r "Foundational infrastructure decision"
deciduous add option "MongoDB - document store" -c 70
deciduous add option "PostgreSQL - relational" -c 85
deciduous link 2 3 -r "Initially chosen for flexible schema"
deciduous link 2 4 -r "Better for complex queries, ACID compliance"
deciduous add action "Migrated from MongoDB to PostgreSQL" -c 90 \
--commit bcd7890 --date "2023-06-15"
deciduous link 2 5 --edge-type chosen \
-r "Complex reporting needs, transaction requirements"
Step 4: Mine Issues and PRs for Context
GitHub issues and PRs often contain the why that's missing from commits:
gh issue list --state all --search "database postgres mongodb" --limit 10
gh issue view 67 --json body,comments
deciduous add observation "MongoDB hit scaling limits on reporting" -c 90 \
--prompt-stdin << 'EOF'
From issue #67: Complex inventory reports took 30+ seconds.
MongoDB aggregation pipeline couldn't optimize the queries.
PostgreSQL POC with proper indexes showed 10x improvement.
Decision point: migrate or live with slow reports.
EOF
deciduous link 6 5 -r "This discovery triggered the migration decision"
Step 5: Trace Evolutionary Patterns
Projects evolve. Look for patterns where early decisions were revisited:
git log --oneline --all --grep="refactor\|migrate\|overhaul" | head -10
deciduous add decision "System architecture approach" -c 80
deciduous add option "Monolithic Rails app" -c 70
deciduous add option "Microservices" -c 75
deciduous add option "Event-driven architecture" -c 85
deciduous link 10 11 -r "V1: Fast to build, single deployment"
deciduous link 11 12 -r "V2: Auth extracted due to scaling needs"
deciduous link 12 13 -r "V3: Async processing for ERP integrations"
The Archaeology Checklist
A systematic approach to mining your project history:
| Source | What to Look For | Creates |
|---|---|---|
| Initial commits | Original tech stack, early architecture | decisions, options |
| Feature branches | Major initiatives and their scope | goals, actions |
| PR descriptions | Why changes were made | observations, rationales |
| Issues/tickets | Problems encountered, discussions | observations, context |
| Release notes | Major milestones | outcomes |
| README history | How the project description evolved | goal refinements |
| Dependency changes | Library swaps, version upgrades | decisions, actions |
A Real Example: Deciduous Itself
Watch archaeology in action on the deciduous project:
git log --oneline --reverse | head -10
deciduous add goal "Decision graph tooling for AI development" -c 95 \
--prompt-stdin << 'EOF'
Build a tool that captures decisions made during AI-assisted development.
Core problem: LLM context loss destroys institutional knowledge.
Solution: Persistent decision graph that survives sessions.
Must be: CLI-native, fast, integrates with Claude Code.
EOF
deciduous add decision "Data storage approach" -c 90
deciduous add option "Plain JSON files" -c 50
deciduous add option "SQLite with Diesel ORM" -c 90
deciduous link 1 2 -r "Foundation decision"
deciduous link 2 3 -r "Simple but no querying capability"
deciduous link 2 4 --edge-type chosen \
-r "Query support needed for /recover, branch filtering"
deciduous nodes
When to Do Archaeology
- Onboarding — New team member needs to understand why things are the way they are
- Major refactors — Before changing something, understand why it exists
- Documentation sprints — Convert tribal knowledge into queryable graph
- Post-mortems — Trace how decisions led to incidents
- Architecture reviews — See the full decision tree before adding more
Archaeology vs Forward Logging
| Aspect | Archaeology | Forward Logging |
|---|---|---|
| Root nodes | Usually one (the project) | Many (each feature/session) |
| Detail level | High-level themes | Granular steps |
| Prompts | Reconstructed from issues/PRs | Captured verbatim in real-time |
| Accuracy | Best-effort reconstruction | Ground truth |
| Time investment | One-time deep dive | Continuous small logs |
Most projects benefit from both: Do archaeology once to capture historical context, then switch to forward logging for all new work. The graph becomes a living document that spans your project's entire history.
Tips for Effective Archaeology
- Start with major themes, not details. Don't try to capture every commit. Focus on the big decisions first.
- Use commit hashes liberally. Link nodes to commits with
--commitfor traceability. - Backdate nodes to when decisions were made. Use
--date "2023-06-15"to place nodes at their historical point in time. Supports YYYY-MM-DD, YYYY-MM-DD HH:MM:SS, and RFC3339 formats. - Capture uncertainty. If you're not sure why something was done, say so:
-c 50for low confidence. - Interview people. If the original developers are available, ask them. Capture their answers as prompts.
- Don't over-connect. Some decisions are independent. Not everything needs to link to everything.