Turn TryHackMe browser activity and terminal commands into structured, Obsidian-ready Markdown notesβwith an optional privacy-aware AI layer.
Features Β· How it works Β· Quick start Β· AI layer Β· Security Β· Roadmap
Important
ByteTrace is a development preview. Always review generated notes before publishing or treating them as authoritative.
| Capability | What it does | |
|---|---|---|
| π | Firefox capture | Captures room metadata, task headings, selected text, findings, lessons, and objectives. |
| β¨οΈ | Terminal link | Pairs a local Bash session and records commands, working directories, exit codes, phases, and optional output. |
| π§ | ByteTrace AI | Reorganizes the complete sanitized draft, proposes better classifications, and produces a polished final note. |
| π | Local-first privacy | Keeps raw evidence and secret-placeholder mappings on your machine; only sanitized content can reach the AI provider. |
| π | Obsidian-ready notes | Generates Markdown with frontmatter, callouts, code blocks, task sections, and graph links. |
| π§ͺ | Future training path | Exports only user-approved examples for later evaluation or LoRA fine-tuning. |
| Mode | AI used? | Best for |
|---|---|---|
| Template | No | Fast, deterministic notes with no external AI request. |
| AI Summary | Yes | Keeps the deterministic structure and adds an AI-written summary. |
| Full Draft | Yes | Lets ByteTrace inspect the entire sanitized Markdown draft and reorganize it into a final note. |
flowchart LR
subgraph LOCAL["π Your local machine"]
FX["π Firefox extension"]
SH["β¨οΈ Bash terminal"]
API["π Local companion"]
DB[("π¦ Session store")]
RED["π‘οΈ Secret redaction"]
VERIFY["Policy verification"]
MD["π Markdown renderer"]
FX --> API
SH --> API
API --> DB
DB --> RED
VERIFY --> MD
end
subgraph OPTIONAL["βοΈ Optional hosted inference"]
AI["π§ ByteTrace AI"]
end
RED -- "sanitized draft" --> AI
AI -- "structured plan" --> VERIFY
MD --> OUT["π₯ Reviewed .md note"]
classDef input fill:#EA580C,stroke:#FDBA74,color:#FFFFFF;
classDef local fill:#0F766E,stroke:#5EEAD4,color:#FFFFFF;
classDef ai fill:#7C3AED,stroke:#C4B5FD,color:#FFFFFF;
classDef output fill:#2563EB,stroke:#93C5FD,color:#FFFFFF;
class FX,SH input;
class API,DB,RED,VERIFY,MD local;
class AI ai;
class OUT output;
ByteTrace never receives the local secret-placeholder map. Its returned plan is validated before rendering, and the Firefox extension asks for confirmation before classifications are saved or the note is downloaded.
- Linux or another Unix-like environment
- Python 3.11 or newer
- Firefox
- Bash for terminal capture
- Optional: an Obsidian vault and a Cloudflare account for AI generation
After cloning the repository, enter the project directory:
cd bytetracePYTHONPATH=src python3 -m bytetrace --data-dir .data serveThe companion listens on 127.0.0.1:8765 by default. Leave this terminal running while you use the extension.
In a second terminal:
PYTHONPATH=src python3 -m bytetrace --data-dir .data tokenCopy the token.
- Open
about:debugging#/runtime/this-firefox. - Select Load Temporary Add-on.
- Open
extension/manifest.jsonfrom this repository. - Open the extension settings.
- Keep the companion URL as
http://127.0.0.1:8765. - Paste the pairing token and click Save settings.
- Click Test connection.
Note
Temporary Firefox add-ons disappear after Firefox restarts. Load extension/manifest.json again when needed.
- Open a TryHackMe room.
- Open the extension popup and start a session.
- Capture selected context, findings, objectives, and lessons as you work.
- Optionally pair a terminal using the instructions below.
- Choose Template, AI Summary, or Full Draft.
- Review ByteTrace's proposed changes.
- Confirm and download the Markdown note.
With the companion still running, select Pair terminal in the extension. It displays a command containing a short-lived pairing code, similar to:
./bytetrace-terminal ABCD-1234Run the displayed command from a new terminal. The wrapper loads a Bash integration that sends command events to the active browser session.
| Command | Purpose |
|---|---|
bytetrace-task Enumeration |
Change the phase assigned to later commands. |
bytetrace-output FILE |
Attach selected output to the preceding command. |
bytetrace-pause |
Pause terminal event capture. |
bytetrace-resume |
Resume terminal event capture. |
exit |
A leading space keeps a sensitive command private and unrecorded. |
exit |
Leave the paired shell. |
Command text, working directory, exit status, and phase are recorded. Output is opt-in and truncated before storage.
Warning
Do not paste passwords, tokens, private keys, or other secrets into captured output. Redaction is a safety layer, not a guarantee.
The current wrapper targets a local Bash terminal. Kali Linux and a TryHackMe AttackBox can use the same event protocol, but portable remote bundles are still on the roadmap. Never expose the local companion directly to the public internet.
ByteTrace is the AI layer responsible for understanding the whole sanitized draftβnot just one captured field. In Full Draft mode it can:
- separate the real room objective from explanatory context;
- group evidence under appropriate tasks and phases;
- turn raw findings into concise conclusions;
- preserve terminal commands and important supporting evidence;
- identify missing information without inventing steps;
- return structured classifications with confidence scores and reasons.
The verifier accepts automatic reclassification only when confidence is at least 80%. Auto-detected tasks and terminal commands remain locked to protect source evidence.
Cloudflare Workers AI currently provides a free daily allocation suitable for development and personal testing. Provider pricing and policies can change, so verify the current limits in the official Workers AI pricing documentation.
Create a Cloudflare API token with Workers AI permissions, then configure it in the Firefox extension under Settings β AI provider:
- Provider: Cloudflare Workers AI
- Account ID: your Cloudflare account ID
- API token: your Workers AI token
- Model: the configured default or another compatible text-generation model
Credentials are sent only to the local companion and stored in .data/config.json with restrictive file permissions. They are never placed in generated notes.
Useful official references:
Configure Cloudflare from the CLI
PYTHONPATH=src python3 -m bytetrace \
--data-dir .data \
configure-ai YOUR_ACCOUNT_IDThe command asks for the Workers AI API token using a hidden prompt.
Check the stored configuration without revealing the token:
PYTHONPATH=src python3 -m bytetrace --data-dir .data ai-statusYou can learn structural preferences from an existing Obsidian vault without training a model. The scanner extracts safe formatting signals such as headings, tags, callout types, and code-block languages.
Build and save the local style profile:
PYTHONPATH=src python3 -m bytetrace \
--data-dir .data \
profile-vault "/path/to/your/Obsidian/Vault"The style scanner does not copy vault content into the profile.
Use the CLI-only recording workflow
Start a session:
PYTHONPATH=src python3 -m bytetrace --data-dir .data start "Example Room" \
--url "https://tryhackme.com/room/example" \
--difficulty EasyRecord an event using the returned session ID:
PYTHONPATH=src python3 -m bytetrace --data-dir .data add SESSION_ID command \
"nmap -sV 10.10.10.10" \
--task EnumerationRender a note:
PYTHONPATH=src python3 -m bytetrace --data-dir .data generate SESSION_ID \
--output example-room.mdFine-tuning is intentionally not the first step. ByteTrace should first collect high-quality, user-corrected examples that can be evaluated.
Approve a reviewed session:
PYTHONPATH=src python3 -m bytetrace --data-dir .data approve-pair SESSION_ID corrected-note.mdExport only approved examples:
PYTHONPATH=src python3 -m bytetrace --data-dir .data export-dataset \
.data/approved-training.jsonlThe export contains sanitized structured events and reviewed Markdown targets. It excludes raw secret mappings.
| Data | Location |
|---|---|
| Raw captured events | Local companion store |
| Secret-placeholder map | Local machine only |
| Sanitized draft | Sent to AI only when an AI mode is selected |
| Provider credentials | Local config with restrictive permissions |
| Final Markdown | Downloaded only after user confirmation |
Additional safeguards:
- The companion binds to loopback by default.
- Bearer-token authentication protects local API requests.
- Cloud inference is optional; Template mode remains fully deterministic.
- AI output is treated as untrusted and validated against a schema and local policy.
- ByteTrace has no browser, shell, or autonomous tool access.
- Generated notes clearly warn that AI content may be inaccurate.
Never commit or force-add .data/ or generated/. They can contain credentials, captured room evidence, terminal history, and personal notes.
Use this project only for rooms and systems you are authorized to access.
The runtime uses only the Python standard library. Run the full test suite with:
PYTHONPATH=src python3 -m unittest discover -s tests -v- Local companion and authenticated event API
- Firefox room and selection capture
- Bash terminal pairing
- Deterministic Obsidian Markdown renderer
- Cloudflare Workers AI integration
- Full-draft ByteTrace classification and verification
- Approved-dataset export
- Portable Kali Linux and AttackBox terminal bundles
- Signed Firefox release package
- Quality evaluations over reviewed notes
- Optional LoRA fine-tuning after enough approved examples exist
Issues and pull requests are welcome. For code changes:
- Create a focused branch.
- Keep secrets and personal vault content out of commits.
- Add or update tests for behavioral changes.
- Run the full test suite before opening a pull request.
Released under the MIT License.
ByteTrace is an independent community project. It is not affiliated with or endorsed by TryHackMe, Mozilla, Obsidian, or Cloudflare. Product names and trademarks belong to their respective owners.
Built for learners who would rather spend their time understanding the room than formatting the notes.