- Session data is NEVER modified. Any PR that writes to
~/.claude/,~/.codex/,~/.copilot/,~/.gemini/,~/.factory/,~/.cursor/, or~/.local/share/opencode/is a critical bug. - Handoff files (
.continues-handoff.md) write only to the project's own working directory — never to tool storage paths.
- All local imports must use
.jsextensions, even for.tssource files:import { foo } from './bar.js' - Never use
require()— this is an ESM-only codebase ("type": "module"inpackage.json) - Use
process.exitCode = Ninstead ofprocess.exit(N)— allows cleanup handlers to run
- Use typed errors from
src/errors.ts(ParseError,SessionNotFoundError,ToolNotAvailableError) for user-facing error paths — not barethrow new Error() - Parsers must silently skip malformed session data with
catch {}— never propagate parse errors to the caller
- Every
SessionSourcemember insrc/types/tool-names.tsmust have a registeredToolAdapterinsrc/parsers/registry.ts - The completeness assertion at the bottom of
registry.tsthrows at module load if any adapter is missing — a missing entry crashes the CLI at startup - Adding a tool to
TOOL_NAMESwithout a registry entry is always a bug; changes toSessionSourcerequire coordinated updates in the registry, fixtures, and tests
- Biome handles all formatting and style — do not introduce ESLint, Prettier, or TSLint configs
- No synchronous file I/O (
readFileSync,writeFileSync) in parser code — blocks the event loop when scanning large session directories - Shared helpers
cleanSummary,extractRepoFromCwd, andhomeDirlive insrc/utils/parser-helpers.ts— do not duplicate them in individual parsers
- Parsers run in parallel via
Promise.allSettledin the session index builder — a slow parser delays only its own results - The session index uses a 5-minute TTL cache at
~/.continues/sessions.jsonl— cache bypasses should be explicitly justified