davila7/claude-code-templates · warning
Session not found
Error message
Session not found
What it means
HTTP 404 from the teams dashboard GET /api/sessions/:id when parseFullSession(id) returns null — no session file with that id exists or it could not be resolved.
Source
Thrown at cli-tool/src/teams-dashboard.js:678
// Global summary stats
this.app.get('/api/summary', async (req, res) => {
try {
res.json({
totalSessions: this.sessions.length,
totalAgents: this.sessions.reduce((sum, s) => sum + s.agentCount, 0),
timestamp: new Date().toISOString()
});
} catch (error) {
res.status(500).json({ error: 'Failed to load summary' });
}
});
// Full session detail (triggers parse)
this.app.get('/api/sessions/:id', async (req, res) => {
try {
const session = await this.parseFullSession(req.params.id);
if (!session) return res.status(404).json({ error: 'Session not found' });
res.json({
id: session.id,
projectName: session.projectName,
gitBranch: session.gitBranch,
startTime: session.startTime,
endTime: session.endTime,
duration: session.duration,
agents: session.agents,
teammateNames: session.teammateNames,
stats: session.stats
});
} catch (error) {
res.status(500).json({ error: 'Failed to load session' });
}
});
// Timeline (paginated)View on GitHub (pinned to a0851ed10c)
Solutions
- GET /api/sessions to list valid ids and use one
- Verify the session file still exists on disk
- Re-check the id format (must match parsed session ids exactly)
Defensive patterns
Strategy: validation
Validate before calling
const ids = (await (await fetch('/api/sessions')).json()).sessions.map(s => s.id);
if (!ids.includes(id)) throw new Error('unknown session'); Prevention
- Always resolve ids from the live session list
- Handle 404 by refreshing the list
When it happens
Trigger: GET /api/sessions/<unknown-id>; session file deleted between list and detail view; id with wrong case/format.
Common situations: Stale session list in UI after files cleaned up; mistyped or truncated session id.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
AI-assisted analysis of davila7/claude-code-templates@a0851ed10c (2026-08-28).
Data as JSON: /api/errors/11be358c547c5762.
Report an issue: GitHub.