スキル一覧に戻る
jasonkuhrt

cc-internals

by jasonkuhrt

Tool configurations

1🍴 0📅 2026年1月22日
GitHubで見るManusで実行

SKILL.md


name: cc-internals description: How Claude Code works internally. Use for ANY question about CC behavior, architecture, or "how does CC do X". Covers session storage, /rename scope, project organization, file locations, and internal data structures.

Claude Code Internals

Facts about how Claude Code organizes and stores data.

Storage Layout

~/.claude/
├── settings.json              # User config (see cc-configuring-permissions)
├── skills/                    # User-level skills
├── session-env/               # Session environment cache
└── projects/                  # All session data, per-project
    └── <encoded-path>/        # One dir per project cwd
        ├── sessions-index.json    # Session metadata index
        ├── <uuid>.jsonl           # Session transcripts
        └── agent-<hash>.jsonl     # Subagent transcripts

Project Path Encoding

Project directories are cwd paths with slashes replaced by dashes:

cwdEncoded directory name
/Users/me/projects/foo-Users-me-projects-foo
/Users/me/foo/.worktrees/bar-Users-me-foo--worktrees-bar

Decode: echo "-Users-me-foo" | sed 's/^-/\//; s/-/\//g'

Sessions Index (sessions-index.json)

Each project has one index tracking all sessions in that project.

{
  "version": 1,
  "entries": [
    {
      "sessionId": "027b253b-7743-4cd7-8c7b-96740e0a3cf8",
      "fullPath": "/Users/.../<uuid>.jsonl",
      "firstPrompt": "user's first message...",
      "summary": "Auto-generated summary",
      "customTitle": "user-set via /rename",
      "messageCount": 28,
      "created": "2026-01-17T00:22:31.447Z",
      "modified": "2026-01-17T00:44:18.038Z",
      "gitBranch": "main",
      "projectPath": "/Users/me/projects/foo",
      "isSidechain": false,
      "fileMtime": 1769006749607
    }
  ]
}

Session Entry Fields

FieldDescription
sessionIdUUID, matches .jsonl filename
summaryAuto-generated by CC
customTitleUser-set via /rename (null if unset)
firstPromptFirst user message (truncated)
gitBranchBranch at session creation
projectPathAbsolute cwd path
messageCountTotal messages in session
isSidechainWhether session is a sidechain
created / modifiedISO timestamps
fileMtimeFile modification time (epoch ms)

/rename Command

Sets customTitle field in sessions-index.json.

AspectBehavior
ScopePer-project (cwd-specific)
CollisionSame name can exist in different projects
StorageOnly in index, not in .jsonl transcript
PersistenceSurvives session end, stored in index

Finding Named Sessions

# All named sessions across all projects
for dir in ~/.claude/projects/*/; do
  jq -r '.entries[] | select(.customTitle != null) | "\(.customTitle) | \(.projectPath)"' \
    "$dir/sessions-index.json" 2>/dev/null
done

# Named sessions in current project
jq -r '.entries[] | select(.customTitle != null) | "\(.customTitle): \(.sessionId)"' \
  ~/.claude/projects/-Users-me-projects-foo/sessions-index.json

Session Transcripts (.jsonl)

Each line is a JSON object. See cc-thread-search for search patterns.

{"type": "user", "timestamp": "<ISO>", "message": {...}, "sessionId": "<uuid>"}
{"type": "assistant", "timestamp": "<ISO>", "message": {...}, "sessionId": "<uuid>"}
{"type": "summary", ...}
TopicSkill
Searching transcriptscc-thread-search
Permission configcc-configuring-permissions
Hook configcc-writing-hooks
MCP configcc-configuring-mcp

スコア

総合スコア

55/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

レビュー

💬

レビュー機能は近日公開予定です