Urgent.News

What's breaking now, across thousands of outlets.

AI

osFoundry 如何在磁碟上找到你的 Claude Code 和 Codex 工作階段,用 Python 重做一遍

~/.claude/projects/-Users-alex-code-shop-api/c5e1a7b2-9d40-4f3e-8b16-2a7c0e9d4f58.jsonl ~/.claude/projects/-Users-alex-code-shop-api/c5e1a7b2-9d40-4f3e-8b16-2a7c0e9d4f58/subagents/agent-<id>.jsonl ~/.codex/state_5.sqlite -> table threads (id, rollout_path, cwd, git_branch, title, …) ~/.codex/sessions/2026/11/04/rollout-2026-11-04T10-00-00-<thread id>.jsonl $ claude --resume…

Claude Code and Codex sessions are stored as JSONL files on disk, with filenames matching the session ID. These files are located within a folder named after the workspace directory. The folder name is a sanitized version of the absolute path, replacing all non-alphanumeric characters with hyphens. The session files contain a list of records, with each line representing a record containing various attributes such as 'type', 'sessionId', 'cwd', 'gitBranch', 'timestamp', and 'version'.

The records also include 'user' and 'assistant' entries, which contain important information like the model used, effort, git branch, and message content. The titles are derived from the 'custom-title' record or, in some cases, from the 'ai-title' record. The JSONL files can be quite large, with the median file size being around 168 MB and the maximum size reaching up to 2.07 GB.

To efficiently process these files, osFoundry reads only the first 80 lines and the last 512 KiB of each file. The script written in Python reads these sessions and extracts the required fields, including the App name, session ID, workspace directory, git branch, and title. The script avoids parsing the entire file and instead focuses on the relevant sections, optimizing the processing time.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

Before You Animate It: Five Checks for AI Product Images

Disclosure: This article is from the RelayMe team. An AI-generated product image can look convincing on its own yet differ from the item a customer will receive.

  • Scrutinize image for labels and text accuracy
  • Compare shape and proportions with reference product
  • Examine colors, materials, and details against original

AI Browser Automation Cost Template for Small Business

An AI browser automation cost template for a small business has five lines, not four: the automation platform ($0 to $60 a month), browser or compute hours ($0 to $50), model calls behind any…

  • AI browser automation cost template has five components
  • Costs range from $0 to $150 per month
  • Helps determine project worthiness by comparing costs to task value

Warren Buffett Warned Investors About This Number 27 Years Ago. It's Never Been Higher. Should AI Investors Worry?

In 1999, Buffett said corporate profits couldn't stay much above 6% of the economy for long. They're now more than double that, and the AI spending boom is a big reason why.

  • Warren Buffett warned about corporate profits reaching 13% of GDP in 2026.
  • AI investors should worry as AI stocks may face slowdown pressure.
  • Berkshire Hathaway focuses on companies with durable competitive advantages.

More from Saturday 7 November →