bug: issues with loading session history from ccs
What's broken
I'm using ccs to switch sessions. While I can add a "claude" provider in Paseo config as ccs work - but then session history doesn't work.
Issue
When Paseo tries to load session history for a claude session started from a non-standard config (e.g. ccs work), it fails.
Potential cause
Some debugging (using claude...) revealed that:
private resolveHistoryPath(sessionId: string): string | null {
const configDir = process.env.CLAUDE_CONFIG_DIR ?? path.join(os.homedir(), ".claude");
...
}
resolveHistoryPath is only checking CLAUDE_CONFIG_DIR (otherwise default to .claude). I've verified that if I set CLAUDE_CONFIG_DIR=~/.ccs/instances/work, things work fine.
But then it'd only work for one claude session at a time - should be at-least support reading this env from claude-work specific config (instead of just process.env?)
Steps to reproduce
- Configure alternate claude provider in Paseo, which uses a non-standard config location (e.g.
ccs work) - Start Paseo, start a chat.
- Restart Paseo
- The chat history from step 2. won't load
Where did this happen
Web (browser)
Paseo version
0.1.104
OS version
Manjaro
Agent provider
Claude Code
Provider configuration
2.1.197 (Claude Code) with ccs
Logs
Screenshots or video
No response
Confirmed as a current bug. Paseo supports provider-specific environment variables, but Claude transcript hydration on current main still selects the history directory from the daemon-wide environment. A Claude profile with its own CLAUDE_CONFIG_DIR can therefore launch against one directory and reload history from another after Paseo restarts.
PR #2514 changes this exact history lookup to use the selected provider profile, but it is still open and unmerged, so the bug remains open. Marking this p2 because it is limited to non-default Claude configuration directories and a daemon-wide CLAUDE_CONFIG_DIR is a workaround, although that workaround cannot support simultaneous profiles.
Same root cause, but one shape that I think both open PRs still leave uncovered: a session started outside Paseo — in a terminal, under a wrapper command that sets CLAUDE_CONFIG_DIR — never appears in Import Session at all.
This issue and #3155 / #3378 are framed around history hydration for a Paseo-launched agent (empty timeline after a restart). The same line breaks the import path too:
// ClaudeAgentClient.listImportableSessions — 0.6.1 app bundle
const configDir = process.env.CLAUDE_CONFIG_DIR ?? path.join(os.homedir(), ".claude");
const sessionsRoot = options?.cwd
? claudeProjectDirSync(options.cwd, { configDir })
: path.join(configDir, "projects");
Repro
Paseo 0.6.1, macOS 26.5.2, desktop-managed local daemon on 127.0.0.1:6767.
- Provider that wraps the CLI in a per-account launcher — claude-swap here, same shape as
ccsin the original report:
"claude-my": {
"extends": "claude",
"label": "Claude (my)",
"command": ["/Users/me/.local/bin/cswap", "run", "my", "--"]
}
- Start a Claude Code session in a terminal the same way (
cswap run my). Its transcript lands in~/.claude-swap-backup/sessions/1-<account>/projects/<slug>/<uuid>.jsonl. - Open Import Session in Paseo for that workspace. The session is not listed — only sessions under the daemon's own config dir are.
So it is not quite "history fails to load": the session is unreachable from the UI in the first place, and there is no way to continue a terminal-started session in Paseo.
Why the open PRs don't cover it
#3378 scopes it out explicitly — "A profile that picks its directory inside a wrapper command is still invisible to Paseo." #3155 resolves the directory from ProviderRuntimeSettings.env, which a wrapper-command provider never declares. So neither fixes this shape after merge, and a wrapper is the normal way multi-account launchers (cswap, ccs, …) get wired — docs/custom-providers.md's command override invites exactly that.
Possible directions, roughly by cost:
- let a provider declare the history location explicitly (a
historyConfigDir, or honorenv.CLAUDE_CONFIG_DIRfor reads even when the launch goes throughcommand); - read the effective
CLAUDE_CONFIG_DIRback from the spawned CLI process's environment and cache it per provider; - scan a configurable list of extra transcript roots when building the import list.
Workaround that works today
For anyone else landing here with cswap: cswap run <account> --share-history symlinks the profile's projects/ and history.jsonl back to ~/.claude, so the daemon and the CLI read the same directory and both history and import start working. The cost is that per-account history separation goes away.
I hit the same issue on Windows with Paseo 0.6.1 and multiple Claude providers, each configured with its own CLAUDE_CONFIG_DIR.
The agents reopened blank and paseo logs
As a local workaround, I changed resolveHistoryPath() in the installed Claude provider:
- const configDir =
- process.env.CLAUDE_CONFIG_DIR ??
- path.join(os.homedir(), ".claude");
+ const configDir =
+ this.buildSdkEnv().CLAUDE_CONFIG_DIR ??
+ path.join(os.homedir(), ".claude");
Installed-file location in my Windows npm installation:
@getpaseo/server/dist/server/server/agent/providers/claude/agent.js
After paseo daemon restart, histories for both alternate Claude profiles loaded again.
This differs from cswap run
Limitation: this fixes history restoration for existing Paseo agents. I have not confirmed that it fixes the import- session listing, because that appears to use a separate config-directory resolution path.
Confirming this is still present in Paseo 0.7.0, and adding evidence that widens it a little beyond the original report.
Still reproducible, and not just for command-wrapper providers
My provider does not wrap the binary at all — it's the documented extends + env form, which I think makes this the mainline multi-account path rather than a ccs/cswap edge case:
"claude-office": {
"extends": "claude",
"label": "Claude Code (second account)",
"env": { "CLAUDE_CONFIG_DIR": "/home/<user>/.claude-office" }
}
CLAUDE_CONFIG_DIR here is a per-agent env overlay. The daemon's own environment has no such variable (tr '\0' '\n' < /proc/$(pidof-paseo)/environ | grep CLAUDE_ is empty), so process.env.CLAUDE_CONFIG_DIR in resolveHistoryPath is undefined and it falls back to ~/.claude — the other account's config dir.
Concretely, for one of my sessions:
transcript actually at: /home/<user>/.claude-office/projects/-home-<user>-projects-foo/88402120-….jsonl (908,800 bytes)
path Paseo computes: /home/<user>/.claude/projects/-home-<user>-projects-foo/88402120-….jsonl (ENOENT)
Why it only shows up "later", and why it's silent
Worth spelling out because it makes the bug easy to misattribute. History is only re-read from the transcript when the session is re-instantiated from a persistence handle:
ClaudeAgentSessionconstructor —providers/claude/agent.js:1653→this.loadPersistedHistory(handle.sessionId)loadPersistedHistory→resolveHistoryPath→agent.js:3940(the line quoted in the issue)
While the process is live the timeline comes off the stream, so a fresh session looks completely fine. It's reopening an idle/exited agent, or a daemon restart, that surfaces it. And loadPersistedHistory bails with
if (!historyPath || !fs.existsSync(historyPath)) return;
— no throw, no log line. A blank timeline is indistinguishable from a genuinely empty session, which is why this reads as data loss rather than a lookup miss.
Second site with the same defect
ClaudeAgentClient.listImportableSessions — agent.js:1136 — resolves the same way:
const configDir = process.env.CLAUDE_CONFIG_DIR ?? path.join(os.homedir(), ".claude");
so the "import an existing Claude Code session" picker is also blind to any non-default config dir. Same one-line shape, probably worth fixing in the same pass.
The env is already in scope at the call site
Picking up on the issue's closing question — no new plumbing seems to be needed. ClaudeAgentSession already builds the child env from the provider overlay:
buildSdkEnv() {
return createProviderEnv({
baseEnv: process.env,
runtimeSettings: this.runtimeSettings,
overlays: [this.launchEnv], // <- carries the provider's CLAUDE_CONFIG_DIR
});
}
so resolveHistoryPath can read the effective env instead of process.env. claudeProjectDirSync already accepts an explicit { configDir } (providers/claude/project-dir.js:55), so only the resolution of that value needs to change. There's also in-tree precedent for honouring the override — the agent-hook installer handles it explicitly via configDirEnvOverride: "CLAUDE_CONFIG_DIR" (terminal/agent-hooks/claude/claude.js:21).
Possibly related
- #3589 — same class of defect (per-provider
CLAUDE_CONFIG_DIRignored by daemon-side resolution), different site: credential lookup for the usage panel. - #3883 — same symptom (empty timeline, transcript intact on disk) but attributed to
ProcessTransportclosing early under heap pressure. That reporter's provider also setsCLAUDE_CONFIG_DIRvia a wrapper, so some of those blank re-renders may be this issue rather than the transport one. A distinguishing test: with this bug the history never comes back on its own, because the file is never found at the computed path.
Environment
- Paseo 0.7.0 (daemon + CLI, self-hosted, no relay)
- Claude Code 2.1.247,
@anthropic-ai/claude-agent-sdk0.3.246 - Ubuntu 24.04.4, kernel 6.8.0
- Two Claude accounts side by side via
CLAUDE_CONFIG_DIR; both stay logged in, which is otherwise working well
Workaround status
For anyone hitting this: the transcripts are intact, only Paseo's lookup misses them. CLAUDE_CONFIG_DIR=<dir> claude --resume in the project directory still lists and opens them. Setting CLAUDE_CONFIG_DIR on the daemon (as the issue notes) is not usable with more than one account, and symlinking the alternate projects/ tree into ~/.claude/projects/ only works for project directories that the default account has never been used in — in my case every one of them collided.
Thanks for reporting this, and to everyone who added their setup here. #5437 is merged: a Claude provider that sets CLAUDE_CONFIG_DIR in its env now shows its chat history after a daemon restart, lists its sessions in Import session, and reads models from that directory's settings.json.
That covers the extends + env setups from @ubeyou and @abhi-wan-kenobi. It does not cover a provider whose command is a wrapper that picks the directory itself (ccs work, cswap run), because Paseo never sees that value, so this issue stays open for that case.
If your wrapper only chooses the config directory, you can declare that directory in the provider's env and let Paseo launch Claude Code directly:
"claude-work": {
"extends": "claude",
"label": "Claude (work)",
"env": { "CLAUDE_CONFIG_DIR": "/home/<you>/.ccs/instances/work" }
}
The fix is merged but not in v0.9.2, the current release. It will be in the next release, and that version number isn't decided yet. Changes usually appear in a beta first on the releases page.
Priority stays p2, with the reports from @creatorKoo, @ubeyou and @abhi-wan-kenobi counted.
The extends + env setups are fixed by #5437, which is merged and not yet in a release. What stays open is a provider whose command is a wrapper that picks the config directory itself (ccs work, cswap run), and declaring that directory in the provider's env works around it, as described in the comment above. Updates go on this issue.
The provider-env workaround above will also support Rewind conversation and Rewind conversation and files after #6325 ships. If you declare CLAUDE_CONFIG_DIR in the Claude provider's env, those actions will use that provider's history instead of failing with “Session not found.” Thanks for reporting this and describing the different setups.
The change is merged and will be in the next release. The current release, v0.11.2, does not contain it, and the next version number is not decided yet. Watch the releases page if you want it sooner, changes often appear in a beta before the stable release.
This does not resolve the wrapper-only case where ccs or cswap chooses the directory internally. I'm leaving this issue open for that case; updates will appear here.
Thanks for the report. I'm closing this because it has been quiet for a month. If this still happens on v0.16.2, please open a new issue.