research-mode
Skill2 starsChanged 7 months agoMITView on GitHub
Toggle persistent research mode on/off. When on, hook support can remind the agent to keep the research document updated throughout the conversation, with manual fallback if unavailable. Use with a research topic to start, with "continue" to resume an existing research doc, or with "off" to stop.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- zi-yue-1129/research-lab-skillstheir own version, first seen Sep 23, 2026
- VKambulov/research-modetheir own version, first seen Jun 17, 2026
- Naoray/skillstheir own version, first seen May 22, 2026
- assafkip/research-modetheir own version, first seen Apr 3, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- assafkip/research-mode★ 151same name
- zi-yue-1129/research-lab-skills★ 9same name
- VKambulov/research-mode★ 4same name
- Naoray/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository23 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- .copilot/copilot-instructions.mdCopilot instructions
- ahaSkill
- explain-prSkill
- fetch-planSkill
- generate-pr-descriptionSkill
- grill-meSkill
- improve-a-planSkill
- improve-codebaseSkill
- persistSkill
- planning-modeSkill
- planningSkill
- review-prSkill
- rust-bevy-standardsSkill
- rust-bevy-test-conventionsSkill
- rust-standardsSkill
- tddSkill
- unslopSkill
- update-agentsSkill
- update-planSkill
- update-skillsSkill
- write-a-skillSkill
- wtfSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. 0 are common, 10 are distinctive, and 11 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
If you cannot determine which tool you are, ask the user.
- Distinctive: line 32
If the argument is "off", skip this step and go directly to Step 2.
- Very specific: line 36
If running in Claude Code, run bash {skill-dir}/scripts/check-hooks.sh and parse the structured output.
- Very specific: line 37
If running in Copilot, run bash {skill-dir}/scripts/check-hooks.sh copilot and parse the structured output.
- Very specific: line 64
When the user provides a topic, update the flag file's topic: line, then continue to Step 3b.
- Very specific: line 68
If the flag file doesn't exist yet, create {repo root}/.ai/.active-mode with:
- Very specific: line 75
If it already exists (from Step 3a), update the topic: line.
- Very specific: line 77
After the persist skill creates the research document, update the flag file's document: line with the file path.
- Very specific: line 79
If running in Copilot, also include in the confirmation: "You can run /rename {task-name} to rename this conversation." where {task-name} …
- Very specific: line 80
If running in Claude Code or Pi, instead include: "You can run /name {task-name} to name this conversation." where {task-name} is the …
- Very specific: line 85
If the directory is missing or contains no .md files, stop and tell the user: "No existing research docs found in .ai/research/.
- Distinctive: line 95
If the input is a number, resolve it against the numbered list.
- Very specific: line 96
If the input is text, try exact filename match first (with or without .md suffix).
- Distinctive: line 97
If no exact match, allow a single unambiguous case-insensitive partial match.
- Distinctive: line 98
If the input is invalid, ambiguous, or out of range, stop and tell the user the selection was invalid.
- Distinctive: line 99
Read the selected document so its contents are in context.
- Distinctive: line 116
If you've learned something new since the last update, update the research document on disk
- Distinctive: line 117
If you haven't learned anything new, carry on — don't update for the sake of it
- Distinctive: line 118
Keep the document well-structured: add new sections, refine conclusions, note contradictions
- Distinctive: line 201
If that extension is installed, planning mode gets equivalent reminder and stale-flag cleanup behaviour automatically.
- Very specific: line 213
If you need to persist research mode across sessions, re-enable it with /research-mode at the start of the new session.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Usage
/research-mode— Enable research mode, then prompt for a topic/research-mode <topic>— Enable research mode and start researching the topic/research-mode continue— List existing research docs and resume one/research-mode off— Disable research mode
Configuration
Hook configuration by tool
| Tool | Hook config location / equivalent | Script format argument |
| Claude Code | ~/.claude/settings.json | (none — default) |
| Copilot | ~/.copilot/hooks.json | copilot |
| Pi | Bundled active-mode extension in .pi/agent/extensions/active-mode/ | (extension-driven) |
Claude Code and Copilot support the bundled PostToolUse and SessionStart hook scripts directly. Pi does not use the same standalone hook configuration files in this repository's starter config. Instead, this starter config now ships a Pi-native active-mode extension that reads .ai/.active-mode, clears stale flags on fresh session start, injects reminder context before LLM calls, and shows mode status in the UI. If that extension is not installed, fall back to manual document updates.
If you cannot determine which tool you are, ask the user.
Workflow
Step 1: Check hook configuration
If the argument is "off", skip this step and go directly to Step 2.
Otherwise:
- If running in Claude Code, run
bash {skill-dir}/scripts/check-hooks.shand parse the structured output. - If running in Copilot, run
bash {skill-dir}/scripts/check-hooks.sh copilotand parse the structured output. - If running in Pi, skip the standalone hook check. Explain that this repository's Pi starter config uses the bundled
active-modeextension instead of standalone hook files. If that extension is installed, research mode gets equivalent reminder/cleanup behaviour automatically. Otherwise research mode will rely on manual update discipline only. Then continue to Step 2.
For Claude Code and Copilot:
- If
STATUS: YES: continue to Step 2. - If
STATUS: NOorSTATUS: PARTIAL: offer to install the missing hooks now (see Hook Setup below) before proceeding. If the user declines, note that research mode will rely on manual update discipline only — no PostToolUse reminders and no SessionStart cleanup — then continue.
Step 2: Determine action
Parse the arguments:
- No arguments → go to Step 3a
- "off" → go to Step 5
- "continue" → go to Step 3c
- Any other text → treat as the research topic, go to Step 3b
Step 3a: Enable without topic
- Create
{repo root}/.ai/.active-modewith:mode: research topic: (awaiting input) document: (pending) started: {yyyy-mm-dd HH:mm} - Tell the user: "Research mode is on. What would you like to research?"
- When the user provides a topic, update the flag file's
topic:line, then continue to Step 3b.
Step 3b: Enable with topic
- If the flag file doesn't exist yet, create
{repo root}/.ai/.active-modewith:
If it already exists (from Step 3a), update themode: research topic: {the research topic} document: (pending) started: {yyyy-mm-dd HH:mm}topic:line. - Invoke the
persistskill to begin researching the topic. - After the
persistskill creates the research document, update the flag file'sdocument:line with the file path. - Confirm to the user: "Research mode is on. I'll keep updating {document path} as we go. Use
/research-mode offwhen done. Research mode will be auto-disabled by starting a new session when supported by your harness configuration." - If running in Copilot, also include in the confirmation: "You can run
/rename {task-name}to rename this conversation." where{task-name}is the document filename with the date prefix and.mdsuffix removed. - If running in Claude Code or Pi, instead include: "You can run
/name {task-name}to name this conversation." where{task-name}is the document filename with the date prefix and.mdsuffix removed.
Step 3c: Continue an existing research doc
- List markdown files in
{repo root}/.ai/research/.- If the directory is missing or contains no
.mdfiles, stop and tell the user: "No existing research docs found in.ai/research/. Use/research-mode <topic>to start a new one." - On Windows, if Glob fails to list the directory, fall back to
ls "{repo root}/.ai/research/"via Bash.
- If the directory is missing or contains no
- Sort newest first (the
{yyyy-mm-dd}filename prefix sorts correctly lexicographically). - Show the filenames exactly as stored in a numbered list. Example:
1. 2026-04-10 auth-middleware-analysis.md 2. 2026-04-08 retry-strategies.md - Prompt the user to reply with either the list number or the filename.
- Resolve the selection:
- If the input is a number, resolve it against the numbered list.
- If the input is text, try exact filename match first (with or without
.mdsuffix). - If no exact match, allow a single unambiguous case-insensitive partial match.
- If the input is invalid, ambiguous, or out of range, stop and tell the user the selection was invalid. Do not re-prompt.
- Read the selected document so its contents are in context.
- Derive
{topic}from the filename by removing the{yyyy-mm-dd}prefix and.mdsuffix. - Create
{repo root}/.ai/.active-modewith:mode: research topic: {topic} document: {full path to the selected doc} started: {yyyy-mm-dd HH:mm} - Confirm to the user: "Research mode is on. Continuing
{document path}. Use/research-mode offwhen done. Research mode will be auto-disabled by starting a new session when supported by your harness configuration." - If running in Copilot, also include in the confirmation: "You can run
/rename {task-name}to rename this conversation." where{task-name}is the document filename with the date prefix and.mdsuffix removed. - If running in Claude Code or Pi, instead include: "You can run
/name {task-name}to name this conversation." where{task-name}is the document filename with the date prefix and.mdsuffix removed.
Step 4: Keep the research document updated
While research mode is active, if your harness has PostToolUse hook support configured, the hook outputs reminders after each tool use. When you see these reminders:
- If you've learned something new since the last update, update the research document on disk
- If you haven't learned anything new, carry on — don't update for the sake of it
- Keep the document well-structured: add new sections, refine conclusions, note contradictions
Step 5: Disable
- Delete
{repo root}/.ai/.active-mode - Confirm: "Research mode is off."
Step 6: Session startup cleanup
For harnesses with SessionStart hook support configured, stale flag files from previous sessions are cleared automatically. In Pi, the bundled active-mode extension clears stale flags on fresh session start when installed. Without that extension, delete a stale .ai/.active-mode file before re-enabling research mode if one is left behind.
Hook Setup
Research mode relies on two hooks to function fully. Without the PostToolUse hook, only the persist skill's built-in continuous update behaviour and Step 4 above apply.
Step 1 runs scripts/check-hooks.sh to verify configuration automatically for Claude Code and Copilot. If that reports STATUS: NO or STATUS: PARTIAL, offer to add the missing hooks using the appropriate format below.
Claude Code
Merge into ~/.claude/settings.json:
{
"hooks": {
"PostToolUse": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "bash ~/.claude/skills/research-mode/scripts/research-mode-hook.sh"
}
]
}
],
"SessionStart": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "bash ~/.claude/skills/research-mode/scripts/clear-mode.sh"
}
]
}
]
}
}Copilot
Merge into ~/.copilot/hooks.json:
{
"hooks": {
"postToolUse": [
{
"type": "command",
"bash": "~/.copilot/skills/research-mode/scripts/research-mode-hook.sh copilot"
}
],
"sessionStart": [
{
"type": "command",
"bash": "~/.copilot/skills/research-mode/scripts/clear-mode.sh copilot"
}
]
}
}Note: The
copilotargument tells the scripts to output JSON withadditionalContextfor Copilot's context injection format.
Pi
This repository's Pi starter config includes the active-mode extension under .pi/agent/extensions/active-mode/. That extension uses Pi lifecycle events:
- fresh-session cleanup via
session_start - per-turn / post-tool-style reminders via
before_agent_startandcontext - visible mode state via
ctx.ui.setStatus()
If that extension is installed, planning mode gets equivalent reminder and stale-flag cleanup behaviour automatically. If it is not installed, use manual document updates.
Bundled scripts
- scripts/research-mode-hook.sh — PostToolUse reminder
- scripts/clear-mode.sh — SessionStart cleanup
- scripts/check-hooks.sh — verifies the two hooks above are configured in the relevant settings file
Notes
- For harnesses with SessionStart hook support configured, the flag file is automatically cleared at session startup.
- In Pi, the bundled
active-modeextension provides the equivalent behaviour without standalone hook files. - If you need to persist research mode across sessions, re-enable it with
/research-modeat the start of the new session. - Both hook scripts are silent when the flag file doesn't exist — no impact on normal conversations.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

