#Command reference
Every built-in command for managing a Shell session, in one place — plus the freedom to run your own.
#Overview
The Shell gives you a small set of built-in session commands for managing the session itself: seeing what it has done, what it has used, stopping a running command, and closing up cleanly. They are always available while you work, and they are easy to remember.
This page is a consolidated reference for those commands. Beyond them, you run the ordinary commands you already know directly in the session, with the output streaming back live and your chosen permission level still in force.
#What you can do
The built-in session commands manage the session — not your work, but the session that holds it. Use them to inspect history, track usage, keep a long session manageable, and end things cleanly.
These commands act on the session. Your actual work happens through the ordinary commands you type, which run inside the session at the permission level you set.
#How to use it
Type a built-in command directly in the session, the same way you type any other command. They are always available while you work, so you can reach for them at any point in a task — to check usage mid-job, condense a long history, stop something that is stuck, or close down when you are done.
For everything that is not a built-in, just type the ordinary command you want to run. It executes in the session, streams its output back live, and stays within the permission level and workspace you have chosen.
#Examples
help
helpYou see the list of available session commands, so you know what you can run to manage the session.
cost
costYou see what the current session has used so far, so you can keep an eye on a long-running job.
A command you already know
git statusThe command runs in the session and its output streams back to you live, line by line.
#The built-in session commands
These commands manage the session itself and are always available while you work.
| Command | What it does |
|---|---|
help | Lists the available session commands. |
context | Shows recent context from the session. You can optionally ask for a number of lines. |
cost | Shows what the current session has used. |
compact | Condenses the session's history so a long session stays manageable. |
kill | Stops the command that is currently running. |
close | Ends the current session cleanly. The durable receipt of what it did remains available. |
exit | Leaves the Shell. |
#Running your own commands
Beyond the built-in session commands, you type the ordinary commands you already know and run them in the session. The output streams back live, and the permission level you set stays in force. Built-in commands manage the session; your own commands do the work.
If you cannot remember an exact name, open the command palette and start typing — it finds and runs the things the Shell can do without you needing to recall the precise wording.
#Tips
- Use
contextto retrace your steps when something is unclear; it shows recent context from the session, and you can ask for a number of lines. - Reach for
killto stop a single running command without ending the whole session —closeis for ending the session itself. - Run
compacton a long session to keep its history manageable while you keep working. - Stopping always works immediately, regardless of the permission level a session is running at.