Skip to main content

ClaudeCode

Struct ClaudeCode 

Source
pub struct ClaudeCode { /* private fields */ }
Expand description

Claude Code stores one JSONL file per session under ~/.claude/projects/<sanitized-cwd>/<session-uuid>.jsonl. Each line is an event: user/assistant messages, tool results, summaries, and harness bookkeeping.

ClaudeCode::default() reads the stock ~/.claude install. An embedder that runs several installs in different homes builds one adapter per install with ClaudeCode::in_home.

Implementations§

Source§

impl ClaudeCode

Source

pub fn in_home(home: impl Into<PathBuf>) -> Self

An adapter for the Claude Code install rooted at home (e.g. ~/.claude4). The projects sub-directory layout is the adapter’s business, not the caller’s.

Trait Implementations§

Source§

impl Adapter for ClaudeCode

Source§

fn reconcile_scope(&self) -> Option<String>

An explicit install speaks only for the rows under its own root; the stock adapter speaks for every Claude Code row, as before.

Source§

fn name(&self) -> &'static str

Source§

fn root(&self) -> Option<PathBuf>

Store root, e.g. ~/.claude/projects. May not exist on this machine.
Source§

fn discover(&self) -> Discovered

All session files under the root, with a partial-walk flag the indexer uses to protect deletion reconciliation (see Discovered).
Source§

fn parse(&self, path: &Path) -> Result<Session>

Parse one session file. Must never panic on malformed input; skip bad lines and return what could be read.
Source§

fn store(&self) -> Option<Store>

A shared store (many sessions in one database) for tools that do not use one file per session. When Some, the indexer uses it instead of discover/parse. Default None = ordinary file-per-session adapter.
Source§

fn parse_key(&self, _key: &str) -> Result<Session>

Parse one session out of a shared store by its key (from store().keys). Only called for adapters that return a Store.
Source§

impl Default for ClaudeCode

Source§

fn default() -> ClaudeCode

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.