description: Start a new session - reads context and scaffolds .bonfire/ if needed allowed-tools: Bash(git:), Bash(gh:), Bash(mkdir:), Read, Write, Glob, AskUserQuestion, mcplinear
Run git rev-parse --show-toplevel to locate the repository root. All session files live at <git-root>/.bonfire/.
Check if <git-root>/.bonfire/index.md exists.
If .bonfire/ does NOT exist, scaffold it:
Tell the user: "No bonfire directory found. Let me set that up for you."
Use AskUserQuestion to ask setup questions (4 questions, one round):
"Where should specs be saved?" (Header: "Specs")
"Where should docs be saved?" (Header: "Docs")
"How should .bonfire/ be handled in git?" (Header: "Git")
"Enable Linear MCP integration?" (Header: "Linear")
Create the directory structure based on user choices:
Always create in .bonfire/:
.bonfire/
├── index.md
├── config.json
├── archive/
├── scripts/
└── .gitignore
If specsLocation is .bonfire/specs/: create .bonfire/specs/
If specsLocation is specs/: create <git-root>/specs/
If docsLocation is .bonfire/docs/: create .bonfire/docs/
If docsLocation is docs/: create <git-root>/docs/
Detect project name from: package.json name → git remote → directory name
Create config.json with user's answers:
{
"specsLocation": "<user-answer>",
"docsLocation": "<user-answer>",
"gitStrategy": "<user-answer>",
"linearEnabled": <true-or-false>
}
Create index.md with template:
# Session Context: [PROJECT_NAME]
**Date**: [CURRENT_DATE]
**Status**: Active
**Branch**: main
---
## Current State
[Describe what you're working on]
---
## Recent Sessions
### Session 1 - [CURRENT_DATE]
**Goal**: [What you want to accomplish]
**Accomplished**:
- [List completed items]
**Decisions**:
- [Key decisions made]
**Blockers**: None
---
## Next Session Priorities
1. [Priority items]
---
## Key Resources
**Code References**:
- [Component/feature]: `path/to/file.ts`
**External Links**:
- [Issue Tracker](url)
---
## Archived Sessions
[Links to archived sessions will appear here]
---
## Notes
[Any additional context]
Create .gitignore based on chosen strategy and locations:
Ignore all:
*
!.gitignore
Hybrid (only include dirs that are inside .bonfire/):
*
!.gitignore
If docsLocation is .bonfire/docs/, add:
!docs/
!docs/**
If specsLocation is .bonfire/specs/, add:
!specs/
!specs/**
Commit all:
data/
scratch/
scripts/
If .bonfire/ EXISTS, proceed to Step 3.
Check if <git-root>/CLAUDE.md exists.
If CLAUDE.md does NOT exist, create it:
# [PROJECT_NAME]
## Quick Context
Read `.bonfire/index.md` for current project state, recent work, and priorities.
## Bonfire Commands
- `/bonfire:start` - Start a session (reads context)
- `/bonfire:end` - End session (updates context)
- `/bonfire:spec` - Create implementation spec
- `/bonfire:document <topic>` - Document a topic
- `/bonfire:review` - Review work for blindspots and improvements
- `/bonfire:archive` - Archive completed work
- `/bonfire:configure` - Change project settings
If CLAUDE.md EXISTS, check if it references .bonfire/index.md. If not, append:
## Session Context
Read `.bonfire/index.md` for current project state, recent work, and priorities.
Read <git-root>/.bonfire/index.md and report when ready.
Summarize:
Then ask: "What do you want to work on this session?"
Only fetch if user provides a new URL or issue ID:
#, contains github.com, or doesn't match Linear pattern[A-Z]+-[0-9]+ pattern (e.g., ENG-123, ABC-456) or contains linear.appUse gh CLI:
gh pr view [URL] --json title,body,state,labelsgh issue view [URL] --json title,body,state,labelsFirst, read <git-root>/.bonfire/config.json and check linearEnabled.
If linearEnabled is false or not set: Skip Linear, treat as ad-hoc task.
If linearEnabled is true:
linear_search_issues tool to find the issue by ID (e.g., ENG-123)Note: Tool names may vary by Linear MCP implementation. Common tools: linear_search_issues, linear_create_issue, linear_update_issue.
If issue was fetched successfully:
index.md under Current StateIf no URL/issue ID provided (continuing work, ad-hoc task):
Confirm understanding and ask how to proceed.