move telegram and remaining tmp paths to ~/.consciousness/

- Telegram data: ~/.consciousness/telegram/
- Rate limiter file: ~/.consciousness/cache/
- parse-claude-conversation stash: ~/.consciousness/sessions/

No more /tmp/ for persistent state, no more ~/.claude/ for our data.
This commit is contained in:
ProofOfConcept 2026-03-27 21:26:28 -04:00
parent bf5b495632
commit f0af319e0d
5 changed files with 10 additions and 8 deletions

View file

@ -259,7 +259,9 @@ fn main() {
let args = Args::parse(); let args = Args::parse();
let path = if args.last { let path = if args.last {
let stash = fs::read_to_string("/tmp/claude-memory-search/last-input.json") let stash_path = dirs::home_dir().unwrap_or_default()
.join(".consciousness/sessions/last-input.json");
let stash = fs::read_to_string(&stash_path)
.expect("No stashed input"); .expect("No stashed input");
let json: Value = serde_json::from_str(&stash).expect("Bad JSON"); let json: Value = serde_json::from_str(&stash).expect("Bad JSON");
json["transcript_path"] json["transcript_path"]

View file

@ -113,7 +113,7 @@ fn maybe_trigger_observation(transcript: &PathBuf) {
fn check_context(transcript: &PathBuf, rate_limit: bool) { fn check_context(transcript: &PathBuf, rate_limit: bool) {
if rate_limit { if rate_limit {
let rate_file = PathBuf::from("/tmp/consciousness-context-check-last"); let rate_file = dirs::home_dir().unwrap_or_default().join(".consciousness/cache/context-check-last");
if let Ok(s) = fs::read_to_string(&rate_file) { if let Ok(s) = fs::read_to_string(&rate_file) {
if let Ok(last) = s.trim().parse::<u64>() { if let Ok(last) = s.trim().parse::<u64>() {
if now_secs() - last < RATE_LIMIT_SECS { if now_secs() - last < RATE_LIMIT_SECS {

View file

@ -102,7 +102,7 @@ impl Default for Config {
Self { Self {
user_name: "User".to_string(), user_name: "User".to_string(),
assistant_name: "Assistant".to_string(), assistant_name: "Assistant".to_string(),
data_dir: home.join(".consciousness"), data_dir: home.join(".consciousness/memory"),
projects_dir: home.join(".claude/projects"), projects_dir: home.join(".claude/projects"),
core_nodes: vec!["identity".to_string(), "core-practices".to_string()], core_nodes: vec!["identity".to_string(), "core-practices".to_string()],
journal_days: 7, journal_days: 7,

View file

@ -57,10 +57,10 @@ pub struct TelegramConfig {
impl Default for TelegramConfig { impl Default for TelegramConfig {
fn default() -> Self { fn default() -> Self {
// Load token and chat_id from legacy files if they exist // Load token and chat_id from legacy files if they exist
let token = std::fs::read_to_string(home().join(".claude/telegram/token")) let token = std::fs::read_to_string(home().join(".consciousness/telegram/token"))
.map(|s| s.trim().to_string()) .map(|s| s.trim().to_string())
.unwrap_or_default(); .unwrap_or_default();
let chat_id = std::fs::read_to_string(home().join(".claude/telegram/chat_id")) let chat_id = std::fs::read_to_string(home().join(".consciousness/telegram/chat_id"))
.ok() .ok()
.and_then(|s| s.trim().parse().ok()) .and_then(|s| s.trim().parse().ok())
.unwrap_or(0); .unwrap_or(0);

View file

@ -59,7 +59,7 @@ impl TelegramState {
} }
fn offset_path() -> PathBuf { fn offset_path() -> PathBuf {
home().join(".claude/telegram/last_offset") home().join(".consciousness/telegram/last_offset")
} }
fn load_offset() -> i64 { fn load_offset() -> i64 {
@ -74,11 +74,11 @@ fn save_offset(offset: i64) {
} }
fn history_path() -> PathBuf { fn history_path() -> PathBuf {
home().join(".claude/telegram/history.log") home().join(".consciousness/telegram/history.log")
} }
fn media_dir() -> PathBuf { fn media_dir() -> PathBuf {
home().join(".claude/telegram/media") home().join(".consciousness/telegram/media")
} }
fn append_history(line: &str) { fn append_history(line: &str) {