Tejas AI AgentA Claude Code-like AI coding assistant running inside VS Code. It can read, write, and search files, run terminal commands, and chat with vision support — all from a sidebar panel powered by Anthropic's Claude. Features
Setup1. Clone the repository
2. Install dependencies
3. Open in VS Code
4. Run the extensionPress The Tejas AI icon will appear in the Activity Bar on the left. API Key SetupThe extension requires your own Anthropic API key to work. Get your API key:
The key is stored securely in VS Code's encrypted SecretStorage (OS-level protected). It is never written to disk in plain text and never shared. There are 3 ways to set the key: Option 1 — Auto prompt (first-time users)If no key exists in SecretStorage and no
Enter your key and press Enter — it is saved to SecretStorage immediately. Option 2 — Command Palette
Enter your key in the password field. Use this anytime to update or change the key. Option 3 —
|
| Tool | Description | Requires Approval |
|---|---|---|
read_file |
Read a file from the workspace | No |
list_files |
List files in a directory | No |
search_code |
Search for text across workspace files | No |
write_file |
Create or overwrite a file | Yes |
run_command |
Execute a terminal command | Yes |
Dangerous tool approval flow
AI wants to use write_file or run_command
|
v
Yellow confirmation card appears in sidebar:
"⚠️ Allow this action?"
Shows tool name + file path or command
|
-------+-------
| |
[✓ Allow] [✗ Deny]
| |
Tool executes AI receives "denied"
and suggests an alternative
Workspace boundary protection
The AI can only access files inside the workspace folder. Any attempt to read, write, or list files outside the workspace is blocked:
Error: Access denied: "../../../etc/hosts" is outside the workspace
@File Mention
Type @ in the chat input to trigger a file autocomplete dropdown. Select a file and its full content will be appended to your message before sending to Claude.
Example:
Explain what @src/services/openai.ts does
Project Structure
tejas-agent/
├── src/
│ ├── extension.ts # Entry point — SecretStorage, key migration, command registration
│ ├── services/
│ │ └── openai.ts # Anthropic API client, agentic loop, streaming, tool execution
│ ├── sidebar/
│ │ └── SidebarProvider.ts # Webview UI, chat rendering, history, permission system
│ └── tools/
│ └── index.ts # Tool definitions, executeTool() dispatcher, safePath()
├── .env # Optional — gitignored, auto-migrated to SecretStorage
├── package.json
└── README.md
Key Files Explained
extension.ts
getOrSetApiKey()— checks SecretStorage → falls back to.env→ prompts user if neither exists- Registers the
tejas-agent.setApiKeycommand - Passes the resolved API key to
SidebarProvider
services/openai.ts
runAgentLoop()— the main agenticwhileloop- Streaming via
messages.stream()andstream.on('text', ...) - Handles
stop_reason === 'tool_use'— executes tools and feeds results back to Claude DANGEROUS_TOOLSlist — callsonConfirm()callback before executing sensitive tools
sidebar/SidebarProvider.ts
- Inline Webview HTML/CSS/JS (no external files)
pendingConfirmsMap — Promise-based approval system for dangerous toolsworkspaceState— persistsagentHistoryanddisplayHistoryacross restarts@mentionregex parser — reads mentioned files and injects content into the message
tools/index.ts
toolDefinitions— AnthropicTool[]schema passed to the APIexecuteTool()— switch-case dispatcher for all 5 toolssafePath()— resolves and validates paths to prevent directory traversal attacks
Release Notes
0.0.3
- Secure API key storage via VS Code SecretStorage (auto-migration from
.env) - Workspace path traversal prevention (
safePath()) Tejas AI: Set API Keycommand
0.0.2
- Image upload and vision support
- Tool activity log
@filemention autocomplete- Permission system (Allow/Deny for dangerous tools)
- Improved input UI
0.0.1
- Initial release
- Agentic tool use (read, write, list, search, run command)
- Streaming responses and markdown rendering
- Active file context and persistent chat history