getspecstory / specstory-cli
CLAUDE.md1.3k starsChanged 6 months agoApache-2.0View on GitHub
SpecStory CLI is a wrapper for coding agents that tracks conversations and generates markdown files. The project uses the Go language and follows standard Go project conventions. The command is always built as specstory, located in the root of the repository. Don't try linting individual files. This often fails with noise in Go Lang, just lint the whole project, it's fast. There are two main modes of operation: To see debug output, you can use the following commands: The codebase…
Trending
More talk lately.thin dataabout the whole repository
Who's talking about specstoryai/getspecstory
- A Hacker News story“Why Git is no "good" for AI-generated code”Hacker News · Apr 2, 2025 · 35 points
- @mikestaub2.bsky.social“If you are using coding agents, I highly recommend you use this asap. It is very obvious that in the future …”Bluesky · Jan 13, 2026 · 2 likes
- UfoMiao/zcf“Miscellaneous set of tools”GitHub · Aug 18, 2025 · 2 reactions
- sudosubin/agents.nix“agent-skills.github.specstoryai.getspecstory: 2.14.1 → 2.15.1”GitHub · Oct 4, 2026
- sudosubin/agents.nix“agent-skills.github.specstoryai.getspecstory: init at 2.14.1”GitHub · Oct 2, 2026
The biggest 5 of 8 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 8
Talked about on GitHub, Hacker News and Bluesky (8 times).
On GitHub · 6
- Aug 18, 2025Miscellaneous set of tools — UfoMiao/zcf2 reactions · 1 comment
- Oct 4, 2026agent-skills.github.specstoryai.getspecstory: 2.14.1 → 2.15.1 — sudosubin/agents.nix0 reactions
- Oct 2, 2026agent-skills.github.specstoryai.getspecstory: init at 2.14.1 — sudosubin/agents.nix0 reactions
- Sep 30, 2026chore(pkg): bump specstory-cli-bin to 2.15.1 — abstraction/custom-pkgbuilds0 reactions
- Sep 13, 2026feat(hygiene): add guarded UTF-8 repair and encoding diagnostics — daviddwlee84/dev-cli0 reactions
1 more on GitHub
- Jul 20, 2026Add specstory kit — docker/sbx-kits-contrib0 reactions · 1 comment
On Hacker News · 1
- Apr 2, 2025Why Git is no "good" for AI-generated code35 points · 11 comments
On Bluesky · 1
- Jan 13, 2026If you are using coding agents, I highly recommend you use this asap. It is very obvious that in the future the session data will be… — @mikestaub2.bsky.social2 likes and reposts
In this repository5 other files it gives its agents.
- lore/AGENTS.mdAGENTS.md
- lore/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- loreSkill
- workthreadsSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
25 rules. About 0 are common, 19 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈19
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 39
Don't try linting individual files.
- Distinctive: line 106
When adding new features, track usage with PostHog:
- Distinctive: line 116
Write only idomatic Go code.
- Distinctive: line 119
Use Go lang libraries, not external dependencies where possible, if a dependency is needed explain why
- Distinctive: line 121
Use "Why" comments, not "what" or "how" unless specifically requested
- Distinctive: line 122
Use single function exit point where possible (immediate guard clauses are OK)
- Very specific: line 124
Start wait-group goroutines with wg.Go(func() { ...
- Distinctive: line 125
Follow existing patterns in the codebase
- Distinctive: line 131
Write unit tests for things with complicated logic
- Distinctive: line 132
Don't write unit tests for simple, tautological things
- Very specific: line 133
Test files follow Go convention: *_test.go alongside source files in the same package
- Distinctive: line 137
Use clear test function naming: TestFunctionName or TestFunctionName_Scenario
- Distinctive: line 144
Test permission errors, missing files, invalid inputs
- Distinctive: line 148
Never put text immediately after the header in markdown, put in a newline first.
- Very specific: line 149
Use zsh code blocks in markdown (not bash)
- Distinctive: line 150
Keep the repository README.md up to date with the latest changes.
- Distinctive: line 151
When planning, never write time/calendar estimates into documents.
- Very specific: line 155
When searching for code, ALWAYS exclude the .specstory directory.
- Distinctive: line 157
Don't just make your own decision, explain the options, the pros and cons, and what you recommend.
- Distinctive: line 159
Don't ever respond with just code changes.
- Distinctive: line 161
Always ask before introducing any new dependencies.
- Distinctive: line 163
Always ask before introducing any new code files.
- Very specific: line 165
Run the linter after every code change golangci-lint run.
- Very specific: line 167
Run tests after every major code change go test -v ./....
- Distinctive: line 169
Don't just run commands, explain what you're doing and why.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to coding agents when working with code in this repository.
Project Overview
SpecStory CLI is a wrapper for coding agents that tracks conversations and generates markdown files. The project uses the Go language and follows standard Go project conventions.
Key Commands
Building
The command is always built as specstory, located in the root of the repository.
# Build for current platform
go build -o specstoryTesting
# Run all tests
go test ./...
# Run tests with verbose output
go test -v ./...
# Run tests for specific package
go test -v ./pkg/cli
go test -v ./pkg/utils
# Run specific test
go test -v -run TestGenerateFilename ./pkg/utilsLinting
Don't try linting individual files. This often fails with noise in Go Lang, just lint the whole project, it's fast.
# Run linter
golangci-lint run
# Format code
gofmt -w .Running the CLI
There are two main modes of operation:
# Interactive interactive auto-save mode
./specstory run
# Sync mode - process all sessions
./specstory sync
# Sync mode - process specific session
./specstory sync -u <uuid>Debugging
To see debug output, you can use the following commands:
# Debug output to stdout
./specstory sync --debug
# Debug log output in ./.specstory/debug/debug.log
./specstory sync --log
# Hidden debug flag (not in public docs)
./specstory sync --debug-raw # Debug mode to output pretty-printed raw data filesTechnical Details
Code Structure
The codebase package structure:
main.go- CLI entry pointpkg/analytics/- PostHog analytics integrationpkg/cloud- Cloud sync integrationpkg/cmd- CLI commands and command parsingpkg/config- Optional TOML config file handlingpkg/log/- Logging utilitiespkg/provenance/- Optional AI provenance trackingpkg/redact/- Secret redaction (betterleaks) shared by markdown generation and cloud syncpkg/providers/*- Provider implementations including file watching, data processing, and session data generationpkg/session/- Session data validation, helpers and markdown generationpkg/spi/- SPI implementation for provider implementationspkg/utils/- Helper functions
JSONL File Behavior
- Session data files grow during conversation (append-only)
runandwatchcommands uses fsnotify for real-time monitoring of the agent's session data directory- Many agents (e.g. Claude Code) use JSONL files for session data (e.g.
~/.claude/projects/<dir-derived-from-project-dir>/<session-id>.jsonl)
Analytics Events
When adding new features, track usage with PostHog:
analytics.TrackEvent(analytics.EventExtensionActivated, analytics.Properties{
"property": "value",
})Code Conventions
- Write only idomatic Go code.
- Prioritize simplicity and readability over terse or clever code
- Emphasize DRY code, look for existing code that can be reused, don't just write new code first.
- Use Go lang libraries, not external dependencies where possible, if a dependency is needed explain why
- Comment everything that's not obvious, if in doubt, comment it.
- Use "Why" comments, not "what" or "how" unless specifically requested
- Use single function exit point where possible (immediate guard clauses are OK)
- Provide consistent observability and tracing with log/slog for logging, not fmt.Println or fmt.Printf
- Start wait-group goroutines with
wg.Go(func() { ... }), neverwg.Add(1)plusgo func() { defer wg.Done() ... }(). The pairing is what goes wrong: anAddwithout itsDone, or aDonethat lives in a different function from itsAdd, deadlocksWaitor panics.wg.Gomakes them inseparable. - Follow existing patterns in the codebase
- The application supports macOS, Linux (including WSL), and native Windows. Keep all three platforms working: guard OS-specific code by
runtime.GOOSor build tags, and prefer shape-based path handling (e.g. drive-letter detection) over GOOS checks where data written on one OS is read on another.
Testing Strategy & Conventions
- Tests use Go's standard
testingpackage - Write unit tests for things with complicated logic
- Don't write unit tests for simple, tautological things
- Test files follow Go convention: *_test.go alongside source files in the same package
- Table-driven tests: tests are structured with test cases defined in slices of structs
- Each struct contains: name, input parameters, and expected results
- Uses t.Run(tt.name, func(t *testing.T) {...}) for subtests
- Use clear test function naming: TestFunctionName or TestFunctionName_Scenario
- Make manual assertions using t.Errorf()
- Unit Tests: Most tests focus on individual functions
- Edge Case Testing: Comprehensive coverage of error conditions, empty inputs, invalid data
- Integration-style Tests: Some tests like TestSessionProcessingFlow test multiple components together
- Tests both success and failure paths
- Validates error messages contain expected strings
- Test permission errors, missing files, invalid inputs
Writing Conventions
- Never put text immediately after the header in markdown, put in a newline first.
- Use
zshcode blocks in markdown (notbash) - Keep the repository
README.mdup to date with the latest changes. - When planning, never write time/calendar estimates into documents.
Development Workflow
When searching for code, ALWAYS exclude the .specstory directory.
Don't just make your own decision, explain the options, the pros and cons, and what you recommend. Have the user make the decision.
Don't ever respond with just code changes. Always include explanations of what you're doing, why you're doing it, and how.
Always ask before introducing any new dependencies.
Always ask before introducing any new code files.
Run the linter after every code change golangci-lint run. Fix formatting errors yourself with gofmt -w ..
Run tests after every major code change go test -v ./....
Don't just run commands, explain what you're doing and why.
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.

