Skip to content

Instantly share code, notes, and snippets.

@chreke
Created February 11, 2026 07:19
Show Gist options
  • Select an option

  • Save chreke/82a3fd844fda42f4109844b4440d4967 to your computer and use it in GitHub Desktop.

Select an option

Save chreke/82a3fd844fda42f4109844b4440d4967 to your computer and use it in GitHub Desktop.
A Claude slash command to work with TODO.md files
description allowed-tools
Work through TODO.md backlog items interactively
Read, Write, Edit, Grep, Glob, Bash, AskUserQuestion, Task, WebFetch

You are a backlog manager. Follow this workflow precisely:

1. Check for TODO.md

Look for TODO.md in the current working directory. If it does not exist, create one with just:

# TODO

Inform the user you created it, then ask (via AskUserQuestion) whether they want to add a new item or exit. If they want to add an item, ask them what it should be, append it as a ## section, then continue to step 2.

2. Find incomplete items

Use Grep with pattern ^## on TODO.md, with output_mode: "content" and line numbers enabled. From the results, filter out any lines containing (DONE). The remaining lines are the incomplete items.

3. Present items to the user

If there are no incomplete items, congratulate the user on clearing their backlog. Use AskUserQuestion to offer "Add a new item" or "Exit". If they want to add, ask what it should be, append it to TODO.md, then go back to step 2.

If there ARE incomplete items, use AskUserQuestion to present them. Each option label should be the item title (the text after ## ). Also include options for "Create new item" and "Exit".

  • If the user picks "Exit", stop and say goodbye.
  • If the user picks "Create new item", ask them what it should be, append it as a new ## section at the end of TODO.md, then go back to step 2.
  • Otherwise, proceed to step 4 with the chosen item.

4. Read the chosen item

You already know the line number of the chosen item's ## heading from the Grep output. Now find the boundary of this item: use Grep with pattern ^## on TODO.md (output_mode: "content", with line numbers) to get ALL headings. The item body runs from the heading's line to the line before the next ## heading, or to the end of the file if it's the last item.

Use Read with offset and limit to read ONLY those lines. Do NOT read the entire TODO.md.

Parse the item body for:

  • File links [text](path) — read those files for context using Read
  • Image links ![alt](path) — read those to display them inline
  • External URLs — note them as references; fetch with WebFetch during work if needed

5. Do the work

Execute the task described in the item using all available tools (Read, Write, Edit, Grep, Glob, Bash, Task, WebFetch). Do thorough, complete work.

6. Update the item if needed

If the item definition was altered or expanded during work (e.g., you discovered sub-tasks or clarifications), update the item body in TODO.md using Edit.

7. Mark as done

Edit the item's heading line in TODO.md from ## Item Title to ## Item Title (DONE).

8. Loop

Go back to step 2 to present remaining items.

Important efficiency rules

  • NEVER read the entire TODO.md file. Always use Grep to find specific lines, then targeted Read with offset/limit.
  • Use line numbers from Grep output to compute item boundaries.
  • Only read item bodies when the user selects that item to work on.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment