kdeps-commands-session
v2.0.0kdeps command: session
set commands / shelf agent
PurposeList this folder's saved sessions
LLM context: none - kdeps uses it without sending it to the model
Where it runs
Part of the commands set, used in workflow and agent mode. Slash commands: the help and completion of the built-in ones, and declared commands that run other commands and prompts.
- you type /name in kdeps
- the command runs: built in, or its declared stepscommands/session
- prompts go to the model; the output is shown
Loaded by: kdeps (agent loop), /update, kdeps run
In the code: kdeps (agent loop)agent.(*REPL).Runagent.declaredCommand
Install
A kdeps asset: installed with the first-run profile that includes its set, or the first time a command needs it, and updated without a new release.
Also installs what it requires, when missing or older: tools/session_ops.
Pin a version with kdeps install commands/session@<version>.
Contents
- order
- 140
/session [list]List this folder's saved sessions/session save [name]Save the session, optionally named/session load <id>Load a saved session (its model too)/session delete <id>Delete a saved session/session import <path>Import a JSONL session file and load it/session checkpointMark the current entry (for /session goto)/session goto <entry-id>Go back to an entry; the turns after it become a branch/session branchesList the branches /session goto stashed/session- 1
Calls a kdeps API tool
session_opsoperation: sessionsprints
{{if not .sessions}}No saved sessions.{{else}}**Saved sessions for this folder:** {{range .sessions}} - `{{.id}}` {{.updated}} turns={{.turns}} model={{if .model}}{{.model}}{{else}}-{{end}} {{if .name}}{{.name}}{{else if .prompt}}{{trunc 80 .prompt}}{{else}}(no preview){{end}}{{end}}{{end}}
/session list- 1
Calls a kdeps API tool
session_opsoperation: sessionsprints
{{if not .sessions}}No saved sessions.{{else}}**Saved sessions for this folder:** {{range .sessions}} - `{{.id}}` {{.updated}} turns={{.turns}} model={{if .model}}{{.model}}{{else}}-{{end}} {{if .name}}{{.name}}{{else if .prompt}}{{trunc 80 .prompt}}{{else}}(no preview){{end}}{{end}}{{end}}
/session save- 1
Calls a kdeps API tool
session_opsoperation: save name: $@prints
Session saved as {{.id}}{{if .name}} ({{printf "%q" .name}}){{end}}
/session load- 1
Calls a kdeps API tool
session_opsoperation: load id: $1prints
Session {{.id}} loaded ({{.turns}} turns).
/session delete- 1
Calls a kdeps API tool
session_opsoperation: delete id: $1prints
Session {{.id}} deleted.
/session import- 1
Calls a kdeps API tool
session_opsoperation: import path: $1prints
Session {{.id}} imported and loaded ({{.turns}} turns).
/session checkpoint- 1
Calls a kdeps API tool
session_opsoperation: checkpointprints
{{if .id}}Checkpoint: {{.id}}{{else}}No messages in session.{{end}}
/session goto- 1
Calls a kdeps API tool
session_opsoperation: goto id: $1prints
{{if .found}}Session restored to entry {{.id}} ({{.turns}} turns).{{else}}Entry ID {{.id}} not found in current session.{{end}}
/session branches- 1
Calls a kdeps API tool
session_opsoperation: branchesprints
{{if not .branches}}No stashed branches. Use /session goto to create a branch.{{else}}**{{len .branches}} stashed branch(es):** {{range .branches}} - branch {{.branch}}: branched at entry {{.at}}, {{len .ids}} turn(s). Entry IDs (use /session goto <id>): {{join .ids ", "}}{{end}}{{end}}
requires:
tools/session_ops: ""
version: 2.0.0
# kdeps update installs these with this command: what its run steps use
requires:
tools/session_ops: ""
name: session
order: 140
usage:
- args: "[list]"
help: List this folder's saved sessions
- args: "save [name]"
help: Save the session, optionally named
- args: "load <id>"
help: Load a saved session (its model too)
- args: "delete <id>"
help: Delete a saved session
- args: "import <path>"
help: Import a JSONL session file and load it
- args: checkpoint
help: Mark the current entry (for /session goto)
- args: "goto <entry-id>"
help: Go back to an entry; the turns after it become a branch
- args: branches
help: List the branches /session goto stashed
subcommands:
"": &list
run:
- tool: session_ops
args: {operation: sessions}
print: |-
{{if not .sessions}}No saved sessions.{{else}}**Saved sessions for this folder:**
{{range .sessions}}
- `{{.id}}` {{.updated}} turns={{.turns}} model={{if .model}}{{.model}}{{else}}-{{end}}
{{if .name}}{{.name}}{{else if .prompt}}{{trunc 80 .prompt}}{{else}}(no preview){{end}}{{end}}{{end}}
list: *list
save:
run:
- tool: session_ops
args: {operation: save, name: "$@"}
print: 'Session saved as {{.id}}{{if .name}} ({{printf "%q" .name}}){{end}}'
load:
run:
- tool: session_ops
args: {operation: load, id: "$1"}
print: "Session {{.id}} loaded ({{.turns}} turns)."
delete:
run:
- tool: session_ops
args: {operation: delete, id: "$1"}
print: "Session {{.id}} deleted."
import:
run:
- tool: session_ops
args: {operation: import, path: "$1"}
print: "Session {{.id}} imported and loaded ({{.turns}} turns)."
checkpoint:
run:
- tool: session_ops
args: {operation: checkpoint}
print: "{{if .id}}Checkpoint: {{.id}}{{else}}No messages in session.{{end}}"
goto:
run:
- tool: session_ops
args: {operation: goto, id: "$1"}
print: "{{if .found}}Session restored to entry {{.id}} ({{.turns}} turns).{{else}}Entry ID {{.id}} not found in current session.{{end}}"
branches:
run:
- tool: session_ops
args: {operation: branches}
print: |-
{{if not .branches}}No stashed branches. Use /session goto to create a branch.{{else}}**{{len .branches}} stashed branch(es):**
{{range .branches}}
- branch {{.branch}}: branched at entry {{.at}}, {{len .ids}} turn(s). Entry IDs (use /session goto <id>): {{join .ids ", "}}{{end}}{{end}}
Versions
| Version | Published | Status |
|---|---|---|
| 2.0.0 | 10/24/2026 | active |
| 1.0.1 | 10/21/2026 | active |
| 1.0.0 | 10/12/2026 | active |
Details
- Author
- kdeps
- License
- Apache-2.0
- Latest Version
- 2.0.0
- Published
- 10/12/2026