You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-3Lines changed: 31 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -62,12 +62,29 @@ OpenCode looks for configuration in the following locations:
62
62
-`$XDG_CONFIG_HOME/opencode/.opencode.json`
63
63
-`./.opencode.json` (local directory)
64
64
65
+
### Auto Compact Feature
66
+
67
+
OpenCode includes an auto compact feature that automatically summarizes your conversation when it approaches the model's context window limit. When enabled (default setting), this feature:
68
+
69
+
- Monitors token usage during your conversation
70
+
- Automatically triggers summarization when usage reaches 95% of the model's context window
71
+
- Creates a new session with the summary, allowing you to continue your work without losing context
72
+
- Helps prevent "out of context" errors that can occur with long conversations
73
+
74
+
You can enable or disable this feature in your configuration file:
75
+
76
+
```json
77
+
{
78
+
"autoCompact": true// default is true
79
+
}
80
+
```
81
+
65
82
### Environment Variables
66
83
67
84
You can configure OpenCode using environment variables:
| Initialize Project | Creates or updates the OpenCode.md memory file with project-specific information |
411
+
| Compact Session | Manually triggers the summarization of the current session, creating a new session with the summary |
412
+
385
413
## MCP (Model Context Protocol)
386
414
387
415
OpenCode implements the Model Context Protocol (MCP) to extend its capabilities through external tools. MCP provides a standardized way for the AI assistant to interact with external services and tools.
0 commit comments