2026-10-09 Session Flags - the first Claude Code mod I'm building
Canonical version: 2026-10-09 Session Flags - the first Claude Code mod I'm building.
Claude Code Mods launched on 1 October, and they're on by default since Claude Code v2.1.287. A mod is a plugin made of JavaScript or TypeScript handlers that run inside Claude Code: it can step into tool calls and prompts, add slash commands and tools, and draw its own panes in the terminal. I wrote about the launch and the security side in 2026-10-04 Claude Code Mods - Claude Code is now programmable, and mods aren't sandboxed.
The first mod I'm going to build is called Session Flags.
Why
During a session, Claude mentions a lot of things on the side: questions it wants me to answer, issues it found but didn't fix because they were out of scope, warnings, things to follow up on later. All of that ends up in the scrollback, and it gets lost there. When the session ends, I have to scroll back through the transcript to find what still needs my attention.
I want those items in one place, as a todo list I can work through.
What it does
Session Flags adds a side pane that collects what Claude flags during the session. There are four kinds of items: open questions, issues found but not fixed, warnings, and follow-ups.
Each item is open, handled or dismissed. Handled items get cleaned up automatically after a while, so the list only shows what still needs attention.
The rest:
/flagstoggles the pane,/flags copycopies the list to the clipboard as a Markdown checklist (ready to paste into a task note or an issue), and/flags clearempties it- A badge in the band above the prompt shows the count and carries a digit hotkey. In Claude Code, a digit hotkey on the band fires when you type that digit alone in an empty prompt and pause, so you can open the list without leaving the keyboard
Ctrl+X Tabmoves keyboard focus into the band and then the pane, like for any mod- The pane sits beside the transcript in a wide fullscreen terminal, and above the prompt otherwise
How Claude reports flags
Claude Code has no "Claude flagged an issue" event. The obvious approach would be to parse Claude's answers and look for questions and warnings in the prose. That's fragile: the wording changes from one answer to the next, and a parser either misses items or invents them.
Mods offer a cleaner option. A mod can register its own tools, and Claude sees them like any other tool (named mcp__<plugin>__<tool>). So Session Flags gives Claude tools to log a flag and to resolve one. When Claude finds an issue it won't fix right now, it calls the tool with the kind and the text. When it fixes something it flagged earlier, it marks that item as handled. Every flag is a structured record with an id, so nothing depends on how Claude phrases things.
The mod also captures AskUserQuestion calls by itself, through a tool.call hook. Every question Claude asks me lands in the list, even the ones I skip.
Open source
I'll release it under the MIT license on my GitHub account (github.com/dsebastien) once the first version works, and I'll share the link here when it's out.
That's it for today! ✨
References
- Mods overview (official docs): https://code.claude.com/docs/en/plugins/mods/overview
- Add a command or a tool (official docs): https://code.claude.com/docs/en/plugins/mods/api#add-a-command-or-a-tool
- Draw in the interface (official docs): https://code.claude.com/docs/en/plugins/mods/interface
- React to events (official docs): https://code.claude.com/docs/en/plugins/mods/events
- Mods reference (official docs): https://code.claude.com/docs/en/plugins/mods/reference
- Keyboard shortcuts, band and pane actions (official docs): https://code.claude.com/docs/en/keybindings
- TypeScript declarations for mods: https://github.com/anthropics/claude-code/blob/main/mods/types/claude-code.d.ts
Related
- Claude Code Mods
- Claude Code
- 2026-10-04 Claude Code Mods - Claude Code is now programmable, and mods aren't sandboxed
- Claude Code Extension Points
- Build a Claude Code mod for a session flags side panel (Task)
About Sébastien
Ready to get to the next level?
Found this valuable? Share it with someone who needs it.