#Built-in session commands
Manage a Shell session from the inside — list what you can do, review what just happened, check the cost, condense the history, stop a runaway command, and close cleanly.
#Overview
Inside a Shell session you can type a small set of built-in commands that act on the session itself, not on your machine. They let you steer the session, understand what it has done, keep a long session manageable, and stop or end it on your terms. They are always available while you work, and they are distinct from the ordinary commands you run for the actual task.
These commands are the difference between watching a session and being in control of one. With them you can orient yourself at any moment, halt a command the instant something looks wrong, and leave a session in a clean state when you are finished.
#What you can do
There are seven built-in commands. Each does one thing, clearly.
| Command | What it does |
|---|---|
help | Lists the available session commands so you can see your options. |
context | Shows recent context from the session, so you can review what has happened. |
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. |
exit | Leaves the Shell. |
#How to use it
You type a built-in command in the session the same way you would type any command, and it acts on the session immediately. Here is when to reach for each one.
#help
When you want to see what the session itself can do, type:
helpYou get a list of the available session commands. Use it when you are new to the Shell or have forgotten the exact name of a command — and if you would rather search than remember, the command palette finds the same things by name as you type.
#context
To review what has happened so far in the session, type:
contextThis shows recent context from the session — the steps and output leading up to now. It is the fastest way to re-orient after stepping away, to remind yourself what a long-running task has been doing, or to check the last few steps before deciding what to do next. You can ask for a specific amount of recent context by giving a number of lines:
context 50#cost
To see what the current session has used, type:
costSome of the Shell's heavier work draws on credits, and cost tells you what this session has consumed so far. Check it during a long session to stay aware of usage, or at the end to see what a piece of work cost.
#compact
When a session has run for a long time and its history has grown large, condense it with:
compactThis keeps the meaning of what has happened while shrinking the history, so a long session stays responsive and easy to follow. Use it when a session has been going for a while and you intend to keep working in it — nothing important is thrown away, the history is simply made leaner.
#kill
To stop the command that is currently running — without ending the session — type:
killThis halts the running command and leaves the session itself open, so you can read the output, adjust, and run something else. Reach for it the moment a command is stuck, runs longer than expected, or is clearly going the wrong way. Stopping always works immediately.
#close
When you are done with a session, end it cleanly with:
closeThis is a clean stop. The session's durable receipt of what it did remains available afterward, so closing never loses your history or results — it simply finishes the session.
#exit
To leave the Shell entirely, type:
exitThis steps you out of the Shell. Use it when you are finished with hands-on work in the Shell and want to return to the rest of Nourva.
kill, close, and exit are three different scopes. kill stops one running command but keeps the session. close ends the whole session. exit leaves the Shell. Pick the one that matches how much you mean to stop.
#Examples
You ask:
context 30What you see: the last stretch of the session — the recent commands and their live output — gathered so you can review exactly what happened before deciding your next move.
You ask:
killWhat you see: the command that was running stops immediately, the session stays open, and you are returned to a ready prompt where you can read what happened and run something else.
You ask:
costWhat you see: a clear figure for what this session has used so far, so you know where you stand before continuing or closing.
#Tips
- Use
contextbefore you act, not just after — a quick look at recent steps prevents you from repeating work or stepping on a job that is still running. - Reach for
killwithout hesitation. It stops only the running command and keeps the session, so there is no cost to stopping early and checking. - Run
compacton sessions you plan to keep open for a long time; it keeps a marathon session as nimble as a fresh one. - Remember the difference between
closeandexit:closeends this session,exitleaves the Shell. Closing always preserves the session's durable receipt, so you can return to what it did.