Create a persistent OpenCode agent session
create_sessionStart a persistent delegation session in a workspace without running a task yet. Follow up with send_message to keep the agent's context between calls.
Instructions
Create a persistent delegation session in a workspace without running a task yet. Follow up with send_message to keep the agent's context between calls.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"cwd": "<cwd>"
},
"name": "create_session"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | Workspace directory for the session. | |
| agent | No | Agent to use (default: deepseek-researcher). See list_agents. | |
| model | No | Override the model, e.g. "deepseek/deepseek-v4-pro". | |
| title | No | Human-readable session title. | |
| allow_bash | No | Grant (true) or revoke (false) shell commands for this session. | |
| allow_edits | No | Grant (true) or revoke (false) file edits for this session. |