Session management commands let you start new coding sessions, resume previous work, and control active sessions.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/remorses/kimaki/llms.txt
Use this file to discover all available pages before exploring further.
/session
Start a new OpenCode session with an initial prompt.Parameters
prompt(required) - The task description for the AIfiles(optional) - Comma-separated list of files to reference (with autocomplete)agent(optional) - Agent to use for this session (with autocomplete)
Usage
Behavior
- Creates a starter message in the channel: ”🚀 Starting OpenCode session”
- Creates a new thread with the prompt as the title (max 100 chars)
- Adds you to the thread so it appears in your sidebar
- Starts an OpenCode session with your prompt
- Streams the AI’s response in the thread
File References: When you provide files, Kimaki appends them to your prompt as
@file1 @file2. The autocomplete searches your project files by name./resume
Resume a previous OpenCode session in a new thread.Parameters
session(required) - Session ID to resume (with autocomplete showing recent sessions)
Usage
- Title preview
- Last updated timestamp
- Excludes sessions already open in other threads
Behavior
- Creates a new thread: “Resume: [session title]”
- Links the thread to the existing session ID in the database
- Fetches all messages from the session
- Displays the last assistant response in Discord
- Shows a confirmation: “Session resumed! Loaded N messages.”
Message History: Only the most recent assistant response is displayed in Discord to avoid flooding the thread. The full session history remains in OpenCode.
Skipped Messages
If the session has many assistant messages, Kimaki skips older ones and shows:/abort
Abort the currently running OpenCode request in a thread.Parameters
None.Usage
Behavior
- Checks if there’s an active session in the current thread
- Aborts the in-flight OpenCode request using
AbortController - Calls the OpenCode API to abort the session server-side
- Shows confirmation: ”🛑 Request aborted”
When to Use
- The AI is heading in the wrong direction
- You want to stop and provide more context
- The response is taking too long
Queued Messages: Aborting clears any queued messages for that session.
/fork
Fork a session from any previous user message, creating a new branch of the conversation.Parameters
None - shows an interactive dropdown.Usage
Behavior
1. Add authentication (2024-03-01 10:30:00)
2. Review the changes (2024-03-01 10:35:00)
3. Add error handling (2024-03-01 10:40:00)
Synthetic Messages Hidden: The dropdown filters out synthetic messages (branch context, memory reminders) injected by the OpenCode plugin to keep the list clean.
Example Workflow
/share
Generate a public URL to share the current session.Parameters
None.Usage
Behavior
- Checks if there’s an active session in the thread
- Calls the OpenCode API to create a share link
- Returns the URL: ”🔗 Session shared: https://opencode.ai/share/abc123”
Share Link Features
- Read-only: Viewers cannot edit or continue the session
- No expiration: Links remain valid indefinitely
- Live updates: If you continue the session, the share link updates in real-time
Error Handling
All session commands validate:- Channel type: Must be used in the correct context (channel vs thread)
- Bot configuration: Channel must be configured for the correct bot
- Directory existence: Project directory must exist on the machine
- Session state: Session must be in the expected state (active, exists, etc.)
Best Practices
Use descriptive prompts
Use descriptive prompts
Good prompts are specific and actionable:Good:Bad:
Resume long-running work
Resume long-running work
If a session spans multiple days:
- End the thread naturally (don’t /abort)
- Later, use
/resumeto continue - The AI has full context from previous messages
Fork to explore alternatives
Fork to explore alternatives
When you want to try a different approach:
- Use
/forkto branch from before the unwanted changes - Try the alternative in the forked thread
- Keep both threads to compare results