In-Context Learning
In-Context Learning is SuperSpec's solution for maintaining context across AI sessions.
The Problem
AI coding assistants don't remember previous sessions:
Session 1: Implemented user authentication
Session 2: AI doesn't know what happened in Session 1
Session 3: Repeat explanations...This leads to:
- Repeated context setup
- Inconsistent decisions
- Wasted time
The Solution
SuperSpec's sync and resume commands preserve context:
bash
# End of session - save context
superspec sync
# Start of new session - restore context
/ss-resumeHow It Works
Sync Command
superspec sync creates context.md containing:
markdown
# Context
## Current Change
- Name: userAuth
- Mode: boost
- Status: in_progress
## Git Status
- Modified: src/auth/login.ts
- Added: src/auth/register.ts
## Recent Commits
- feat(auth): add login endpoint
- feat(auth): add user model
## Pending Tasks
- [ ] 4. Add password reset
- [ ] 5. Add email verificationResume Command
/ss-resume tells the AI to read context.md and continue where you left off.
Usage
Saving Context
Before ending your session:
bash
superspec syncOr in AI chat:
/ss-syncRestoring Context
Starting a new session:
/ss-resumeThe AI will:
- Read
context.md - Understand current state
- Continue with pending tasks
Best Practices
Sync Frequently
bash
# After significant progress
superspec sync
# Before taking a break
superspec sync
# Before switching to another task
superspec syncClean Context
Keep context focused:
bash
# Complete finished changes
superspec archive completedFeature
# Then sync
superspec syncVerify Resume
After /ss-resume, verify the AI understands:
/ss-resume
> AI: I see we're working on userAuth.
> We've completed tasks 1-3 and are on task 4 (password reset).
> Should I continue with the implementation?
You: Yes, please continue.Context.md Structure
markdown
# Context
## Active Change
Current work focus and status.
## Git Status
Uncommitted changes showing work in progress.
## Recent Activity
What was recently completed.
## Next Steps
What to do next.Troubleshooting
Context Too Large
If context.md becomes too large:
- Archive completed changes
- Commit work in progress
- Re-run
superspec sync
Outdated Context
If context is stale:
bash
# Regenerate context
superspec sync --forceAI Doesn't Understand
If the AI misinterprets context:
The context shows we're working on userAuth,
specifically task 4 about password reset.
Please continue from there.Next Steps
- Best Practices - Efficiency tips
- CLI Reference - sync command details