Repository navigation
Closed as not planned
Closed as not planned
Copy link
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Problem Description
Currently, OpenCode's todo list (managed via the TodoWrite tool) is stored only in memory and is associated with individual sessions. When a session reaches its context limit and a new session is created, all todo tasks from the previous session are lost.
This is a significant issue for long-running development tasks because:
- Context Limits: Large projects or complex tasks often exceed the context window limit
- Lost Progress: When starting a new session, the agent loses track of pending tasks
- Reduced Productivity: Users must manually reconstruct the todo list from memory or conversation history
- Poor UX: Users expect their task tracking to persist across sessions, similar to how project management tools work
Proposed Solution
Implement persistent todo list storage that survives session boundaries. The todo list should:
- Persist to Disk: Save todo tasks to a project-local file (e.g.,
.opencode/todo.json) - Load on Session Start: Automatically load existing todos when creating a new session
- Sync with Sessions: Keep todos in sync across multiple sessions working on the same project
- Optional Configuration: Allow users to disable persistence if desired (via
opencode.json)
Implementation Suggestions
File Format
{
"version": "1.0",
"todos": [
{
"id": "uuid",
"content": "Task description",
"status": "pending|in_progress|completed",
"priority": "high|medium|low",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z",
"sessionId": "optional-session-id"
}
]
}Configuration Options
{
"todo": {
"enabled": true,
"persistence": true,
"filePath": ".opencode/todo.json",
"autoSave": true
}
}Behavior
- When a todo is created/updated: Automatically save to the persistence file
- When a new session starts: Load todos from the file (if it exists)
- When sessions end: Ensure all pending todos are saved
- Multi-session support: Multiple sessions can read/write to the same todo file (with proper locking)
- Git integration: Consider adding
.opencode/todo.jsonto.gitignoreby default (or make it configurable)
Benefits
- Continuity: Maintain task continuity across sessions
- Better UX: Users don't lose their task tracking when hitting context limits
- Collaboration: Multiple developers/agents can share the same todo list (if committed to git)
- Flexibility: Users can inspect/edit the todo file manually if needed
- Backward Compatible: Can be implemented as an opt-in feature initially
Use Cases
- Large Refactoring: Breaking down a large refactoring into multiple sessions
- Multi-day Development: Continuing work after stopping/restarting OpenCode
- Context Management: When a session gets too long, start fresh without losing task context
- Team Collaboration: If todos are committed to git, team members can see what's in progress
Related Documentation
- Server API:
GET /session/:id/todo(currently in-memory) - SDK:
@opencode-ai/sdkcould expose methods for todo persistence - Configuration: Extend
opencode.jsonschema
This feature would significantly improve the developer experience when working on complex, long-running tasks that exceed single-session context limits.
Reacted by Mathew Heard, Axel H. and Felipe Zambrin
Metadata
Metadata
Assignees
Labels
No labels
Activity
github-actions commentedon Mar 18, 2026
This issue might be a duplicate of existing issues. Please check:
These issues cover the same underlying problem of todo/task state not surviving session boundaries. It may be worth adding your input there rather than opening a new issue.
lucharo commentedon Apr 9, 2026
We ran into a narrower version of this that seems worth capturing here.
The problem isn't only losing todos across session boundaries or compaction. It can also happen inside an active session when the visible todo list gets rewritten for a subtask. From the user's point of view, still-relevant unfinished items can disappear from the list even though the work is not actually done.
A helpful addition would be safer write semantics for the todo tool/UI, for example:
That would make it much harder to accidentally hide pending work while narrowing focus to a subtask.
splitice commentedon May 1, 2026
When using the github integration the best place to put this would be the issue / pr that triggered the event. This would would result in a similar user experience as tools like Copilot Cloud agent,
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.