Skip to docs content
JSON mode (
Reference
Spell — Status
At a glance
| Field | Value |
|---|---|
| Invoke as | /spell-status |
| Argument | Optional flags — e.g., --verbose --format json |
| Agent | agent |
| When to use | Use PROACTIVELY when asked for a quick snapshot of session/repo state — branch, TODOs, decisions, last journal. |
Executive Summary
- This spell prints a quick state snapshot for the current repo. It never modifies files.
- It reads local git state plus arcane session files (
TODO.md,DECISIONS.md,journal/). - Use it any time mid-session to re-orient without running the full
spell-open-sessionpass.
Show the current session status for this repository. This is a read-only spell.
Inputs
- Optional
--verbose— include changed-file paths and the first few open TODOs. - Optional
--format text|json— default istext.
If no flags are given, use default text mode.
Steps
- Confirm this is a git repository (e.g.,
git rev-parse --is-inside-work-tree). If it is not, skip the git steps and setbranch,unpushedCommits,staged,unstaged, anduntrackedtounknown(text) /null(JSON); still report the file-based counts in steps 4–6 if those files exist. Notenot a git repositoryin the output. - Run
git branch --show-currentand capture the branch name. If it returns empty, you are in detached HEAD — report the branch asdetached@{short-sha}(usegit rev-parse --short HEAD). - Run
git rev-list --count @{upstream}..HEADfor unpushed commit count. If there is no upstream (no tracking branch, or detached HEAD), set this tounknown(text) /null(JSON). Do not treat the absence of an upstream as0. - Run
git status --shortand compute counts: staged, unstaged, untracked. A clean tree is0/0/0. - Count open TODOs in
TODO.md(unchecked- [ ]items). If the file is missing, count0. - Count decision entries in
DECISIONS.md— count one per decision-record heading (theADR-NNN/ARC-NNNentry headings, e.g.## ARC-012 ...). Do not count cross-reference table rows or inline mentions, and de-duplicate repeated IDs. If the file is missing, count0. - Determine the last session date from the most recent file in
journal/(filenames followYYYY-MM-DD-topic-slug.md; sort by the leading date, not file mtime). Ifjournal/is missing or contains no dated entries, reportnone(text) /null(JSON).
Output
Text mode (default)
One concise line:
[{branch}] ↑{unpushed} | {staged}● {unstaged}✎ {untracked}? | {openTodos} TODOs | {decisions} ADRs | last session: {date}
Glyph key: ↑ unpushed commits, ● staged, ✎ unstaged, ? untracked. Render unknown / none literally in the slot when a value cannot be determined (e.g. ↑unknown, last session: none). When not a git repo, prefix the line with not a git repository — and show unknown for all git-derived slots.
If --verbose, also print:
- a short bullet list of changed file paths from
git status --short - the first 5 open TODO lines
JSON mode (--format json)
{
"branch": "main",
"isGitRepo": true,
"detachedHead": false,
"unpushedCommits": 0,
"staged": 0,
"unstaged": 0,
"untracked": 0,
"openTodos": 0,
"decisions": 0,
"lastSessionDate": "YYYY-MM-DD",
"modifiedFiles": []
}
Field conventions (keep JSON consistent with the text shape):
branch— string;detached@{short-sha}when in detached HEAD;nullwhen not a git repo.isGitRepo— boolean. Whenfalse, all git-derived fields (unpushedCommits,staged,unstaged,untracked,branch) arenull.detachedHead— boolean.unpushedCommits— integer, ornullwhen there is no upstream / detached HEAD (the JSON analogue of textunknown). Never silently0.lastSessionDate—YYYY-MM-DDstring, ornullwhen no dated journal entry exists (the analogue of textnone).modifiedFiles— populated only when--verboseis set; otherwise[].
Rules
- Read-only — never edit, create, stage, or commit any file. Use only inspection commands (
git status,git rev-list,git branch, file reads). - Prefer exact values from local git and files; do not estimate.
- Never fail the whole snapshot because one source is unavailable. A missing count file is
0; an undeterminable git value isunknown(text) /null(JSON); a non-git directory still reports file-based counts. - Counts vs. unknowns are distinct: a real
0(clean tree, empty TODO) is not the same asunknown/null(could not determine). Do not collapse one into the other. - Keep text output to a single line unless
--verboseis set.