6
Sessions
Alex Clarke edited this page 2026-06-11 16:00:33 -06:00

By default, Coyote does not send back all previous messages in a conversation to the model. This means that each time you query a model, it's essentially a one-off. However, Coyote does support chat-like conversations with LLMs via its sessions mechanism.

Sessions in Coyote enable the familiar conversational interactions with LLMs. This means you can reference previous answers and ask follow-up questions and the model will know what you're referring to.

Sessions can be temporary, or can be saved so you can continue conversations at a later time.

Sessions persist one conversation. For facts that should survive across all sessions (e.g., user preferences, project constraints, accumulated feedback), see Memory.

Saved sessions are stored in the sessions subdirectory of the Coyote configuration directory. The location of the sessions directory varies by system, so you can use the following command to find the sessions directory if you need it:

coyote --info | grep 'sessions_dir' | awk '{print $2}'

Usage

When you use a session in Coyote, you can either persist it or discard it once you're done. Sessions you discard are then just considered 'temporary' sessions.

Persistent Session Example

Sessions you persist and then load again later will inherit the same configuration as was used during the last usage of that session. That is to say, if you had certain tools or MCP servers enabled when you were last in that session, they will be available again when you continue that session.

Auto-Saved Sessions

When save_session is set to true and you don't provide an explicit session name (i.e., you're in a temporary session), Coyote will automatically save your session when you exit. These auto-saved sessions behave differently from manually saved sessions in a few important ways.

How Auto-Save Works

When you exit a temporary session with save_session: true, Coyote:

  1. Saves the session to a _/ subdirectory inside the sessions directory (e.g., ~/.config/coyote/sessions/_/).
  2. Generates a timestamped filename in the format YYYYMMDDTHHmmSS (e.g., 20260508T120838).
  3. If an auto-generated name is available (see Auto-Naming below), it is appended to the timestamp (e.g., 20260508T120838-discuss-rust-error-handling.yaml).

For agent sessions, auto-saved sessions are stored in the agent's own session directory under _/ (e.g., ~/.config/coyote/agents/<agent-name>/sessions/_/).

Auto-Naming

When save_session: true is set and you send your first message in a temporary session, Coyote will use the LLM to automatically generate a short descriptive name for the session based on the initial exchange. This name is appended to the timestamp in the filename, making it easier to identify sessions later.

You can view the auto-generated name for the current session with .info session under the autoname field.

Finding Auto-Saved Sessions

Auto-saved sessions are stored separately from manually named sessions. This means they won't appear in the default session list:

  • --list-sessions (CLI): Does not include auto-saved sessions.
  • .session + Tab (REPL): Does not show auto-saved sessions in completions.

To access auto-saved sessions, prefix your query with _/:

  • .session _/ + Tab (REPL): Will show auto-saved sessions in completions, since Coyote looks in the _/ subdirectory when it sees this prefix.
  • .session _/<name> (REPL): Loads a specific auto-saved session. For example: .session _/20260508T120838-discuss-rust-error-handling.

When you load an auto-saved session this way, it is treated as a temporary session again, meaning the session name resets to temp internally. If auto-naming had previously generated a name, it will be restored so that subsequent saves continue to use it.

One-Time Save Override

You can force a single session to be saved regardless of the global save_session setting by using the --save-session CLI flag:

coyote --session --save-session "What is Rust?"

This overrides the configured save_session value for that one invocation only, and the session will auto-save to the _/ subdirectory just like it would with save_session: true.

Save Behavior Summary

The following table summarizes what happens when you exit a session, depending on the save_session setting and the session type:

save_session Session Type Mode Behavior
true Named session Any Auto-saves to <sessions_dir>/<name>.yaml
true Temporary (temp) Any Auto-saves to <sessions_dir>/_/<timestamp>[-autoname].yaml
false Any Any Never saves
null Any REPL Prompts "Save session?" (if you say yes with a temp session, you'll be asked for a name)
null Any CLI Does not save

Configuration

Session behavior can be configured from the global Coyote configuration file. The location of this file varies between systems so you can use the following command to locate it on your system:

coyote --info | grep 'config_file' | awk '{print $2}'

The following settings are available to customize the default behavior of sessions globally:

Setting Description
save_session Controls the persistence of the session.
  • If true, then any time you're in a session, changes will auto-save unless explicitly defined otherwise.
  • If false, then any time you're in a session, changes will not auto-save unless explicitly specified otherwise.
  • If null, Coyote will always prompt the user for what to do.
compression_threshold Defines the token count threshold at which Coyote will compress the session to save on the context length
summarization_prompt This is the prompt that is used to compress the session up to a given point when compression is triggered
summary_context_prompt This is the prompt that's used to add the summarized conversation generated by the summarization_prompt as context to the model

Per-Session Settings

In addition to the global settings above, individual sessions can override the following settings. These can be set at runtime using the .set command or configured in the session's YAML file:

Setting Default Description
auto_continue Global auto_continue value Enable the Todo System auto-continuation for this session. Overrides global and role settings.
max_auto_continues Global max_auto_continues value Maximum number of automatic continuations before stopping. Overrides global and role settings.
inject_todo_instructions Global inject_todo_instructions value Inject default todo tool usage instructions into the system prompt. Overrides global and role settings.
continuation_prompt Global continuation_prompt value Custom prompt used when auto-continuing. Overrides global and role settings.
skills_enabled Global skills_enabled value Master switch for skills in this session. .set skills_enabled null clears the session override.
enabled_skills Inherited via the skill cascade The active skills for this session. Accepts either a YAML list or a comma-separated string in the saved session YAML.

For more information on the Todo System, see the Todo System documentation.