chronicle-context-retriever
Search and retrieve context from past development sessions using Chronicle data. Works with MCP (fast, structured) or CLI commands (portable). Use when user asks about previous work, wants to recall past decisions, needs to understand codebase history, or wants to avoid repeating past approaches.
Best use case
chronicle-context-retriever is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Search and retrieve context from past development sessions using Chronicle data. Works with MCP (fast, structured) or CLI commands (portable). Use when user asks about previous work, wants to recall past decisions, needs to understand codebase history, or wants to avoid repeating past approaches.
Search and retrieve context from past development sessions using Chronicle data. Works with MCP (fast, structured) or CLI commands (portable). Use when user asks about previous work, wants to recall past decisions, needs to understand codebase history, or wants to avoid repeating past approaches.
Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.
Practical example
Example input
Use the "chronicle-context-retriever" skill to help with this workflow task. Context: Search and retrieve context from past development sessions using Chronicle data. Works with MCP (fast, structured) or CLI commands (portable). Use when user asks about previous work, wants to recall past decisions, needs to understand codebase history, or wants to avoid repeating past approaches.
Example output
A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.
When to use this skill
- Use this skill when you want a reusable workflow rather than writing the same prompt again and again.
When not to use this skill
- Do not use this when you only need a one-off answer and do not need a reusable workflow.
- Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/chronicle-context-retriever/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How chronicle-context-retriever Compares
| Feature / Agent | chronicle-context-retriever | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Search and retrieve context from past development sessions using Chronicle data. Works with MCP (fast, structured) or CLI commands (portable). Use when user asks about previous work, wants to recall past decisions, needs to understand codebase history, or wants to avoid repeating past approaches.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# Chronicle Context Retriever
This skill helps you search and retrieve context from past development sessions using Chronicle's database. Works with both MCP server (fast, structured JSON) or CLI commands (portable, everywhere).
## Auto-Activation
> **This skill auto-activates!** (Milestone #13)
>
> Prompts like "how did I implement auth?" or "what did I do yesterday?" automatically trigger this skill. No manual loading needed!
>
> **Trigger patterns:** how did I, what did I do, find sessions about, search past work
> **See:** `docs/HOOKS.md` for full details
## When to Use This Skill
Use this skill when:
- User asks "what did I do yesterday/last week?"
- Need to recall how a feature was implemented
- Want to understand why a decision was made
- Looking for similar past work or patterns
- Avoiding repeating past mistakes or approaches
- Need context before starting related work
## How It Works
**Option 1: With MCP (Preferred)**
1. **Parse User Query** - Understand what context is needed
2. **Search Chronicle** - `mcp__chronicle__search_sessions()` returns structured JSON (fast!)
3. **Get Details** - `mcp__chronicle__get_session_summary()` for full summaries
4. **Extract Information** - Parse JSON for decisions, blockers, solutions
5. **Present Context** - Summarize findings with session IDs
**Option 2: With CLI (Portable)**
1. **Parse User Query** - Understand what context is needed
2. **Search Chronicle** - `chronicle search "keywords"` returns formatted output
3. **Get Details** - `chronicle session <id>` for full summaries
4. **Extract Information** - Parse CLI output for key details
5. **Present Context** - Summarize findings with session IDs
**Decision Tree:**
```
Search past work
├─ MCP available? → Use mcp__chronicle__search_sessions() for fast JSON
└─ CLI only? → Use `chronicle search` and parse output
```
## Search Strategies
### ⭐ Two-Phase Search Workflow (RECOMMENDED)
The most effective way to search Chronicle is using a two-phase approach:
**Phase 1: Broad Discovery**
- Use OR search (implicit or explicit) to cast a wide net
- Find the relevant area/timeframe
- Get 5-10 potential sessions
**Phase 2: Deep Dive**
- Review session summaries to identify most relevant ones
- Use precise AND searches to narrow down
- Extract specific information needed
**Example workflow:**
```python
# Phase 1: Broad OR search (multiple words = implicit OR)
results = mcp__chronicle__search_sessions(query="hooks json output", limit=10)
# → Returns sessions 108, 109, 110, 111, 112 (any word matches)
# Review the results - which sessions look most relevant?
# Get full summaries for promising sessions
summaries = mcp__chronicle__get_sessions_summaries(session_ids=[110, 111, 112])
# Phase 2: After reading summaries, dig deeper with AND
# Now you know the exact terms to search for
precise_results = mcp__chronicle__search_sessions(
query="hookSpecificOutput AND decision/reason/systemMessage",
limit=5
)
# → Returns only sessions with BOTH terms (precise match)
```
**Why this works:**
- ✅ Phase 1 finds the general area (prevents missing relevant sessions)
- ✅ Phase 2 finds exact solutions (prevents information overload)
- ✅ 2-3 searches total vs 10+ narrow searches that might miss context
- ✅ ROI: 1-2 minutes to find exact solution vs 10-20 minutes reinventing
### By Topic/Keywords
**With MCP:**
```python
# Search session summaries and prompts for keywords
mcp__chronicle__search_sessions(query="authentication", limit=10)
mcp__chronicle__search_sessions(query="database migration", limit=5)
```
**With CLI:**
```bash
# Search sessions
chronicle search "authentication" --limit 10
chronicle search "database migration" --limit 5
```
### By Time Period
**With MCP:**
```python
# Get sessions from specific time periods
mcp__chronicle__get_sessions(days=7, limit=20) # Last week
mcp__chronicle__get_timeline(days=1) # Yesterday with commits
```
**With CLI:**
```bash
# View recent sessions
chronicle sessions --days 7 --limit 20
chronicle timeline yesterday # Yesterday with commits
```
### By Repository
**With MCP:**
```python
# Filter sessions by repository path
mcp__chronicle__get_sessions(repo_path="/Users/.../my-app", limit=20)
```
**With CLI:**
```bash
# Sessions command supports repo filtering via config
chronicle sessions --limit 20 # Defaults to current repo
```
### By Tool
**With MCP:**
```python
# Filter by AI tool used
mcp__chronicle__get_sessions(tool="claude-code", limit=10)
mcp__chronicle__get_sessions(tool="gemini-cli", limit=10)
```
**With CLI:**
```bash
# Filter by tool
chronicle sessions --tool claude-code --limit 10
chronicle sessions --tool gemini-cli --limit 10
```
## Example Queries
### "How did I implement authentication last time?"
**With MCP:**
```python
# Search for authentication-related sessions
sessions = mcp__chronicle__search_sessions(query="authentication", limit=5)
# Get full details of relevant sessions
for session in sessions:
details = mcp__chronicle__get_session_summary(session_id=session["id"])
# Extract implementation approach and decisions
```
**With CLI:**
```bash
# Search for authentication work
chronicle search "authentication" --limit 5
# View specific session details
chronicle session <id>
# Parse output for approach and decisions
```
### "What was the blocker we hit with the database migration?"
**With MCP:**
```python
# Search for database migration issues
sessions = mcp__chronicle__search_sessions(query="database migration blocker", limit=5)
# Find relevant session and extract problem + solution
```
**With CLI:**
```bash
# Search for migration blockers
chronicle search "database migration blocker" --limit 5
# View session with blocker
chronicle session <id>
```
### "Show me all work on the user-dashboard feature"
**With MCP:**
```python
# Search for user-dashboard work
sessions = mcp__chronicle__search_sessions(query="user-dashboard", limit=10)
# List chronological sessions and summarize progress
```
**With CLI:**
```bash
# Search for dashboard work
chronicle search "user-dashboard" --limit 10
# View sessions chronologically
chronicle sessions --limit 10
```
## Response Format
When retrieving context, structure the response like:
```markdown
## Context from Past Sessions
### Session {id} - {date}
**What was done:** {summary}
**Key decision:** {decision and rationale}
**Outcome:** {result}
**Related:** [[Session-{id}]]
### Session {id} - {date}
...
## Relevant for Current Work
- {How this context applies}
- {What to keep in mind}
- {What to avoid based on past experience}
```
## Tools to Use (MCP or CLI)
### Chronicle Database Operations
**MCP Approach (Preferred):**
- `mcp__chronicle__search_sessions` - Search session summaries and prompts (fast JSON)
- `mcp__chronicle__get_session_summary` - Get full summary for specific session
- `mcp__chronicle__get_sessions` - List sessions with filters (tool, repo, days)
- `mcp__chronicle__get_timeline` - Get sessions + commits for time period
- `mcp__chronicle__search_commits` - Search git commit messages
- `mcp__chronicle__get_commits` - List commits with filters
**CLI Alternatives (Portable):**
- `chronicle search "query"` - Search sessions by keywords
- `chronicle session <id>` - Get full session summary
- `chronicle sessions --limit 10` - List recent sessions
- `chronicle timeline today` - View sessions + commits
- `chronicle search "commit message"` - Search commits
- `chronicle show today` - List recent commits
### Obsidian Vault Operations (Optional)
**Only if user wants vault notes:**
- `mcp__obsidian__search_notes` - Find documented sessions in vault
- `mcp__obsidian__read_note` - Read Obsidian note for session
## Tips
- **Chronicle database first!** - Faster than Obsidian vault search
- **MCP when available** - Structured JSON is easier to parse than CLI output
- **CLI works everywhere** - Use as reliable fallback when MCP not configured
- Always search broadly first, then narrow down with specific session IDs
- Check multiple related sessions for patterns
- Look at both successful and blocked approaches
- Note dates and repositories to understand context evolution
- Combine timeline views to see commits + sessions together
- When using CLI, parse output carefully for session IDs and summariesRelated Skills
json-to-llm-context
Turn JSON or PostgreSQL jsonb payloads into compact readable context for LLMs. Use when a user wants to compress JSON, reduce token usage, summarize API responses, or convert structured data into model-friendly text without dumping raw paths.
opencontext
Persistent memory and context management for AI agents using OpenContext. Keep context across sessions/repos/dates, store conclusions, and provide document search workflows.
hig-project-context
Create or update a shared Apple design context document that other HIG skills use to tailor guidance. Use when the user says 'set up my project context,' 'what platforms am I targeting,' 'configure HIG settings,' or when starting a new Apple platform project.
ddd-context-mapping
Map relationships between bounded contexts and define integration contracts using DDD context mapping patterns.
context7-auto-research
Automatically fetch latest library/framework documentation for Claude Code via Context7 API
context-window-management
Strategies for managing LLM context windows including summarization, trimming, routing, and avoiding context rot Use when: context window, token limit, context management, context engineering, long context.
context-manager
Elite AI context engineering specialist mastering dynamic context management, vector databases, knowledge graphs, and intelligent memory systems. Orchestrates context across multi-agent workflows, enterprise AI systems, and long-running projects with 2024/2025 best practices. Use PROACTIVELY for complex AI orchestration.
context-management-context-save
Use when working with context management context save
context-management-context-restore
Use when working with context management context restore
context-driven-development
Use this skill when working with Conductor's context-driven development methodology, managing project context artifacts, or understanding the relationship between product.md, tech-stack.md, and workflow.md files.
code-refactoring-context-restore
Use when working with code refactoring context restore
c4-context
Expert C4 Context-level documentation specialist. Creates high-level system context diagrams, documents personas, user journeys, system features, and external dependencies. Synthesizes container and component documentation with system documentation to create comprehensive context-level architecture. Use when creating the highest-level C4 system context documentation.