Guide for AI Assistants#

This page is designed for AI assistants and LLMs to understand how to use thinkt tools effectively. For the plain-text version optimized for LLM context windows, see /llms.txt or invoke thinkt docs llms.

What is thinkt?#

thinkt provides unified access to AI coding assistant session data from:

  • Claude Code (~/.claude/)
  • Kimi Code (~/.kimi/)
  • Gemini CLI (~/.gemini/)
  • Copilot CLI (~/.copilot/)
  • Codex CLI (~/.codex/)
  • Qwen Code (~/.qwen/)

Access methods: CLI, REST API, MCP, Go library.


Quick Reference#

Repository Structure#

PathDescription
/cmd/thinkt/CLI application
/internal/thinkt/Core library
/internal/server/HTTP and MCP servers (embeds web + web-lite submodules)
/docs/hugo/content/Documentation
/internal/server/docs/swagger.yamlOpenAPI spec

Key Documentation#

PagePurpose
CLI GuideCommand-line usage
REST APIHTTP endpoints
MCP ServerMCP tools and setup
DockerSandboxed execution

Integration Methods#

MCP provides direct tool access for AI assistants.

Tools:

ToolPurposeKey Input
list_sourcesAvailable sourcesnone
list_projectsAll projectssource?, include_deleted?
list_sessionsSessions for projectproject_id, source
get_session_metadataSession overviewpath, summary_only?
get_session_entriesSession contentpath, limit, offset, roles, include_thinking
list_active_sessionsActive coding sessionsnone
search_sessionsSearch across indexed sessions (supports regex)query, project?, source?, limit?, case_sensitive?, regex?
semantic_searchSearch by meaning using embeddingsquery, project?, source?, limit?, max_distance?, diversity?

Best Practices:

  1. Call get_session_metadata with summary_only: true first for quick user-intent previews
  2. Use roles: ["user"] to get just prompts
  3. Use entry_indices to fetch specific entries
  4. Set include_thinking: true only when needed
  5. Default limit is 5; paginate with offset

2. CLI#

thinkt projects                     # List projects
thinkt sessions list -p <path>      # List sessions
thinkt sessions view                # View session content
thinkt web                          # Open web interface (auto-starts server)
thinkt web lite                     # Open lightweight debug interface
thinkt server                        # Start HTTP server (foreground)
thinkt server start                  # Start HTTP server (background)
thinkt server status                 # Check server status
thinkt server stop                   # Stop background server
thinkt search "query"                # Search indexed sessions
thinkt semantic search "query"       # Semantic search
thinkt embeddings list               # List embedding models
thinkt embeddings status             # Embedding status
thinkt apps                         # List open-in apps and terminal capability
thinkt apps set-terminal            # Set default terminal for resume

3. REST API#

Base: http://localhost:8784/api/v1

GET /info                            # Server fingerprint, version, uptime
GET /sources
GET /projects?include_deleted=false
GET /projects/{source}/{id}/sessions
GET /sessions/{path}?limit=10&offset=0
GET /sessions/{path}/metadata?summary_only=true&limit=5
GET /search?q=query                  # Full-text search
GET /semantic-search?q=query         # Semantic search
GET /stats                           # Usage statistics
GET /indexer/status                  # Live indexer status

4. Go Library#

import "github.com/wethinkt/go-thinkt/internal/thinkt"

discovery := thinkt.NewDiscovery(claude.Factory(), kimi.Factory(), gemini.Factory(), copilot.Factory(), codex.Factory(), qwen.Factory())
registry, _ := discovery.Discover(ctx)
projects, _ := registry.ListAllProjects(ctx)

Data Model#

Source (claude|kimi|gemini|copilot|codex|qwen)
  ├── Project (directory path)
  │     └── Session (JSONL file)
  │           └── Entry (message)
  │                 └── ContentBlock (text|thinking|tool_use|tool_result)
  └── Team (multi-agent coordination, Claude Code only)
        ├── Member (agent name + session reference)
        ├── Task (shared task board)
        └── Message (inter-agent inbox)

Entry Roles#

RoleDescription
userUser messages
assistantAI responses
toolTool execution
systemSystem messages

Content Block Types#

TypeFields
texttext
thinkingthinking
tool_usetool_use_id, tool_name, tool_input
tool_resulttool_use_id, tool_result, is_error

Common Tasks#

TaskMethod

| Get user prompts only | MCP: get_session_entries with roles: ["user"] | | Export session | API: GET /sessions/{path} |


Tips#

  1. Metadata first - Check session size before loading full content
  2. Paginate - Sessions can have hundreds of entries
  3. Filter by role - Often only user or assistant messages are needed