Skip to main content

A complete terminal implementation of Anthropic's Claude.

Project description

tclaude — Claude in the terminal

A complete implementation of Claude in the terminal.

Unlike other tools that aim to support all kinds of LLMs, tclaude is designed specifically for Claude. As such, Claude-specific features like caching, Claude-native web search or code execution are implemented correctly and fully.

Highlights

  • Interactive chat with resumable sessions, extended thinking, and tool use
    • Built-in gounded web search, code execution, and file analysis
    • Remote MCP server support (local server support coming soon)
  • Implement any custom tool in just a few lines of Python
  • Automatic caching (makes Claude up to 10x cheaper!)

Installation

git clone https://github.com/tom94/tclaude
pip install . --user

Then set the ANTHROPIC_API_KEY environment variable to your Claude API key and you are good to go.

Usage

Running tclaude opens a new chat session. You can also directly pass a prompt to start a session.

tclaude "How do I make great pasta?"
# or: echo "How do I make great pasta?" | tclaude
> Great pasta starts with quality ingredients and proper technique. ...

Or use an outward pipe to integrate tclaude into unix workflows

git diff --staged | tclaude "Write a commit message for this diff." | xargs -0 git commit -m

Upload files with -f

tclaude -f paper.pdf "Summarize this paper."
tclaude -f cat.png "Is this a dog?"

Claude will use web search and server-side code execution when the request demands it:

tclaude "Tell me the factorials from 1 through 20."
> [Uses Python to compute the answer.]

tclaude "What is the state of the art in physically based rendering?"
> [Uses web search and responds with citations.]

Sessions

Once you're done chatting, the session will be automatically named and saved as <session-name>.json in the working directory.

You can resume the session with tclaude -s <session-name>.json.

Customize where sessions are saved by passing --sessions-dir <dir> or by setting the TCLAUDE_SESSIONS_DIR environment variable.

Extended thinking

Enable thinking with --thinking

tclaude --thinking "Write a quine in C++."
> [Claude thinks about how to write a quine before responding.]

Custom system prompt

If you'd like to customize the behavior of Claude (e.g. tell it to be brief, or give it background information), create ~/.configs/tclaude/roles/default.md. The content of this file will be prepended as system prompt to all conversations.

If you'd like to load different system prompts on a case-by-case basis, you can pass them as

tclaude --role pirate.md "How do I make great pasta?"
> Ahoy there, matey! Ye be seekin' the secrets of craftin' the finest pasta this side of the Mediterranean, eh? ...

Custom tools

Simply implement your tool as a function in src/tclaude/tools.py and it will be callable by Claude. Make sure to document the tools' function thoroughly such that Claude uses it optimally.

MCP server support

To connect tclaude to remote MCP servers, create ~/.configs/tclaude/tclaude.toml with the servers' address and authorization tokens:

[[mcp.remote_servers]]
name = "example-mcp"
url = "https://example-server.modelcontextprotocol.io/sse"
authorization_token = "<your-authorization-token>"
# Optional: restrict the tools that can be used with this MCP server
# tool_configuration.enabled = true
# tool_configuration.allowed_tools = [
#   "example_tool_1",
#   "example_tool_2",
# ]

[[mcp.remote_servers]]
name = "another-mcp-server"
url = "..."

License

GPLv3; see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tclaude-0.1.3.tar.gz (45.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tclaude-0.1.3-py3-none-any.whl (57.3 kB view details)

Uploaded Python 3

File details

Details for the file tclaude-0.1.3.tar.gz.

File metadata

  • Download URL: tclaude-0.1.3.tar.gz
  • Upload date:
  • Size: 45.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for tclaude-0.1.3.tar.gz
Algorithm Hash digest
SHA256 3e35b3cb75cd91fca8d2999807e61a03145b1235f4b83333d48586610e088ead
MD5 b6878a33b6eb6b66623d083a543a29e3
BLAKE2b-256 eb2fd9fdd8dc502159bcac0a5e6e63a17935f0cc30e343c1d8c2d81c5af7ce8f

See more details on using hashes here.

File details

Details for the file tclaude-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: tclaude-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 57.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for tclaude-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8e0bcc17e6abc8b02c57ab9d9f6eeedb7a5491146d033c53fcfe01f2cc361923
MD5 7d6a64008f38f1820f603056309b6a16
BLAKE2b-256 d4a1d47ae80aebe85895e4789082c338708a1edb35ceb80c22ba8aca8559ee46

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page