# Session Flags Claude Code Mod **Session Flags** is a free, open source (MIT) [[Claude Code Mods|Claude Code mod]] that I built. During a [[Claude Code]] session, Claude asks questions, spots issues it doesn't fix, warns about side effects and leaves follow-ups. Those used to get lost in the scrollback, and I had to scroll back through the transcript to find what still needed my attention. Session Flags puts them in a side pane instead, as a checklist that I can resolve, that cleans itself up, and that I can copy as markdown. - **Documentation**: https://dsebastien.github.io/session-flags/ - **Source code**: https://github.com/dsebastien/session-flags (the repository is also its own plugin marketplace) - **Local clone**: `$WKS/session-flags` (see [[Working on my repositories (Process)]]) - **Install**: `/plugin install session-flags --marketplace dsebastien/session-flags` in Claude Code ## What it does Items get into the list in four ways: - Claude records them itself through three tools the mod registers: `flag`, `resolve_flag` and `list_flags`. Each item has a kind (question, issue, warning, follow-up or note), one short sentence, an optional location such as `src/cache.ts:42`, and an id (`F1`, `F2`...). These are structured tool calls, so nothing depends on parsing Claude's prose, and they never ask for permission - When Claude ends an answer with a question it didn't flag, the mod adds that question. My next prompt counts as the answer and marks it handled - When I dismiss one of Claude's `AskUserQuestion` dialogs without answering, its questions stay open in the list - I can add my own items from the pane's field or with `/flags add`. A leading `?`, `!`, `~` or `>` sets the kind Every item is open, handled or dismissed. Resolved items fade, and they are swept away 30 minutes after they were resolved (configurable). Around the list: - **The pane** groups the items by kind, with `✓` (handled), `✕` (dismissed), `↺` (reopen) and `⧉` (copy) on each row. It's a sidebar in a wide fullscreen terminal, and sits above the prompt otherwise - A badge such as `0: ⚑ 2 open flags` sits above the prompt while the list holds items. Typing `0` alone in an empty prompt opens the pane - A mod can't register a global key, but its buttons can claim a chord bound to a Claude Code keybinding action. Session Flags uses `app:toggleDiffNoiseFilter`, so binding `ctrl+x f` to it in `~/.claude/keybindings.json` gives a real shortcut - `/flags` toggles the pane; `/flags copy`, `list`, `add`, `done`, `dismiss`, `reopen` and `clear` cover the rest - `c` copies the open items as a markdown checklist, ready to paste into a task note, an issue or a pull request; `a` copies everything - Five options (`bandHotkey`, `toggleAction`, `cleanupMinutes`, `captureTrailingQuestions`, `toastOnNewFlags`) are `userConfig` fields, set with `claude plugin configure` ## How it's made The mod's code is two JavaScript files: `hooks/register.js` (the handlers) and `hooks/flags.js` (pure helpers for the list, shared with the tests). It uses the mods API of Claude Code: `$.tool.register` for the three tools, a `tool.check` handler that allows them without a prompt, `tool.call` handlers for the tools and for `AskUserQuestion`, `turn.complete` for the trailing questions, `ui.render` for the badge and the pane, and `$.command.register` for `/flags`. The list belongs to a session. It's saved in the mod's `$.store` after every change, so it survives reloads and comes back with `/resume`. Lists of sessions nobody touched for 14 days are deleted. ## Limits - **Claude does not always call `flag` on its own.** In a test session on 2026-10-09, I asked Claude to review a few things in my vault and find what was wrong. It reported 13 issues and 1 open question in its answers and called `flag` zero times. It only flagged them, in one call, after I asked "why didn't you flag this?". The tool description already says when to call it; Claude treated its answer as the deliverable and never considered the pane. Since 0.2.0 (2026-11-22), an end-of-turn check catches most of these turns, see the next point. Asking ("flag what you found") or a rule in `CLAUDE.md` / `AGENTS.md` still helps. The trailing-question and dismissed-dialog captures don't depend on Claude remembering the tool - **The end-of-turn check works from words, not meaning.** Since 0.2.0, when an answer contains a finding word ("not fixed", "stale", "risk", "not tested"...) and Claude flagged nothing in the turn, the mod sends Claude back once to flag the items or to reply "Nothing to flag" (at most once per prompt, option `nudgeUnflaggedFindings`). A finding written in neutral words can still slip through, and a false alarm costs one short exchange. Claude Code labels the moment "stop hook problem". Tested live on 2026-11-22: Claude was sent back once, flagged the item and stopped - GitHub Actions validates the mod and runs its tests on every push and every Monday against the latest Claude Code, to catch changes of the mods API early - The chord reaches the mod only while the badge or the pane is on screen, so only while the list holds at least one item. An empty list opens with `/flags` - The mods API can still change between Claude Code releases (see [[Claude Code Mods]]) ## References - Documentation: https://dsebastien.github.io/session-flags/ - Source code: https://github.com/dsebastien/session-flags - Releases: https://github.com/dsebastien/session-flags/releases - Mods overview (official docs): https://code.claude.com/docs/en/plugins/mods/overview ## Related - [[Claude Code Mods]] - [[Claude Code]] - [[2026-10-09 Session Flags - the first Claude Code mod I'm building]] - [[2026-11-20 Session Flags - my first Claude Code mod is out]]